(
owner: Owner,
subject: string,
entries: readonly { readonly collection: string; readonly key: string }[],
)
| 1273 | }; |
| 1274 | |
| 1275 | const deleteManyImpl = ( |
| 1276 | owner: Owner, |
| 1277 | subject: string, |
| 1278 | entries: readonly { readonly collection: string; readonly key: string }[], |
| 1279 | ) => |
| 1280 | Effect.gen(function* () { |
| 1281 | for (const [collection, keys] of keysByCollection(entries)) { |
| 1282 | const uniqueKeys = [...keys]; |
| 1283 | for ( |
| 1284 | let offset = 0; |
| 1285 | offset < uniqueKeys.length; |
| 1286 | offset += PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE |
| 1287 | ) { |
| 1288 | const batchKeys = uniqueKeys.slice(offset, offset + PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE); |
| 1289 | yield* input.core.deleteMany("plugin_storage", { |
| 1290 | where: (b) => |
| 1291 | b.and( |
| 1292 | b("plugin_id", "=", input.pluginId), |
| 1293 | b("collection", "=", collection), |
| 1294 | b("key", "in", batchKeys), |
| 1295 | b("owner", "=", owner), |
| 1296 | b("subject", "=", subject), |
| 1297 | ), |
| 1298 | }); |
| 1299 | } |
| 1300 | } |
| 1301 | }); |
| 1302 | |
| 1303 | const putManyImpl = ( |
| 1304 | owner: Owner, |
no test coverage detected