(
table: SqlTable,
where?: SqlCondition,
returning?: SqlResultColumnSelector | undefined,
)
| 426 | } |
| 427 | |
| 428 | deleteQuery( |
| 429 | table: SqlTable, |
| 430 | where?: SqlCondition, |
| 431 | returning?: SqlResultColumnSelector | undefined, |
| 432 | ): ExecutableSqlQuery { |
| 433 | let line = `DELETE FROM "${table.name}"` |
| 434 | |
| 435 | let values: any[] = [] |
| 436 | if (where && Object.keys(where).length > 0) { |
| 437 | let i: [number] = [1] |
| 438 | const whereData = this.createSqlWhereCondition(table.name, where, i) |
| 439 | line += ` WHERE ${whereData[0]}` |
| 440 | values = whereData.slice(1) |
| 441 | } |
| 442 | |
| 443 | if (typeof returning != "undefined") { |
| 444 | line += ` RETURNING ${this.createSelectQuery(returning)}` |
| 445 | } |
| 446 | return [ |
| 447 | line, |
| 448 | ...values |
| 449 | ] |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | export class PostgresConnection implements AbstractSqlConnection { |
nothing calls this directly
no test coverage detected