(
owner: Owner,
subject: string,
entries: readonly { readonly collection: string; readonly key: string }[],
)
| 1303 | }; |
| 1304 | |
| 1305 | const deleteManyImpl = ( |
| 1306 | owner: Owner, |
| 1307 | subject: string, |
| 1308 | entries: readonly { readonly collection: string; readonly key: string }[], |
| 1309 | ) => |
| 1310 | Effect.gen(function* () { |
| 1311 | for (const [collection, keys] of keysByCollection(entries)) { |
| 1312 | const uniqueKeys = [...keys]; |
| 1313 | for ( |
| 1314 | let offset = 0; |
| 1315 | offset < uniqueKeys.length; |
| 1316 | offset += PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE |
| 1317 | ) { |
| 1318 | const batchKeys = uniqueKeys.slice(offset, offset + PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE); |
| 1319 | yield* input.core.deleteMany("plugin_storage", { |
| 1320 | where: (b) => |
| 1321 | b.and( |
| 1322 | b("plugin_id", "=", input.pluginId), |
| 1323 | b("collection", "=", collection), |
| 1324 | b("key", "in", batchKeys), |
| 1325 | b("owner", "=", owner), |
| 1326 | b("subject", "=", subject), |
| 1327 | ), |
| 1328 | }); |
| 1329 | } |
| 1330 | } |
| 1331 | }); |
| 1332 | |
| 1333 | const putManyImpl = ( |
| 1334 | owner: Owner, |
no test coverage detected