feat: allow removing multiple items from list

This commit is contained in:
Barış Soner Uşaklı
2021-09-09 22:25:17 -04:00
parent 7f48edc02a
commit 397835a05a
4 changed files with 34 additions and 4 deletions

View File

@@ -94,7 +94,11 @@ RETURNING A."array"[array_length(A."array", 1)] v`,
if (!key) {
return;
}
// TODO: remove all values with one query
if (Array.isArray(value)) {
await Promise.all(value.map(v => module.listRemoveAll(key, v)));
return;
}
await module.pool.query({
name: 'listRemoveAll',
text: `