(
owner: Owner,
subject: string,
entries: readonly { readonly collection: string; readonly key: string }[],
)
| 1251 | }; |
| 1252 | |
| 1253 | const deleteManyImpl = ( |
| 1254 | owner: Owner, |
| 1255 | subject: string, |
| 1256 | entries: readonly { readonly collection: string; readonly key: string }[], |
| 1257 | ) => |
| 1258 | Effect.gen(function* () { |
| 1259 | for (const [collection, keys] of keysByCollection(entries)) { |
| 1260 | const uniqueKeys = [...keys]; |
| 1261 | for ( |
| 1262 | let offset = 0; |
| 1263 | offset < uniqueKeys.length; |
| 1264 | offset += PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE |
| 1265 | ) { |
| 1266 | const batchKeys = uniqueKeys.slice(offset, offset + PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE); |
| 1267 | yield* input.core.deleteMany("plugin_storage", { |
| 1268 | where: (b) => |
| 1269 | b.and( |
| 1270 | b("plugin_id", "=", input.pluginId), |
| 1271 | b("collection", "=", collection), |
| 1272 | b("key", "in", batchKeys), |
| 1273 | b("owner", "=", owner), |
| 1274 | b("subject", "=", subject), |
| 1275 | ), |
| 1276 | }); |
| 1277 | } |
| 1278 | } |
| 1279 | }); |
| 1280 | |
| 1281 | const putManyImpl = ( |
| 1282 | owner: Owner, |
no test coverage detected