Builds a DELETE statement scoped by a WHERE map.
DELETE
The WHERE map is required; an empty condition throws rather than emit an unfiltered DELETE that would clear the table.
WHERE
Target table name
Column to value equality conditions (at least one)
The parameterized SQL and its bindings
If no WHERE conditions are provided
const { sql, bindings } = buildDelete('users', { id: 'u1' });// sql: DELETE FROM "users" WHERE "id" = ?// bindings: ['u1'] Copy
const { sql, bindings } = buildDelete('users', { id: 'u1' });// sql: DELETE FROM "users" WHERE "id" = ?// bindings: ['u1']
Builds a
DELETEstatement scoped by a WHERE map.The
WHEREmap is required; an empty condition throws rather than emit an unfilteredDELETEthat would clear the table.