Delete
Performs a query to delete rows from a table.
Possible crash
Methods
selectDatabase()
→ (database = String) → this
Selects a different database for this query.
Parameters
| Parameter | Type | Description |
|---|---|---|
database | String | Name of the database to select |
Returns
→ this
where()
→ (string = String, values = Array<any>) → this
Adds a where-clause to the query
- Values should be set as ? in the string and given in left-to-right order via the 'values'-array to minimize the risk of sql-injection
- If you are using joins, specify the table and column together: table.column
Parameters
| Parameter | Type | Description |
|---|---|---|
string | String | The where-clause as a string with ? representing each values. |
values | Array<any> | Array containing values replacing the ? in the string (from left to right) |
Returns
→ this
force()
→ () → this
Enables deletion of all rows.
Returns
→ this
execute()
async → () → OkPacket
Executes the prepared query.
Returns
→ OkPacket