hedera-web/js/sql/delete.js

24 lines
352 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
var Stmt = require ('./stmt');
/**
* The equivalent of a SQL delete.
**/
2016-09-26 09:28:47 +00:00
module.exports = new Class
({
2016-09-26 09:28:47 +00:00
Extends: Stmt
,render: function (batch)
{
var sql = 'DELETE FROM ' + this.renderTarget (batch);
if (this.where)
sql += ' WHERE ' + this.where.render (batch);
sql += ' LIMIT 1'; // Only for security.
return sql;
}
});