(
owner: Owner,
subject: string,
entries: readonly { readonly collection: string; readonly key: string }[],
)
| 1631 | }; |
| 1632 | |
| 1633 | const deleteManyImpl = ( |
| 1634 | owner: Owner, |
| 1635 | subject: string, |
| 1636 | entries: readonly { readonly collection: string; readonly key: string }[], |
| 1637 | ) => |
| 1638 | Effect.gen(function* () { |
| 1639 | for (const [collection, keys] of keysByCollection(entries)) { |
| 1640 | const uniqueKeys = [...keys]; |
| 1641 | for ( |
| 1642 | let offset = 0; |
| 1643 | offset < uniqueKeys.length; |
| 1644 | offset += PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE |
| 1645 | ) { |
| 1646 | const batchKeys = uniqueKeys.slice(offset, offset + PLUGIN_STORAGE_DELETE_KEY_BATCH_SIZE); |
| 1647 | yield* input.core.deleteMany("plugin_storage", { |
| 1648 | where: (b) => |
| 1649 | b.and( |
| 1650 | b("plugin_id", "=", input.pluginId), |
| 1651 | b("collection", "=", collection), |
| 1652 | b("key", "in", batchKeys), |
| 1653 | b("owner", "=", owner), |
| 1654 | b("subject", "=", subject), |
| 1655 | ), |
| 1656 | }); |
| 1657 | } |
| 1658 | } |
| 1659 | }); |
| 1660 | |
| 1661 | const putManyImpl = ( |
| 1662 | owner: Owner, |
no test coverage detected