hedera-web/js/sql/delete.js

24 lines
351 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-12-20 09:32:17 +00:00
*/
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;
}
});