Batch Delete Rows (LCC.db.del)
Signature
rows, err = LCC.db.del(name, id_rows, timeout?)
Parameters
- name
String. Table name. Must be non-empty and no longer than 256 bytes. - id_rows
Table. Array of objects containingid, or a plain array ofidvalues. Everyidmust be an integer value greater than or equal to1. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- rows
Table. Rows deleted from the table;nilon failure. - err
String ornil. Error message such as'unknown table'.
Notes
Removes rows by
idand returns the original data for auditing.
Each array element can be a plain numericidor an object containingid; for objects only theidfield is used. An item whoseidis not an integer value greater than or equal to1triggers a Lua parameter validation error.
Example
local removed, err = LCC.db.del("tasks", { {id = 10}, 11, 12 })
if removed then
LCC.log(1, "Deleted rows", #removed)
end