2016-09-26 09:28:47 +00:00
|
|
|
|
2022-05-26 06:08:31 +00:00
|
|
|
var Stmt = require('./stmt');
|
2016-09-26 09:28:47 +00:00
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
|
|
|
* The equivalent of a SQL delete.
|
2022-05-26 06:08:31 +00:00
|
|
|
*/
|
2022-05-30 01:30:33 +00:00
|
|
|
module.exports = new Class({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Stmt
|
2022-05-30 01:30:33 +00:00
|
|
|
,Tag: 'sql-delete'
|
2015-01-23 13:09:30 +00:00
|
|
|
|
2022-11-16 01:46:44 +00:00
|
|
|
,render(params) {
|
2022-05-30 01:30:33 +00:00
|
|
|
return 'DELETE FROM'
|
|
|
|
+ this.renderTarget(params)
|
|
|
|
+ this.renderIfSet(this.where, 'WHERE', params)
|
|
|
|
+ this.renderLimit(params);
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
});
|