(
owner: Owner,
subject: string,
entries: readonly { readonly collection: string; readonly key: string }[],
)
| 1645 | }; |
| 1646 | |
| 1647 | const deleteManyImpl = ( |
| 1648 | owner: Owner, |
| 1649 | subject: string, |
| 1650 | entries: readonly { readonly collection: string; readonly key: string }[], |
| 1651 | ) => |
| 1652 | Effect.gen(function* () { |
| 1653 | for (const [collection, keys] of keysByCollection(entries)) { |
| 1654 | const uniqueKeys = [...keys]; |
| 1655 | for ( |
| 1656 | let offset = 0; |
| 1657 | offset < uniqueKeys.length; |
| 1658 | offset += PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE |
| 1659 | ) { |
| 1660 | const batchKeys = uniqueKeys.slice(offset, offset + PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE); |
| 1661 | yield* input.core.deleteMany("plugin_storage", { |
| 1662 | where: (b) => |
| 1663 | b.and( |
| 1664 | b("plugin_id", "=", input.pluginId), |
| 1665 | b("collection", "=", collection), |
| 1666 | b("key", "in", batchKeys), |
| 1667 | b("owner", "=", owner), |
| 1668 | b("subject", "=", subject), |
| 1669 | ), |
| 1670 | }); |
| 1671 | } |
| 1672 | } |
| 1673 | }); |
| 1674 | |
| 1675 | const putManyImpl = ( |
| 1676 | owner: Owner, |
no test coverage detected