joist-core 2.5.0-next.2 → 2.5.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/BaseEntity.cjs +33 -3
- package/build/BaseEntity.cjs.map +1 -1
- package/build/BaseEntity.d.cts +6 -4
- package/build/BaseEntity.d.cts.map +1 -1
- package/build/BaseEntity.d.mts +6 -4
- package/build/BaseEntity.d.mts.map +1 -1
- package/build/BaseEntity.js +33 -4
- package/build/BaseEntity.js.map +1 -1
- package/build/Entity.cjs +2 -3
- package/build/Entity.d.cts +0 -2
- package/build/Entity.d.cts.map +1 -1
- package/build/Entity.d.mts +0 -2
- package/build/Entity.d.mts.map +1 -1
- package/build/Entity.js +2 -3
- package/build/EntityFields.d.cts +0 -2
- package/build/EntityFields.d.cts.map +1 -1
- package/build/EntityFields.d.mts +0 -2
- package/build/EntityFields.d.mts.map +1 -1
- package/build/EntityManager.cjs +185 -103
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +50 -37
- package/build/EntityManager.d.cts.map +1 -1
- package/build/EntityManager.d.mts +50 -37
- package/build/EntityManager.d.mts.map +1 -1
- package/build/EntityManager.js +185 -104
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +3 -4
- package/build/EntityMetadata.cjs.map +1 -1
- package/build/EntityMetadata.d.cts +8 -6
- package/build/EntityMetadata.d.cts.map +1 -1
- package/build/EntityMetadata.d.mts +8 -6
- package/build/EntityMetadata.d.mts.map +1 -1
- package/build/EntityMetadata.js +3 -4
- package/build/EntityMetadata.js.map +1 -1
- package/build/EnumMetadata.d.cts +0 -2
- package/build/EnumMetadata.d.cts.map +1 -1
- package/build/EnumMetadata.d.mts +0 -2
- package/build/EnumMetadata.d.mts.map +1 -1
- package/build/IndexManager.cjs +4 -5
- package/build/IndexManager.d.cts +1 -3
- package/build/IndexManager.d.cts.map +1 -1
- package/build/IndexManager.d.mts +1 -3
- package/build/IndexManager.d.mts.map +1 -1
- package/build/IndexManager.js +4 -5
- package/build/InstanceData.cjs +12 -6
- package/build/InstanceData.cjs.map +1 -1
- package/build/InstanceData.d.cts +9 -5
- package/build/InstanceData.d.cts.map +1 -1
- package/build/InstanceData.d.mts +9 -5
- package/build/InstanceData.d.mts.map +1 -1
- package/build/InstanceData.js +12 -6
- package/build/InstanceData.js.map +1 -1
- package/build/PluginManager.cjs +21 -8
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +19 -7
- package/build/PluginManager.d.cts.map +1 -1
- package/build/PluginManager.d.mts +19 -7
- package/build/PluginManager.d.mts.map +1 -1
- package/build/PluginManager.js +21 -8
- package/build/PluginManager.js.map +1 -1
- package/build/RowData.cjs +1 -2
- package/build/RowData.d.cts +0 -2
- package/build/RowData.d.cts.map +1 -1
- package/build/RowData.d.mts +0 -2
- package/build/RowData.d.mts.map +1 -1
- package/build/RowData.js +1 -2
- package/build/_virtual/_rolldown/runtime.cjs +1 -2
- package/build/batchloaders/BatchLoader.cjs +1 -2
- package/build/batchloaders/BatchLoader.d.cts +0 -2
- package/build/batchloaders/BatchLoader.d.cts.map +1 -1
- package/build/batchloaders/BatchLoader.d.mts +0 -2
- package/build/batchloaders/BatchLoader.d.mts.map +1 -1
- package/build/batchloaders/BatchLoader.js +1 -2
- package/build/batchloaders/enumCollectionBatchLoader.cjs +4 -5
- package/build/batchloaders/enumCollectionBatchLoader.cjs.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.cts +1 -3
- package/build/batchloaders/enumCollectionBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.mts +1 -3
- package/build/batchloaders/enumCollectionBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.js +4 -5
- package/build/batchloaders/enumCollectionBatchLoader.js.map +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +9 -9
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.cts +3 -5
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.mts +3 -5
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/loadBatchLoader.js +9 -9
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +5 -6
- package/build/batchloaders/manyToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.cts +1 -3
- package/build/batchloaders/manyToManyBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.d.mts +1 -3
- package/build/batchloaders/manyToManyBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.js +5 -6
- package/build/batchloaders/manyToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +5 -6
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.d.cts +2 -4
- package/build/batchloaders/oneToManyBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.d.mts +2 -4
- package/build/batchloaders/oneToManyBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.js +6 -7
- package/build/batchloaders/oneToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.cjs +7 -8
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.d.cts +2 -4
- package/build/batchloaders/oneToOneBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.d.mts +2 -4
- package/build/batchloaders/oneToOneBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.js +7 -8
- package/build/batchloaders/oneToOneBatchLoader.js.map +1 -1
- package/build/batchloaders/populateBatchLoader.cjs +14 -18
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.cts +2 -4
- package/build/batchloaders/populateBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/populateBatchLoader.d.mts +2 -4
- package/build/batchloaders/populateBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/populateBatchLoader.js +14 -18
- package/build/batchloaders/populateBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +11 -11
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts +2 -4
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts +2 -4
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.js +11 -11
- package/build/batchloaders/recursiveChildrenBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +7 -8
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts +2 -4
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts +2 -4
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.js +7 -8
- package/build/batchloaders/recursiveM2mBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +7 -8
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts +2 -4
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts +2 -4
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.js +7 -8
- package/build/batchloaders/recursiveParentsBatchLoader.js.map +1 -1
- package/build/changes.cjs +7 -8
- package/build/changes.d.cts +3 -5
- package/build/changes.d.cts.map +1 -1
- package/build/changes.d.mts +3 -5
- package/build/changes.d.mts.map +1 -1
- package/build/changes.js +7 -8
- package/build/config.cjs +9 -10
- package/build/config.d.cts +6 -8
- package/build/config.d.cts.map +1 -1
- package/build/config.d.mts +6 -8
- package/build/config.d.mts.map +1 -1
- package/build/config.js +9 -10
- package/build/configure.cjs +11 -12
- package/build/configure.d.cts +3 -5
- package/build/configure.d.cts.map +1 -1
- package/build/configure.d.mts +3 -5
- package/build/configure.d.mts.map +1 -1
- package/build/configure.js +11 -12
- package/build/dataloaders/buildCandidateBatchQuery.cjs +499 -0
- package/build/dataloaders/buildCandidateBatchQuery.cjs.map +1 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.cts +57 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.cts.map +1 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.mts +57 -0
- package/build/dataloaders/buildCandidateBatchQuery.d.mts.map +1 -0
- package/build/dataloaders/buildCandidateBatchQuery.js +498 -0
- package/build/dataloaders/buildCandidateBatchQuery.js.map +1 -0
- package/build/dataloaders/collectFindArguments.cjs +48 -0
- package/build/dataloaders/collectFindArguments.cjs.map +1 -0
- package/build/dataloaders/collectFindArguments.d.cts +31 -0
- package/build/dataloaders/collectFindArguments.d.cts.map +1 -0
- package/build/dataloaders/collectFindArguments.d.mts +31 -0
- package/build/dataloaders/collectFindArguments.d.mts.map +1 -0
- package/build/dataloaders/collectFindArguments.js +47 -0
- package/build/dataloaders/collectFindArguments.js.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.cjs +3 -4
- package/build/dataloaders/fastWhereFilterHash.d.cts +0 -2
- package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.d.mts +0 -2
- package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.js +3 -4
- package/build/dataloaders/findByUniqueDataLoader.cjs +2 -3
- package/build/dataloaders/findByUniqueDataLoader.d.cts +2 -4
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.mts +2 -4
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.js +2 -3
- package/build/dataloaders/findCountDataLoader.cjs +8 -9
- package/build/dataloaders/findCountDataLoader.d.cts +3 -5
- package/build/dataloaders/findCountDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.mts +3 -5
- package/build/dataloaders/findCountDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findCountDataLoader.js +8 -9
- package/build/dataloaders/findDataLoader.cjs +48 -77
- package/build/dataloaders/findDataLoader.cjs.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts +5 -7
- package/build/dataloaders/findDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findDataLoader.d.mts +5 -7
- package/build/dataloaders/findDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findDataLoader.js +48 -77
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +6 -7
- package/build/dataloaders/findIdsDataLoader.d.cts +2 -4
- package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.mts +2 -4
- package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findIdsDataLoader.js +6 -7
- package/build/dataloaders/findOrCreateDataLoader.cjs +7 -8
- package/build/dataloaders/findOrCreateDataLoader.d.cts +2 -4
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.d.mts +2 -4
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js +7 -8
- package/build/dataloaders/findPaginatedDataLoader.cjs +6 -7
- package/build/dataloaders/findPaginatedDataLoader.d.cts +3 -5
- package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts +3 -5
- package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +6 -7
- package/build/dataloaders/lensDataLoader.cjs +5 -6
- package/build/dataloaders/lensDataLoader.d.cts +1 -3
- package/build/dataloaders/lensDataLoader.d.cts.map +1 -1
- package/build/dataloaders/lensDataLoader.d.mts +1 -3
- package/build/dataloaders/lensDataLoader.d.mts.map +1 -1
- package/build/dataloaders/lensDataLoader.js +5 -6
- package/build/dataloaders/manyToManyFindDataLoader.cjs +1 -2
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +2 -4
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +2 -4
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.js +1 -2
- package/build/dataloaders/oneToManyFindDataLoader.cjs +7 -5
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +2 -4
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +2 -4
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.js +8 -6
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +7 -8
- package/build/defaults.d.cts +2 -4
- package/build/defaults.d.cts.map +1 -1
- package/build/defaults.d.mts +2 -4
- package/build/defaults.d.mts.map +1 -1
- package/build/defaults.js +7 -8
- package/build/drivers/Driver.cjs +1 -1
- package/build/drivers/Driver.d.cts +2 -4
- package/build/drivers/Driver.d.cts.map +1 -1
- package/build/drivers/Driver.d.mts +2 -4
- package/build/drivers/Driver.d.mts.map +1 -1
- package/build/drivers/Driver.js +1 -1
- package/build/drivers/EntityWriter.cjs +6 -7
- package/build/drivers/EntityWriter.d.cts +1 -3
- package/build/drivers/EntityWriter.d.cts.map +1 -1
- package/build/drivers/EntityWriter.d.mts +1 -3
- package/build/drivers/EntityWriter.d.mts.map +1 -1
- package/build/drivers/EntityWriter.js +6 -7
- package/build/drivers/IdAssigner.cjs +7 -4
- package/build/drivers/IdAssigner.cjs.map +1 -1
- package/build/drivers/IdAssigner.d.cts +1 -2
- package/build/drivers/IdAssigner.d.cts.map +1 -1
- package/build/drivers/IdAssigner.d.mts +1 -2
- package/build/drivers/IdAssigner.d.mts.map +1 -1
- package/build/drivers/IdAssigner.js +7 -4
- package/build/drivers/IdAssigner.js.map +1 -1
- package/build/drivers/driverApi.cjs +4 -5
- package/build/drivers/driverApi.d.cts +2 -4
- package/build/drivers/driverApi.d.cts.map +1 -1
- package/build/drivers/driverApi.d.mts +2 -4
- package/build/drivers/driverApi.d.mts.map +1 -1
- package/build/drivers/driverApi.js +4 -5
- package/build/drivers/index.d.cts +1 -1
- package/build/drivers/index.d.mts +1 -1
- package/build/fields.cjs +87 -17
- package/build/fields.cjs.map +1 -1
- package/build/fields.d.cts +8 -2
- package/build/fields.d.cts.map +1 -1
- package/build/fields.d.mts +8 -2
- package/build/fields.d.mts.map +1 -1
- package/build/fields.js +87 -19
- package/build/fields.js.map +1 -1
- package/build/flush/FlushLock.cjs +1 -2
- package/build/flush/FlushLock.cjs.map +1 -1
- package/build/flush/FlushLock.d.cts +0 -2
- package/build/flush/FlushLock.d.cts.map +1 -1
- package/build/flush/FlushLock.d.mts +0 -2
- package/build/flush/FlushLock.d.mts.map +1 -1
- package/build/flush/FlushLock.js +1 -2
- package/build/flush/JoinRows.cjs +10 -10
- package/build/flush/JoinRows.cjs.map +1 -1
- package/build/flush/JoinRows.d.cts +2 -4
- package/build/flush/JoinRows.d.cts.map +1 -1
- package/build/flush/JoinRows.d.mts +2 -4
- package/build/flush/JoinRows.d.mts.map +1 -1
- package/build/flush/JoinRows.js +10 -10
- package/build/flush/JoinRows.js.map +1 -1
- package/build/flush/PendingChanges.d.cts +0 -2
- package/build/flush/PendingChanges.d.cts.map +1 -1
- package/build/flush/PendingChanges.d.mts +0 -2
- package/build/flush/PendingChanges.d.mts.map +1 -1
- package/build/flush/ReadDrift.cjs +7 -8
- package/build/flush/ReadDrift.cjs.map +1 -1
- package/build/flush/ReadDrift.d.cts +2 -4
- package/build/flush/ReadDrift.d.cts.map +1 -1
- package/build/flush/ReadDrift.d.mts +2 -4
- package/build/flush/ReadDrift.d.mts.map +1 -1
- package/build/flush/ReadDrift.js +7 -8
- package/build/flush/ReadDrift.js.map +1 -1
- package/build/flush/Todo.cjs +3 -4
- package/build/flush/Todo.d.cts +2 -4
- package/build/flush/Todo.d.cts.map +1 -1
- package/build/flush/Todo.d.mts +2 -4
- package/build/flush/Todo.d.mts.map +1 -1
- package/build/flush/Todo.js +3 -4
- package/build/getProperties.cjs +3 -4
- package/build/getProperties.d.cts +0 -2
- package/build/getProperties.d.cts.map +1 -1
- package/build/getProperties.d.mts +0 -2
- package/build/getProperties.d.mts.map +1 -1
- package/build/getProperties.js +3 -4
- package/build/index.cjs +59 -57
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +51 -53
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +51 -53
- package/build/index.d.mts.map +1 -1
- package/build/index.js +59 -58
- package/build/index.js.map +1 -1
- package/build/json.cjs +12 -13
- package/build/json.cjs.map +1 -1
- package/build/json.d.cts +5 -7
- package/build/json.d.cts.map +1 -1
- package/build/json.d.mts +5 -7
- package/build/json.d.mts.map +1 -1
- package/build/json.js +12 -13
- package/build/json.js.map +1 -1
- package/build/k.cjs +1 -2
- package/build/k.js +1 -2
- package/build/keys.cjs +5 -6
- package/build/keys.d.cts +3 -5
- package/build/keys.d.cts.map +1 -1
- package/build/keys.d.mts +3 -5
- package/build/keys.d.mts.map +1 -1
- package/build/keys.js +5 -6
- package/build/loading/HintTree.cjs +1 -2
- package/build/loading/HintTree.d.cts +2 -4
- package/build/loading/HintTree.d.cts.map +1 -1
- package/build/loading/HintTree.d.mts +2 -4
- package/build/loading/HintTree.d.mts.map +1 -1
- package/build/loading/HintTree.js +1 -2
- package/build/loading/IsLoadedCache.cjs +1 -2
- package/build/loading/IsLoadedCache.d.cts +0 -2
- package/build/loading/IsLoadedCache.d.cts.map +1 -1
- package/build/loading/IsLoadedCache.d.mts +0 -2
- package/build/loading/IsLoadedCache.d.mts.map +1 -1
- package/build/loading/IsLoadedCache.js +1 -2
- package/build/loading/loadHints.cjs +1 -2
- package/build/loading/loadHints.d.cts +4 -6
- package/build/loading/loadHints.d.cts.map +1 -1
- package/build/loading/loadHints.d.mts +4 -6
- package/build/loading/loadHints.d.mts.map +1 -1
- package/build/loading/loadHints.js +1 -2
- package/build/loading/loadLens.cjs +11 -8
- package/build/loading/loadLens.cjs.map +1 -1
- package/build/loading/loadLens.d.cts +2 -4
- package/build/loading/loadLens.d.cts.map +1 -1
- package/build/loading/loadLens.d.mts +2 -4
- package/build/loading/loadLens.d.mts.map +1 -1
- package/build/loading/loadLens.js +11 -8
- package/build/loading/loadLens.js.map +1 -1
- package/build/loading/withLoaded.cjs +1 -2
- package/build/loading/withLoaded.d.cts +2 -4
- package/build/loading/withLoaded.d.cts.map +1 -1
- package/build/loading/withLoaded.d.mts +2 -4
- package/build/loading/withLoaded.d.mts.map +1 -1
- package/build/loading/withLoaded.js +1 -2
- package/build/logging/FactoryLogger.cjs +2 -3
- package/build/logging/FactoryLogger.d.cts +1 -3
- package/build/logging/FactoryLogger.d.cts.map +1 -1
- package/build/logging/FactoryLogger.d.mts +1 -3
- package/build/logging/FactoryLogger.d.mts.map +1 -1
- package/build/logging/FactoryLogger.js +2 -3
- package/build/logging/FieldLogger.cjs +1 -2
- package/build/logging/FieldLogger.d.cts +0 -2
- package/build/logging/FieldLogger.d.cts.map +1 -1
- package/build/logging/FieldLogger.d.mts +0 -2
- package/build/logging/FieldLogger.d.mts.map +1 -1
- package/build/logging/FieldLogger.js +1 -2
- package/build/logging/ReactionLogger.cjs +3 -4
- package/build/logging/ReactionLogger.d.cts +3 -5
- package/build/logging/ReactionLogger.d.cts.map +1 -1
- package/build/logging/ReactionLogger.d.mts +3 -5
- package/build/logging/ReactionLogger.d.mts.map +1 -1
- package/build/logging/ReactionLogger.js +3 -4
- package/build/metrics/EntityMetrics.cjs +1 -2
- package/build/metrics/EntityMetrics.d.cts +0 -2
- package/build/metrics/EntityMetrics.d.cts.map +1 -1
- package/build/metrics/EntityMetrics.d.mts +0 -2
- package/build/metrics/EntityMetrics.d.mts.map +1 -1
- package/build/metrics/EntityMetrics.js +1 -2
- package/build/newEntity.cjs +5 -6
- package/build/newEntity.cjs.map +1 -1
- package/build/newEntity.d.cts +2 -4
- package/build/newEntity.d.cts.map +1 -1
- package/build/newEntity.d.mts +2 -4
- package/build/newEntity.d.mts.map +1 -1
- package/build/newEntity.js +5 -6
- package/build/newEntity.js.map +1 -1
- package/build/newTestInstance.cjs +9 -10
- package/build/newTestInstance.d.cts +3 -5
- package/build/newTestInstance.d.cts.map +1 -1
- package/build/newTestInstance.d.mts +3 -5
- package/build/newTestInstance.d.mts.map +1 -1
- package/build/newTestInstance.js +9 -10
- package/build/normalizeHints.cjs +1 -2
- package/build/normalizeHints.d.cts +1 -3
- package/build/normalizeHints.d.cts.map +1 -1
- package/build/normalizeHints.d.mts +1 -3
- package/build/normalizeHints.d.mts.map +1 -1
- package/build/normalizeHints.js +1 -2
- package/build/nowUTC.cjs +1 -2
- package/build/nowUTC.d.cts +0 -2
- package/build/nowUTC.d.cts.map +1 -1
- package/build/nowUTC.d.mts +0 -2
- package/build/nowUTC.d.mts.map +1 -1
- package/build/nowUTC.js +1 -2
- package/build/plugins/ImmutableEntitiesPlugin.cjs +3 -4
- package/build/plugins/ImmutableEntitiesPlugin.d.cts +1 -3
- package/build/plugins/ImmutableEntitiesPlugin.d.cts.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.mts +1 -3
- package/build/plugins/ImmutableEntitiesPlugin.d.mts.map +1 -1
- package/build/plugins/ImmutableEntitiesPlugin.js +3 -4
- package/build/plugins/PreloadPlugin.cjs +1 -1
- package/build/plugins/PreloadPlugin.d.cts +4 -6
- package/build/plugins/PreloadPlugin.d.cts.map +1 -1
- package/build/plugins/PreloadPlugin.d.mts +4 -6
- package/build/plugins/PreloadPlugin.d.mts.map +1 -1
- package/build/plugins/PreloadPlugin.js +1 -1
- package/build/preloading/JsonAggregatePreloader.cjs +13 -13
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.cts +3 -5
- package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.mts +3 -5
- package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -1
- package/build/preloading/JsonAggregatePreloader.js +13 -13
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/canPreload.cjs +1 -2
- package/build/preloading/canPreload.d.cts +0 -2
- package/build/preloading/canPreload.d.cts.map +1 -1
- package/build/preloading/canPreload.d.mts +0 -2
- package/build/preloading/canPreload.d.mts.map +1 -1
- package/build/preloading/canPreload.js +1 -2
- package/build/preloading/partitionHint.cjs +4 -5
- package/build/preloading/partitionHint.d.cts +1 -3
- package/build/preloading/partitionHint.d.cts.map +1 -1
- package/build/preloading/partitionHint.d.mts +1 -3
- package/build/preloading/partitionHint.d.mts.map +1 -1
- package/build/preloading/partitionHint.js +4 -5
- package/build/queries/ConditionBuilder.cjs +2 -3
- package/build/queries/ConditionBuilder.d.cts +1 -3
- package/build/queries/ConditionBuilder.d.cts.map +1 -1
- package/build/queries/ConditionBuilder.d.mts +1 -3
- package/build/queries/ConditionBuilder.d.mts.map +1 -1
- package/build/queries/ConditionBuilder.js +2 -3
- package/build/queries/conditions.cjs +1 -2
- package/build/queries/conditions.d.cts +0 -2
- package/build/queries/conditions.d.cts.map +1 -1
- package/build/queries/conditions.d.mts +0 -2
- package/build/queries/conditions.d.mts.map +1 -1
- package/build/queries/conditions.js +1 -2
- package/build/queries/entityQueryUtils.cjs +2 -3
- package/build/queries/entityQueryUtils.d.cts +1 -3
- package/build/queries/entityQueryUtils.d.cts.map +1 -1
- package/build/queries/entityQueryUtils.d.mts +1 -3
- package/build/queries/entityQueryUtils.d.mts.map +1 -1
- package/build/queries/entityQueryUtils.js +2 -3
- package/build/queries/find/Aliases.cjs +4 -5
- package/build/queries/find/Aliases.d.cts +5 -7
- package/build/queries/find/Aliases.d.cts.map +1 -1
- package/build/queries/find/Aliases.d.mts +5 -7
- package/build/queries/find/Aliases.d.mts.map +1 -1
- package/build/queries/find/Aliases.js +4 -5
- package/build/queries/find/DeferredAlias.cjs +1 -2
- package/build/queries/find/DeferredAlias.d.cts +2 -4
- package/build/queries/find/DeferredAlias.d.cts.map +1 -1
- package/build/queries/find/DeferredAlias.d.mts +2 -4
- package/build/queries/find/DeferredAlias.d.mts.map +1 -1
- package/build/queries/find/DeferredAlias.js +1 -2
- package/build/queries/find/EntityFilter.cjs +1 -2
- package/build/queries/find/EntityFilter.d.cts +3 -5
- package/build/queries/find/EntityFilter.d.cts.map +1 -1
- package/build/queries/find/EntityFilter.d.mts +3 -5
- package/build/queries/find/EntityFilter.d.mts.map +1 -1
- package/build/queries/find/EntityFilter.js +1 -2
- package/build/queries/find/EntityGraphQLFilter.cjs +1 -2
- package/build/queries/find/EntityGraphQLFilter.d.cts +2 -4
- package/build/queries/find/EntityGraphQLFilter.d.cts.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.d.mts +2 -4
- package/build/queries/find/EntityGraphQLFilter.d.mts.map +1 -1
- package/build/queries/find/EntityGraphQLFilter.js +1 -2
- package/build/queries/find/QueryParser.cjs +9 -10
- package/build/queries/find/QueryParser.cjs.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.cjs +1 -2
- package/build/queries/find/QueryParser.collectionJoins.d.cts +0 -2
- package/build/queries/find/QueryParser.collectionJoins.d.cts.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.mts +0 -2
- package/build/queries/find/QueryParser.collectionJoins.d.mts.map +1 -1
- package/build/queries/find/QueryParser.collectionJoins.js +1 -2
- package/build/queries/find/QueryParser.d.cts +4 -4
- package/build/queries/find/QueryParser.d.cts.map +1 -1
- package/build/queries/find/QueryParser.d.mts +4 -4
- package/build/queries/find/QueryParser.d.mts.map +1 -1
- package/build/queries/find/QueryParser.js +9 -10
- package/build/queries/find/QueryParser.js.map +1 -1
- package/build/queries/find/QueryParser.pruning.cjs +2 -3
- package/build/queries/find/QueryParser.pruning.d.cts +0 -2
- package/build/queries/find/QueryParser.pruning.d.cts.map +1 -1
- package/build/queries/find/QueryParser.pruning.d.mts +0 -2
- package/build/queries/find/QueryParser.pruning.d.mts.map +1 -1
- package/build/queries/find/QueryParser.pruning.js +2 -3
- package/build/queries/find/QueryVisitor.cjs +1 -2
- package/build/queries/find/QueryVisitor.d.cts +0 -2
- package/build/queries/find/QueryVisitor.d.cts.map +1 -1
- package/build/queries/find/QueryVisitor.d.mts +0 -2
- package/build/queries/find/QueryVisitor.d.mts.map +1 -1
- package/build/queries/find/QueryVisitor.js +1 -2
- package/build/queries/find/buildFindQuery.cjs +5 -6
- package/build/queries/find/buildFindQuery.cjs.map +1 -1
- package/build/queries/find/buildFindQuery.d.cts +0 -2
- package/build/queries/find/buildFindQuery.d.cts.map +1 -1
- package/build/queries/find/buildFindQuery.d.mts +0 -2
- package/build/queries/find/buildFindQuery.d.mts.map +1 -1
- package/build/queries/find/buildFindQuery.js +5 -6
- package/build/queries/find/buildFindQuery.js.map +1 -1
- package/build/queries/find/scopes.cjs +1 -2
- package/build/queries/find/scopes.d.cts +5 -7
- package/build/queries/find/scopes.d.cts.map +1 -1
- package/build/queries/find/scopes.d.mts +5 -7
- package/build/queries/find/scopes.d.mts.map +1 -1
- package/build/queries/find/scopes.js +1 -2
- package/build/queries/parsedConditions.cjs +1 -2
- package/build/queries/parsedConditions.d.cts +0 -2
- package/build/queries/parsedConditions.d.cts.map +1 -1
- package/build/queries/parsedConditions.d.mts +0 -2
- package/build/queries/parsedConditions.d.mts.map +1 -1
- package/build/queries/parsedConditions.js +1 -2
- package/build/queries/renderConditions.cjs +3 -4
- package/build/queries/renderConditions.d.cts +0 -2
- package/build/queries/renderConditions.d.cts.map +1 -1
- package/build/queries/renderConditions.d.mts +0 -2
- package/build/queries/renderConditions.d.mts.map +1 -1
- package/build/queries/renderConditions.js +3 -4
- package/build/queries/skipCondition.cjs +1 -2
- package/build/queries/skipCondition.d.cts +0 -2
- package/build/queries/skipCondition.d.cts.map +1 -1
- package/build/queries/skipCondition.d.mts +0 -2
- package/build/queries/skipCondition.d.mts.map +1 -1
- package/build/queries/skipCondition.js +1 -2
- package/build/queries/sql/AliasAssigner.cjs +1 -2
- package/build/queries/sql/AliasAssigner.d.cts +0 -2
- package/build/queries/sql/AliasAssigner.d.cts.map +1 -1
- package/build/queries/sql/AliasAssigner.d.mts +0 -2
- package/build/queries/sql/AliasAssigner.d.mts.map +1 -1
- package/build/queries/sql/AliasAssigner.js +1 -2
- package/build/queries/sql/Expr.cjs +3 -4
- package/build/queries/sql/Expr.d.cts +2 -4
- package/build/queries/sql/Expr.d.cts.map +1 -1
- package/build/queries/sql/Expr.d.mts +2 -4
- package/build/queries/sql/Expr.d.mts.map +1 -1
- package/build/queries/sql/Expr.js +3 -4
- package/build/queries/sql/JoinTree.cjs +3 -4
- package/build/queries/sql/JoinTree.d.cts +5 -7
- package/build/queries/sql/JoinTree.d.cts.map +1 -1
- package/build/queries/sql/JoinTree.d.mts +5 -7
- package/build/queries/sql/JoinTree.d.mts.map +1 -1
- package/build/queries/sql/JoinTree.js +3 -4
- package/build/queries/sql/Tables.cjs +8 -9
- package/build/queries/sql/Tables.d.cts +5 -7
- package/build/queries/sql/Tables.d.cts.map +1 -1
- package/build/queries/sql/Tables.d.mts +5 -7
- package/build/queries/sql/Tables.d.mts.map +1 -1
- package/build/queries/sql/Tables.js +8 -9
- package/build/queries/sql/custom.cjs +1 -2
- package/build/queries/sql/custom.d.cts +2 -4
- package/build/queries/sql/custom.d.cts.map +1 -1
- package/build/queries/sql/custom.d.mts +2 -4
- package/build/queries/sql/custom.d.mts.map +1 -1
- package/build/queries/sql/custom.js +1 -2
- package/build/queries/sql/execute.cjs +6 -7
- package/build/queries/sql/execute.d.cts +6 -8
- package/build/queries/sql/execute.d.cts.map +1 -1
- package/build/queries/sql/execute.d.mts +6 -8
- package/build/queries/sql/execute.d.mts.map +1 -1
- package/build/queries/sql/execute.js +6 -7
- package/build/queries/sql/expressions/arrayAgg.cjs +2 -3
- package/build/queries/sql/expressions/arrayAgg.d.cts +1 -3
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.mts +1 -3
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -1
- package/build/queries/sql/expressions/arrayAgg.js +2 -3
- package/build/queries/sql/expressions/case.cjs +2 -3
- package/build/queries/sql/expressions/case.d.cts +1 -3
- package/build/queries/sql/expressions/case.d.cts.map +1 -1
- package/build/queries/sql/expressions/case.d.mts +1 -3
- package/build/queries/sql/expressions/case.d.mts.map +1 -1
- package/build/queries/sql/expressions/case.js +2 -3
- package/build/queries/sql/expressions/coalesce.cjs +2 -3
- package/build/queries/sql/expressions/coalesce.d.cts +1 -3
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -1
- package/build/queries/sql/expressions/coalesce.d.mts +1 -3
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -1
- package/build/queries/sql/expressions/coalesce.js +2 -3
- package/build/queries/sql/expressions/codecs.cjs +2 -3
- package/build/queries/sql/expressions/codecs.d.cts +0 -2
- package/build/queries/sql/expressions/codecs.d.cts.map +1 -1
- package/build/queries/sql/expressions/codecs.d.mts +0 -2
- package/build/queries/sql/expressions/codecs.d.mts.map +1 -1
- package/build/queries/sql/expressions/codecs.js +2 -3
- package/build/queries/sql/expressions/expression.cjs +4 -5
- package/build/queries/sql/expressions/expression.d.cts +2 -4
- package/build/queries/sql/expressions/expression.d.cts.map +1 -1
- package/build/queries/sql/expressions/expression.d.mts +2 -4
- package/build/queries/sql/expressions/expression.d.mts.map +1 -1
- package/build/queries/sql/expressions/expression.js +4 -5
- package/build/queries/sql/expressions/greatest.cjs +2 -3
- package/build/queries/sql/expressions/greatest.d.cts +1 -3
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -1
- package/build/queries/sql/expressions/greatest.d.mts +1 -3
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -1
- package/build/queries/sql/expressions/greatest.js +2 -3
- package/build/queries/sql/expressions/least.cjs +2 -3
- package/build/queries/sql/expressions/least.d.cts +1 -3
- package/build/queries/sql/expressions/least.d.cts.map +1 -1
- package/build/queries/sql/expressions/least.d.mts +1 -3
- package/build/queries/sql/expressions/least.d.mts.map +1 -1
- package/build/queries/sql/expressions/least.js +2 -3
- package/build/queries/sql/expressions/nullIf.cjs +2 -3
- package/build/queries/sql/expressions/nullIf.d.cts +1 -3
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -1
- package/build/queries/sql/expressions/nullIf.d.mts +1 -3
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -1
- package/build/queries/sql/expressions/nullIf.js +2 -3
- package/build/queries/sql/expressions/parseExpression.cjs +3 -4
- package/build/queries/sql/expressions/parseExpression.d.cts +0 -2
- package/build/queries/sql/expressions/parseExpression.d.cts.map +1 -1
- package/build/queries/sql/expressions/parseExpression.d.mts +0 -2
- package/build/queries/sql/expressions/parseExpression.d.mts.map +1 -1
- package/build/queries/sql/expressions/parseExpression.js +3 -4
- package/build/queries/sql/expressions/types.d.cts +1 -3
- package/build/queries/sql/expressions/types.d.cts.map +1 -1
- package/build/queries/sql/expressions/types.d.mts +1 -3
- package/build/queries/sql/expressions/types.d.mts.map +1 -1
- package/build/queries/sql/keywords.cjs +1 -2
- package/build/queries/sql/keywords.d.cts +0 -2
- package/build/queries/sql/keywords.d.cts.map +1 -1
- package/build/queries/sql/keywords.d.mts +0 -2
- package/build/queries/sql/keywords.d.mts.map +1 -1
- package/build/queries/sql/keywords.js +1 -2
- package/build/queries/sql/query.cjs +9 -10
- package/build/queries/sql/query.d.cts +6 -8
- package/build/queries/sql/query.d.cts.map +1 -1
- package/build/queries/sql/query.d.mts +6 -8
- package/build/queries/sql/query.d.mts.map +1 -1
- package/build/queries/sql/query.js +9 -10
- package/build/queries/unnest.cjs +1 -2
- package/build/queries/unnest.d.cts +1 -3
- package/build/queries/unnest.d.cts.map +1 -1
- package/build/queries/unnest.d.mts +1 -3
- package/build/queries/unnest.d.mts.map +1 -1
- package/build/queries/unnest.js +1 -2
- package/build/queries/valueFilters.cjs +3 -4
- package/build/queries/valueFilters.d.cts +2 -4
- package/build/queries/valueFilters.d.cts.map +1 -1
- package/build/queries/valueFilters.d.mts +2 -4
- package/build/queries/valueFilters.d.mts.map +1 -1
- package/build/queries/valueFilters.js +3 -4
- package/build/reactivity/ReactionsManager.cjs +6 -7
- package/build/reactivity/ReactionsManager.d.cts +2 -4
- package/build/reactivity/ReactionsManager.d.cts.map +1 -1
- package/build/reactivity/ReactionsManager.d.mts +2 -4
- package/build/reactivity/ReactionsManager.d.mts.map +1 -1
- package/build/reactivity/ReactionsManager.js +6 -7
- package/build/reactivity/reactiveHints.cjs +8 -9
- package/build/reactivity/reactiveHints.d.cts +8 -10
- package/build/reactivity/reactiveHints.d.cts.map +1 -1
- package/build/reactivity/reactiveHints.d.mts +8 -10
- package/build/reactivity/reactiveHints.d.mts.map +1 -1
- package/build/reactivity/reactiveHints.js +8 -9
- package/build/relations/AbstractPropertyImpl.cjs +1 -2
- package/build/relations/AbstractPropertyImpl.d.cts +0 -2
- package/build/relations/AbstractPropertyImpl.d.cts.map +1 -1
- package/build/relations/AbstractPropertyImpl.d.mts +0 -2
- package/build/relations/AbstractPropertyImpl.d.mts.map +1 -1
- package/build/relations/AbstractPropertyImpl.js +1 -2
- package/build/relations/AbstractRelationImpl.cjs +1 -2
- package/build/relations/AbstractRelationImpl.d.cts +0 -2
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -1
- package/build/relations/AbstractRelationImpl.d.mts +0 -2
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -1
- package/build/relations/AbstractRelationImpl.js +1 -2
- package/build/relations/AsyncProperty.cjs +3 -4
- package/build/relations/AsyncProperty.d.cts +2 -4
- package/build/relations/AsyncProperty.d.cts.map +1 -1
- package/build/relations/AsyncProperty.d.mts +2 -4
- package/build/relations/AsyncProperty.d.mts.map +1 -1
- package/build/relations/AsyncProperty.js +3 -4
- package/build/relations/AsyncReactiveField.cjs +10 -11
- package/build/relations/AsyncReactiveField.d.cts +4 -6
- package/build/relations/AsyncReactiveField.d.cts.map +1 -1
- package/build/relations/AsyncReactiveField.d.mts +4 -6
- package/build/relations/AsyncReactiveField.d.mts.map +1 -1
- package/build/relations/AsyncReactiveField.js +10 -11
- package/build/relations/Collection.cjs +3 -4
- package/build/relations/Collection.d.cts +2 -4
- package/build/relations/Collection.d.cts.map +1 -1
- package/build/relations/Collection.d.mts +2 -4
- package/build/relations/Collection.d.mts.map +1 -1
- package/build/relations/Collection.js +3 -4
- package/build/relations/CustomCollection.cjs +40 -8
- package/build/relations/CustomCollection.cjs.map +1 -1
- package/build/relations/CustomCollection.d.cts +6 -6
- package/build/relations/CustomCollection.d.cts.map +1 -1
- package/build/relations/CustomCollection.d.mts +6 -6
- package/build/relations/CustomCollection.d.mts.map +1 -1
- package/build/relations/CustomCollection.js +40 -8
- package/build/relations/CustomCollection.js.map +1 -1
- package/build/relations/CustomReference.cjs +36 -8
- package/build/relations/CustomReference.cjs.map +1 -1
- package/build/relations/CustomReference.d.cts +8 -8
- package/build/relations/CustomReference.d.cts.map +1 -1
- package/build/relations/CustomReference.d.mts +8 -8
- package/build/relations/CustomReference.d.mts.map +1 -1
- package/build/relations/CustomReference.js +36 -8
- package/build/relations/CustomReference.js.map +1 -1
- package/build/relations/EnumCollection.cjs +4 -5
- package/build/relations/EnumCollection.d.cts +3 -5
- package/build/relations/EnumCollection.d.cts.map +1 -1
- package/build/relations/EnumCollection.d.mts +3 -5
- package/build/relations/EnumCollection.d.mts.map +1 -1
- package/build/relations/EnumCollection.js +4 -5
- package/build/relations/LargeCollection.cjs +2 -2
- package/build/relations/LargeCollection.d.cts +2 -4
- package/build/relations/LargeCollection.d.cts.map +1 -1
- package/build/relations/LargeCollection.d.mts +2 -4
- package/build/relations/LargeCollection.d.mts.map +1 -1
- package/build/relations/LargeCollection.js +2 -2
- package/build/relations/LazyField.cjs +14 -15
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.d.cts +2 -4
- package/build/relations/LazyField.d.cts.map +1 -1
- package/build/relations/LazyField.d.mts +2 -4
- package/build/relations/LazyField.d.mts.map +1 -1
- package/build/relations/LazyField.js +14 -15
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ManyToManyCollection.cjs +68 -13
- package/build/relations/ManyToManyCollection.cjs.map +1 -1
- package/build/relations/ManyToManyCollection.d.cts +2 -4
- package/build/relations/ManyToManyCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyCollection.d.mts +2 -4
- package/build/relations/ManyToManyCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyCollection.js +68 -13
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +35 -13
- package/build/relations/ManyToManyLargeCollection.cjs.map +1 -1
- package/build/relations/ManyToManyLargeCollection.d.cts +6 -8
- package/build/relations/ManyToManyLargeCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyLargeCollection.d.mts +6 -8
- package/build/relations/ManyToManyLargeCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyLargeCollection.js +35 -13
- package/build/relations/ManyToManyLargeCollection.js.map +1 -1
- package/build/relations/ManyToOneReference.cjs +35 -19
- package/build/relations/ManyToOneReference.cjs.map +1 -1
- package/build/relations/ManyToOneReference.d.cts +6 -8
- package/build/relations/ManyToOneReference.d.cts.map +1 -1
- package/build/relations/ManyToOneReference.d.mts +6 -8
- package/build/relations/ManyToOneReference.d.mts.map +1 -1
- package/build/relations/ManyToOneReference.js +35 -19
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +71 -15
- package/build/relations/OneToManyCollection.cjs.map +1 -1
- package/build/relations/OneToManyCollection.d.cts +3 -5
- package/build/relations/OneToManyCollection.d.cts.map +1 -1
- package/build/relations/OneToManyCollection.d.mts +3 -5
- package/build/relations/OneToManyCollection.d.mts.map +1 -1
- package/build/relations/OneToManyCollection.js +71 -15
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +25 -10
- package/build/relations/OneToManyLargeCollection.cjs.map +1 -1
- package/build/relations/OneToManyLargeCollection.d.cts +4 -6
- package/build/relations/OneToManyLargeCollection.d.cts.map +1 -1
- package/build/relations/OneToManyLargeCollection.d.mts +4 -6
- package/build/relations/OneToManyLargeCollection.d.mts.map +1 -1
- package/build/relations/OneToManyLargeCollection.js +25 -10
- package/build/relations/OneToManyLargeCollection.js.map +1 -1
- package/build/relations/OneToOneReference.cjs +41 -13
- package/build/relations/OneToOneReference.cjs.map +1 -1
- package/build/relations/OneToOneReference.d.cts +6 -8
- package/build/relations/OneToOneReference.d.cts.map +1 -1
- package/build/relations/OneToOneReference.d.mts +6 -8
- package/build/relations/OneToOneReference.d.mts.map +1 -1
- package/build/relations/OneToOneReference.js +41 -13
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +33 -17
- package/build/relations/PolymorphicReference.cjs.map +1 -1
- package/build/relations/PolymorphicReference.d.cts +5 -7
- package/build/relations/PolymorphicReference.d.cts.map +1 -1
- package/build/relations/PolymorphicReference.d.mts +5 -7
- package/build/relations/PolymorphicReference.d.mts.map +1 -1
- package/build/relations/PolymorphicReference.js +33 -17
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/PropertySymbols.cjs +1 -2
- package/build/relations/PropertySymbols.d.cts +0 -2
- package/build/relations/PropertySymbols.d.cts.map +1 -1
- package/build/relations/PropertySymbols.d.mts +0 -2
- package/build/relations/PropertySymbols.d.mts.map +1 -1
- package/build/relations/PropertySymbols.js +1 -2
- package/build/relations/ReactiveField.cjs +9 -10
- package/build/relations/ReactiveField.d.cts +4 -6
- package/build/relations/ReactiveField.d.cts.map +1 -1
- package/build/relations/ReactiveField.d.mts +4 -6
- package/build/relations/ReactiveField.d.mts.map +1 -1
- package/build/relations/ReactiveField.js +9 -10
- package/build/relations/ReactiveGetter.cjs +2 -3
- package/build/relations/ReactiveGetter.d.cts +2 -4
- package/build/relations/ReactiveGetter.d.cts.map +1 -1
- package/build/relations/ReactiveGetter.d.mts +2 -4
- package/build/relations/ReactiveGetter.d.mts.map +1 -1
- package/build/relations/ReactiveGetter.js +2 -3
- package/build/relations/ReactiveManyToMany.cjs +59 -17
- package/build/relations/ReactiveManyToMany.cjs.map +1 -1
- package/build/relations/ReactiveManyToMany.d.cts +7 -6
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
- package/build/relations/ReactiveManyToMany.d.mts +7 -6
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
- package/build/relations/ReactiveManyToMany.js +59 -17
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +41 -10
- package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.cts +4 -6
- package/build/relations/ReactiveManyToManyOtherSide.d.cts.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.mts +4 -6
- package/build/relations/ReactiveManyToManyOtherSide.d.mts.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.js +41 -10
- package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
- package/build/relations/ReactiveReference.cjs +29 -12
- package/build/relations/ReactiveReference.cjs.map +1 -1
- package/build/relations/ReactiveReference.d.cts +7 -9
- package/build/relations/ReactiveReference.d.cts.map +1 -1
- package/build/relations/ReactiveReference.d.mts +7 -9
- package/build/relations/ReactiveReference.d.mts.map +1 -1
- package/build/relations/ReactiveReference.js +29 -12
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/ReadOnlyCollection.cjs +3 -4
- package/build/relations/ReadOnlyCollection.d.cts +1 -3
- package/build/relations/ReadOnlyCollection.d.cts.map +1 -1
- package/build/relations/ReadOnlyCollection.d.mts +1 -3
- package/build/relations/ReadOnlyCollection.d.mts.map +1 -1
- package/build/relations/ReadOnlyCollection.js +3 -4
- package/build/relations/RecursiveCollection.cjs +60 -11
- package/build/relations/RecursiveCollection.cjs.map +1 -1
- package/build/relations/RecursiveCollection.d.cts +3 -5
- package/build/relations/RecursiveCollection.d.cts.map +1 -1
- package/build/relations/RecursiveCollection.d.mts +3 -5
- package/build/relations/RecursiveCollection.d.mts.map +1 -1
- package/build/relations/RecursiveCollection.js +60 -11
- package/build/relations/RecursiveCollection.js.map +1 -1
- package/build/relations/RecursiveCycleError.cjs +1 -2
- package/build/relations/RecursiveCycleError.d.cts +0 -2
- package/build/relations/RecursiveCycleError.d.cts.map +1 -1
- package/build/relations/RecursiveCycleError.d.mts +0 -2
- package/build/relations/RecursiveCycleError.d.mts.map +1 -1
- package/build/relations/RecursiveCycleError.js +1 -2
- package/build/relations/Reference.cjs +4 -5
- package/build/relations/Reference.d.cts +3 -5
- package/build/relations/Reference.d.cts.map +1 -1
- package/build/relations/Reference.d.mts +3 -5
- package/build/relations/Reference.d.mts.map +1 -1
- package/build/relations/Reference.js +4 -5
- package/build/relations/ReferenceSymbols.cjs +1 -2
- package/build/relations/ReferenceSymbols.d.cts +0 -2
- package/build/relations/ReferenceSymbols.d.cts.map +1 -1
- package/build/relations/ReferenceSymbols.d.mts +0 -2
- package/build/relations/ReferenceSymbols.d.mts.map +1 -1
- package/build/relations/ReferenceSymbols.js +1 -2
- package/build/relations/Relation.cjs +3 -4
- package/build/relations/Relation.d.cts +1 -3
- package/build/relations/Relation.d.cts.map +1 -1
- package/build/relations/Relation.d.mts +1 -3
- package/build/relations/Relation.d.mts.map +1 -1
- package/build/relations/Relation.js +3 -4
- package/build/relations/RelationSymbols.cjs +1 -2
- package/build/relations/RelationSymbols.d.cts +0 -2
- package/build/relations/RelationSymbols.d.cts.map +1 -1
- package/build/relations/RelationSymbols.d.mts +0 -2
- package/build/relations/RelationSymbols.d.mts.map +1 -1
- package/build/relations/RelationSymbols.js +1 -2
- package/build/relations/hasAsyncMethod.cjs +6 -7
- package/build/relations/hasAsyncMethod.d.cts +2 -4
- package/build/relations/hasAsyncMethod.d.cts.map +1 -1
- package/build/relations/hasAsyncMethod.d.mts +2 -4
- package/build/relations/hasAsyncMethod.d.mts.map +1 -1
- package/build/relations/hasAsyncMethod.js +6 -7
- package/build/relations/hasManyDerived.cjs +5 -6
- package/build/relations/hasManyDerived.cjs.map +1 -1
- package/build/relations/hasManyDerived.d.cts +2 -4
- package/build/relations/hasManyDerived.d.cts.map +1 -1
- package/build/relations/hasManyDerived.d.mts +2 -4
- package/build/relations/hasManyDerived.d.mts.map +1 -1
- package/build/relations/hasManyDerived.js +5 -6
- package/build/relations/hasManyDerived.js.map +1 -1
- package/build/relations/hasManyThrough.cjs +4 -5
- package/build/relations/hasManyThrough.cjs.map +1 -1
- package/build/relations/hasManyThrough.d.cts +0 -2
- package/build/relations/hasManyThrough.d.cts.map +1 -1
- package/build/relations/hasManyThrough.d.mts +0 -2
- package/build/relations/hasManyThrough.d.mts.map +1 -1
- package/build/relations/hasManyThrough.js +4 -5
- package/build/relations/hasManyThrough.js.map +1 -1
- package/build/relations/hasOneDerived.cjs +5 -6
- package/build/relations/hasOneDerived.cjs.map +1 -1
- package/build/relations/hasOneDerived.d.cts +2 -4
- package/build/relations/hasOneDerived.d.cts.map +1 -1
- package/build/relations/hasOneDerived.d.mts +2 -4
- package/build/relations/hasOneDerived.d.mts.map +1 -1
- package/build/relations/hasOneDerived.js +5 -6
- package/build/relations/hasOneDerived.js.map +1 -1
- package/build/relations/hasOneThrough.cjs +4 -5
- package/build/relations/hasOneThrough.cjs.map +1 -1
- package/build/relations/hasOneThrough.d.cts +0 -2
- package/build/relations/hasOneThrough.d.cts.map +1 -1
- package/build/relations/hasOneThrough.d.mts +0 -2
- package/build/relations/hasOneThrough.d.mts.map +1 -1
- package/build/relations/hasOneThrough.js +4 -5
- package/build/relations/hasOneThrough.js.map +1 -1
- package/build/relations/hasProperty.cjs +5 -6
- package/build/relations/hasProperty.d.cts +2 -4
- package/build/relations/hasProperty.d.cts.map +1 -1
- package/build/relations/hasProperty.d.mts +2 -4
- package/build/relations/hasProperty.d.mts.map +1 -1
- package/build/relations/hasProperty.js +5 -6
- package/build/relations/hasReactiveAsyncMethod.cjs +5 -6
- package/build/relations/hasReactiveAsyncMethod.d.cts +3 -5
- package/build/relations/hasReactiveAsyncMethod.d.cts.map +1 -1
- package/build/relations/hasReactiveAsyncMethod.d.mts +3 -5
- package/build/relations/hasReactiveAsyncMethod.d.mts.map +1 -1
- package/build/relations/hasReactiveAsyncMethod.js +5 -6
- package/build/relations/index.cjs +9 -9
- package/build/relations/index.d.cts +3 -3
- package/build/relations/index.d.mts +3 -3
- package/build/relations/index.js +9 -9
- package/build/relations/isCascadeDelete.cjs +1 -2
- package/build/relations/isCascadeDelete.d.cts +0 -2
- package/build/relations/isCascadeDelete.d.cts.map +1 -1
- package/build/relations/isCascadeDelete.d.mts +0 -2
- package/build/relations/isCascadeDelete.d.mts.map +1 -1
- package/build/relations/isCascadeDelete.js +1 -2
- package/build/relations/relationVisibility.cjs +51 -0
- package/build/relations/relationVisibility.cjs.map +1 -0
- package/build/relations/relationVisibility.d.cts +10 -0
- package/build/relations/relationVisibility.d.cts.map +1 -0
- package/build/relations/relationVisibility.d.mts +10 -0
- package/build/relations/relationVisibility.d.mts.map +1 -0
- package/build/relations/relationVisibility.js +47 -0
- package/build/relations/relationVisibility.js.map +1 -0
- package/build/resurrection.cjs +4 -5
- package/build/resurrection.d.cts +2 -4
- package/build/resurrection.d.cts.map +1 -1
- package/build/resurrection.d.mts +2 -4
- package/build/resurrection.d.mts.map +1 -1
- package/build/resurrection.js +4 -5
- package/build/rules.cjs +6 -7
- package/build/rules.d.cts +3 -5
- package/build/rules.d.cts.map +1 -1
- package/build/rules.d.mts +3 -5
- package/build/rules.d.mts.map +1 -1
- package/build/rules.js +6 -7
- package/build/runtimeConfig.cjs +1 -2
- package/build/runtimeConfig.d.cts +0 -2
- package/build/runtimeConfig.d.cts.map +1 -1
- package/build/runtimeConfig.d.mts +0 -2
- package/build/runtimeConfig.d.mts.map +1 -1
- package/build/runtimeConfig.js +1 -2
- package/build/serde/TypeInfo.cjs +1 -2
- package/build/serde/TypeInfo.d.cts +0 -2
- package/build/serde/TypeInfo.d.cts.map +1 -1
- package/build/serde/TypeInfo.d.mts +0 -2
- package/build/serde/TypeInfo.d.mts.map +1 -1
- package/build/serde/TypeInfo.js +1 -2
- package/build/serde/columns.cjs +1 -2
- package/build/serde/columns.d.cts +2 -4
- package/build/serde/columns.d.cts.map +1 -1
- package/build/serde/columns.d.mts +2 -4
- package/build/serde/columns.d.mts.map +1 -1
- package/build/serde/columns.js +1 -2
- package/build/serde/fieldSerde.cjs +4 -5
- package/build/serde/fieldSerde.d.cts +4 -6
- package/build/serde/fieldSerde.d.cts.map +1 -1
- package/build/serde/fieldSerde.d.mts +4 -6
- package/build/serde/fieldSerde.d.mts.map +1 -1
- package/build/serde/fieldSerde.js +4 -5
- package/build/serde/serde.cjs +4 -5
- package/build/serde/serde.cjs.map +1 -1
- package/build/serde/serde.d.cts +0 -2
- package/build/serde/serde.d.cts.map +1 -1
- package/build/serde/serde.d.mts +0 -2
- package/build/serde/serde.d.mts.map +1 -1
- package/build/serde/serde.js +4 -5
- package/build/serde/temporal.cjs +1 -2
- package/build/serde/temporal.cjs.map +1 -1
- package/build/serde/temporal.d.cts +0 -2
- package/build/serde/temporal.d.cts.map +1 -1
- package/build/serde/temporal.d.mts +0 -2
- package/build/serde/temporal.d.mts.map +1 -1
- package/build/serde/temporal.js +1 -2
- package/build/serde/temporalMappers.cjs +1 -2
- package/build/serde/temporalMappers.d.cts +1 -3
- package/build/serde/temporalMappers.d.cts.map +1 -1
- package/build/serde/temporalMappers.d.mts +1 -3
- package/build/serde/temporalMappers.d.mts.map +1 -1
- package/build/serde/temporalMappers.js +1 -2
- package/build/transitions.cjs +2 -3
- package/build/transitions.d.cts +3 -5
- package/build/transitions.d.cts.map +1 -1
- package/build/transitions.d.mts +3 -5
- package/build/transitions.d.mts.map +1 -1
- package/build/transitions.js +2 -3
- package/build/trusted.cjs +1 -2
- package/build/trusted.cjs.map +1 -1
- package/build/trusted.d.cts +0 -2
- package/build/trusted.d.cts.map +1 -1
- package/build/trusted.d.mts +0 -2
- package/build/trusted.d.mts.map +1 -1
- package/build/trusted.js +1 -2
- package/build/typeMap.cjs +1 -1
- package/build/typeMap.d.cts +1 -3
- package/build/typeMap.d.cts.map +1 -1
- package/build/typeMap.d.mts +1 -3
- package/build/typeMap.d.mts.map +1 -1
- package/build/typeMap.js +1 -1
- package/build/upsert.cjs +7 -8
- package/build/upsert.d.cts +3 -5
- package/build/upsert.d.cts.map +1 -1
- package/build/upsert.d.mts +3 -5
- package/build/upsert.d.mts.map +1 -1
- package/build/upsert.js +7 -8
- package/build/utils.cjs +3 -4
- package/build/utils.d.cts +2 -4
- package/build/utils.d.cts.map +1 -1
- package/build/utils.d.mts +2 -4
- package/build/utils.d.mts.map +1 -1
- package/build/utils.js +3 -4
- package/package.json +6 -6
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ParsedFindQuery } from "../queries/find/QueryParser.mjs";
|
|
2
|
+
/** One individual em.find call included in this batch of finds with the same query structure. */
|
|
3
|
+
interface FindEntry {
|
|
4
|
+
query: ParsedFindQuery;
|
|
5
|
+
bindings: unknown[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Shares the candidate phase and child lookups across finds by compiling their filter tree.
|
|
9
|
+
*
|
|
10
|
+
* Before: each (author, find entry) pair repeats a collection lookup, then GROUP BY combines tags.
|
|
11
|
+
* Here `_find(tag, arg0)` contains `(0, ['one'])`, `(1, ['two'])`. Simplified SQL:
|
|
12
|
+
*
|
|
13
|
+
* ```sql
|
|
14
|
+
* SELECT a.*, array_agg(f.tag) AS _tags
|
|
15
|
+
* FROM authors a CROSS JOIN _find f
|
|
16
|
+
* WHERE EXISTS (SELECT 1 FROM books b
|
|
17
|
+
* WHERE b.author_id = a.id AND b.title = ANY(f.arg0))
|
|
18
|
+
* GROUP BY a.id;
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* After: collect child values once per candidate and compare them in SQL for each entry:
|
|
22
|
+
*
|
|
23
|
+
* ```sql
|
|
24
|
+
* WITH _find(tag, arg0) AS MATERIALIZED (
|
|
25
|
+
* SELECT unnest($1::int[]), unnest_arrays($2::varchar[][])
|
|
26
|
+
* ), _cand AS MATERIALIZED (
|
|
27
|
+
* SELECT a AS _entity,
|
|
28
|
+
* ARRAY(SELECT b.title FROM books b
|
|
29
|
+
* WHERE b.author_id = a.id AND b.title = ANY(ARRAY['one', 'two'])) AS _c0
|
|
30
|
+
* FROM authors a
|
|
31
|
+
* WHERE EXISTS (SELECT 1 FROM books b
|
|
32
|
+
* WHERE b.author_id = a.id AND b.title = ANY(ARRAY['one', 'two']))
|
|
33
|
+
* ), _matched AS MATERIALIZED (
|
|
34
|
+
* SELECT c._entity,
|
|
35
|
+
* ARRAY(SELECT f.tag FROM _find f WHERE c._c0 && f.arg0) AS _tags
|
|
36
|
+
* FROM _cand c
|
|
37
|
+
* )
|
|
38
|
+
* SELECT (m._entity).*, m._tags FROM _matched m WHERE cardinality(m._tags) > 0;
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* Here $1 = [0, 1] and $2 = [['one'], ['two']]. The existing buildUnnestCte helper
|
|
42
|
+
* binds arrays, so the _find SQL text stays the same as the number of entries changes.
|
|
43
|
+
*
|
|
44
|
+
* General child predicates use arrays of SQL records instead of independent arrays. I.e. books
|
|
45
|
+
* `(title=one, order=2)` and `(title=two, order=1)` must not match `(title=one AND order=1)`.
|
|
46
|
+
* Each record holds both values from the same child; nested EXISTS recursively collect child-record arrays.
|
|
47
|
+
* Simple positive membership still uses scalar-array overlap, preserving the production fast path.
|
|
48
|
+
*
|
|
49
|
+
* @param query The first entry's prepared query. All entries have the same query structure.
|
|
50
|
+
* @param entries One entry per distinct find, with column-filter values collected in `visitConditions` order.
|
|
51
|
+
* An IN list occupies one slot and BETWEEN occupies two. Raw SQL bindings stay in the query, not this list.
|
|
52
|
+
* @param constantBindings For each binding slot, whether every entry has the same value. I.e. bindings
|
|
53
|
+
* `[30, ["one"]]` and `[30, ["two"]]` give `[true, false]`: age is shared, but the title list varies.
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildCandidateBatchQuery(query: ParsedFindQuery, entries: readonly FindEntry[], constantBindings: readonly boolean[]): ParsedFindQuery | undefined;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=buildCandidateBatchQuery.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCandidateBatchQuery.d.mts","names":[],"sources":["../../src/dataloaders/buildCandidateBatchQuery.ts"],"mappings":";;UAeU;EACR,OAAO;EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+Hc,yBACd,OAAO,iBACP,kBAAkB,aAClB,uCACC"}
|
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { collectFindArguments } from "./collectFindArguments.js";
|
|
2
|
+
import { buildRawQuery } from "../queries/find/buildFindQuery.js";
|
|
3
|
+
import { buildValueCondition, buildWhereClause } from "../queries/renderConditions.js";
|
|
4
|
+
import { kq, kqDot } from "../queries/sql/keywords.js";
|
|
5
|
+
import { buildUnnestCte } from "../queries/unnest.js";
|
|
6
|
+
// src/dataloaders/buildCandidateBatchQuery.ts
|
|
7
|
+
/**
|
|
8
|
+
* Shares the candidate phase and child lookups across finds by compiling their filter tree.
|
|
9
|
+
*
|
|
10
|
+
* Before: each (author, find entry) pair repeats a collection lookup, then GROUP BY combines tags.
|
|
11
|
+
* Here `_find(tag, arg0)` contains `(0, ['one'])`, `(1, ['two'])`. Simplified SQL:
|
|
12
|
+
*
|
|
13
|
+
* ```sql
|
|
14
|
+
* SELECT a.*, array_agg(f.tag) AS _tags
|
|
15
|
+
* FROM authors a CROSS JOIN _find f
|
|
16
|
+
* WHERE EXISTS (SELECT 1 FROM books b
|
|
17
|
+
* WHERE b.author_id = a.id AND b.title = ANY(f.arg0))
|
|
18
|
+
* GROUP BY a.id;
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* After: collect child values once per candidate and compare them in SQL for each entry:
|
|
22
|
+
*
|
|
23
|
+
* ```sql
|
|
24
|
+
* WITH _find(tag, arg0) AS MATERIALIZED (
|
|
25
|
+
* SELECT unnest($1::int[]), unnest_arrays($2::varchar[][])
|
|
26
|
+
* ), _cand AS MATERIALIZED (
|
|
27
|
+
* SELECT a AS _entity,
|
|
28
|
+
* ARRAY(SELECT b.title FROM books b
|
|
29
|
+
* WHERE b.author_id = a.id AND b.title = ANY(ARRAY['one', 'two'])) AS _c0
|
|
30
|
+
* FROM authors a
|
|
31
|
+
* WHERE EXISTS (SELECT 1 FROM books b
|
|
32
|
+
* WHERE b.author_id = a.id AND b.title = ANY(ARRAY['one', 'two']))
|
|
33
|
+
* ), _matched AS MATERIALIZED (
|
|
34
|
+
* SELECT c._entity,
|
|
35
|
+
* ARRAY(SELECT f.tag FROM _find f WHERE c._c0 && f.arg0) AS _tags
|
|
36
|
+
* FROM _cand c
|
|
37
|
+
* )
|
|
38
|
+
* SELECT (m._entity).*, m._tags FROM _matched m WHERE cardinality(m._tags) > 0;
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* Here $1 = [0, 1] and $2 = [['one'], ['two']]. The existing buildUnnestCte helper
|
|
42
|
+
* binds arrays, so the _find SQL text stays the same as the number of entries changes.
|
|
43
|
+
*
|
|
44
|
+
* General child predicates use arrays of SQL records instead of independent arrays. I.e. books
|
|
45
|
+
* `(title=one, order=2)` and `(title=two, order=1)` must not match `(title=one AND order=1)`.
|
|
46
|
+
* Each record holds both values from the same child; nested EXISTS recursively collect child-record arrays.
|
|
47
|
+
* Simple positive membership still uses scalar-array overlap, preserving the production fast path.
|
|
48
|
+
*
|
|
49
|
+
* @param query The first entry's prepared query. All entries have the same query structure.
|
|
50
|
+
* @param entries One entry per distinct find, with column-filter values collected in `visitConditions` order.
|
|
51
|
+
* An IN list occupies one slot and BETWEEN occupies two. Raw SQL bindings stay in the query, not this list.
|
|
52
|
+
* @param constantBindings For each binding slot, whether every entry has the same value. I.e. bindings
|
|
53
|
+
* `[30, ["one"]]` and `[30, ["two"]]` give `[true, false]`: age is shared, but the title list varies.
|
|
54
|
+
*/
|
|
55
|
+
function buildCandidateBatchQuery(query, entries, constantBindings) {
|
|
56
|
+
if (!query.condition || !hasCollectionCondition(query.condition) || query.ctes?.length || query.groupBys?.length) return;
|
|
57
|
+
const primary = query.tables.find((t) => t.join === "primary");
|
|
58
|
+
if (!canSelectCandidateEntities(query, primary.alias)) return;
|
|
59
|
+
const findArguments = buildFindArguments(query, entries, constantBindings);
|
|
60
|
+
if (!findArguments) return;
|
|
61
|
+
const perCallFilters = findArguments.filters;
|
|
62
|
+
const exactMatchCondition = conditionsForExactMatch(query.condition, perCallFilters);
|
|
63
|
+
if (!canProjectCondition(exactMatchCondition)) return;
|
|
64
|
+
const context = {
|
|
65
|
+
perCallFilters,
|
|
66
|
+
nextAlias: 0
|
|
67
|
+
};
|
|
68
|
+
const batchLevel = buildBatchLevel(query, exactMatchCondition, primary.alias, context);
|
|
69
|
+
const selects = [`${kq(primary.alias)} AS _entity`, ...batchLevel.select.map((v) => ({
|
|
70
|
+
sql: `${v.sql} AS ${v.name}`,
|
|
71
|
+
bindings: v.bindings,
|
|
72
|
+
aliases: [primary.alias]
|
|
73
|
+
}))];
|
|
74
|
+
const orderBys = query.orderBys.map((orderBy, index) => {
|
|
75
|
+
const column = `_o${index}`;
|
|
76
|
+
selects.push(`${kqDot(orderBy.alias, orderBy.column)} AS ${column}`);
|
|
77
|
+
return {
|
|
78
|
+
...orderBy,
|
|
79
|
+
alias: primary.alias,
|
|
80
|
+
column
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const orderSelects = orderBys.map((o) => kqDot(o.alias, o.column));
|
|
84
|
+
const candidateCondition = buildCandidateCondition(query.condition, perCallFilters);
|
|
85
|
+
const candidateCte = {
|
|
86
|
+
alias: "_cand",
|
|
87
|
+
materialized: true,
|
|
88
|
+
query: {
|
|
89
|
+
kind: "ast",
|
|
90
|
+
query: {
|
|
91
|
+
...query,
|
|
92
|
+
tables: withoutDistinct(query.tables),
|
|
93
|
+
selects,
|
|
94
|
+
condition: candidateCondition,
|
|
95
|
+
orderBys: []
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const exactMatchCte = {
|
|
100
|
+
alias: "_matched",
|
|
101
|
+
materialized: true,
|
|
102
|
+
query: {
|
|
103
|
+
kind: "ast",
|
|
104
|
+
query: {
|
|
105
|
+
selects: [
|
|
106
|
+
kqDot(primary.alias, "_entity"),
|
|
107
|
+
...orderSelects,
|
|
108
|
+
`ARRAY(SELECT _find.tag FROM _find WHERE ${batchLevel.exactMatchSql}) AS _tags`
|
|
109
|
+
],
|
|
110
|
+
tables: [{
|
|
111
|
+
join: "primary",
|
|
112
|
+
table: "_cand",
|
|
113
|
+
alias: primary.alias
|
|
114
|
+
}],
|
|
115
|
+
orderBys: []
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
selects: [`(${kqDot(primary.alias, "_entity")}).*`, kqDot(primary.alias, "_tags")],
|
|
121
|
+
tables: [{
|
|
122
|
+
join: "primary",
|
|
123
|
+
table: "_matched",
|
|
124
|
+
alias: primary.alias
|
|
125
|
+
}],
|
|
126
|
+
condition: {
|
|
127
|
+
kind: "exp",
|
|
128
|
+
op: "and",
|
|
129
|
+
conditions: [{
|
|
130
|
+
kind: "raw",
|
|
131
|
+
condition: `cardinality(${kqDot(primary.alias, "_tags")}) > 0`,
|
|
132
|
+
aliases: [primary.alias],
|
|
133
|
+
bindings: [],
|
|
134
|
+
pruneable: false
|
|
135
|
+
}]
|
|
136
|
+
},
|
|
137
|
+
orderBys,
|
|
138
|
+
ctes: [
|
|
139
|
+
findArguments.cte,
|
|
140
|
+
candidateCte,
|
|
141
|
+
exactMatchCte
|
|
142
|
+
]
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Whether the entity comes from one table, without extra CTI fields or preload JSON aggregates.
|
|
147
|
+
*
|
|
148
|
+
* Candidates store that table's row in _entity and later expand it back into entity columns.
|
|
149
|
+
* Fields selected from other CTI tables or added by plugins/preloading would be lost in that expansion.
|
|
150
|
+
*/
|
|
151
|
+
function canSelectCandidateEntities(query, primaryAlias) {
|
|
152
|
+
return query.selects.length === 1 && query.selects[0] === `${kq(primaryAlias)}.*` && query.tables.every(canSelectWithoutMultiplyingParents);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Whether joining this table returns at most one row per entity being found.
|
|
156
|
+
*
|
|
157
|
+
* Joining an author to its publisher cannot duplicate the author, but joining it to three books can.
|
|
158
|
+
* Collection filters normally use EXISTS to avoid this; remaining collection joins can require DISTINCT
|
|
159
|
+
* to return each entity once. Candidate batching omits DISTINCT, so it accepts only joins known not to
|
|
160
|
+
* duplicate the entity.
|
|
161
|
+
*/
|
|
162
|
+
function canSelectWithoutMultiplyingParents(table) {
|
|
163
|
+
if (table.join === "primary") return true;
|
|
164
|
+
if (table.join !== "inner" && table.join !== "outer") return false;
|
|
165
|
+
return table.distinct === false || !table.collection && table.col2 === kqDot(table.alias, "id");
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Encodes per-call filter arguments as columns of _find and records which filter uses each column.
|
|
169
|
+
*
|
|
170
|
+
* The binding positions must follow collectValues' visit order. Unsupported array encodings return
|
|
171
|
+
* undefined so the caller can use regular batching instead of changing the filter's meaning.
|
|
172
|
+
*/
|
|
173
|
+
function buildFindArguments(query, entries, constantBindings) {
|
|
174
|
+
const columns = [{
|
|
175
|
+
columnName: "tag",
|
|
176
|
+
dbType: "int"
|
|
177
|
+
}];
|
|
178
|
+
const values = [entries.map((_, i) => i)];
|
|
179
|
+
const filters = /* @__PURE__ */ new Map();
|
|
180
|
+
let unsupported = false;
|
|
181
|
+
for (const arg of collectFindArguments(query, constantBindings, { arrayEquality: true })) {
|
|
182
|
+
const c = arg.condition;
|
|
183
|
+
const start = arg.bindingIndexes[0];
|
|
184
|
+
if (c.dbType.endsWith("[]")) unsupported = true;
|
|
185
|
+
const columnNames = arg.columns.map((column) => column.columnName);
|
|
186
|
+
for (let slot = 0; slot < arg.bindingIndexes.length; slot++) {
|
|
187
|
+
const i = arg.bindingIndexes[slot];
|
|
188
|
+
const membership = c.cond.kind === "eq" || c.cond.kind === "in" || c.cond.kind === "nin";
|
|
189
|
+
const slotValues = entries.map((entry) => c.cond.kind === "eq" ? [entry.bindings[i]] : entry.bindings[i]);
|
|
190
|
+
if (membership && slotValues.some((v) => Array.isArray(v) && v.some((item) => item == null))) unsupported = true;
|
|
191
|
+
columns.push(arg.columns[slot]);
|
|
192
|
+
values.push(slotValues);
|
|
193
|
+
}
|
|
194
|
+
let allValues;
|
|
195
|
+
let range;
|
|
196
|
+
const kind = c.cond.kind;
|
|
197
|
+
if (kind === "eq") allValues = [...new Set(entries.map((entry) => entry.bindings[start]))];
|
|
198
|
+
else if (kind === "in") allValues = [...new Set(entries.flatMap((entry) => entry.bindings[start]))];
|
|
199
|
+
else if (numericDbTypes.has(c.dbType) && (kind === "gt" || kind === "gte" || kind === "lt" || kind === "lte" || kind === "between")) range = broadenNumericRange(kind, entries, start);
|
|
200
|
+
filters.set(c, {
|
|
201
|
+
columnNames,
|
|
202
|
+
allValues,
|
|
203
|
+
range
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (unsupported || filters.size === 0) return;
|
|
207
|
+
return {
|
|
208
|
+
cte: {
|
|
209
|
+
...buildUnnestCte("_find", columns, values),
|
|
210
|
+
materialized: true
|
|
211
|
+
},
|
|
212
|
+
filters
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const numericDbTypes = /* @__PURE__ */ new Set([
|
|
216
|
+
"smallint",
|
|
217
|
+
"integer",
|
|
218
|
+
"int",
|
|
219
|
+
"int2",
|
|
220
|
+
"int4",
|
|
221
|
+
"int8",
|
|
222
|
+
"bigint",
|
|
223
|
+
"numeric",
|
|
224
|
+
"decimal",
|
|
225
|
+
"real",
|
|
226
|
+
"float4",
|
|
227
|
+
"float8",
|
|
228
|
+
"double precision"
|
|
229
|
+
]);
|
|
230
|
+
/**
|
|
231
|
+
* Combines finite numeric bounds without applying JavaScript ordering to PostgreSQL strings or custom types.
|
|
232
|
+
*
|
|
233
|
+
* I.e. age >= 30 / age >= 40 becomes age >= 30. Numeric strings, timestamps, and other encoded values
|
|
234
|
+
* are checked in the exact-match phase; converting them here could lose precision or change PostgreSQL's ordering.
|
|
235
|
+
*/
|
|
236
|
+
function broadenNumericRange(kind, entries, start) {
|
|
237
|
+
const bounds = entries.map((entry) => entry.bindings[start]);
|
|
238
|
+
const upperBounds = kind === "between" ? entries.map((entry) => entry.bindings[start + 1]) : [];
|
|
239
|
+
if (!bounds.every(isFiniteNumber) || !upperBounds.every(isFiniteNumber)) return;
|
|
240
|
+
if (kind === "between") return {
|
|
241
|
+
kind,
|
|
242
|
+
value: [bounds.reduce((a, b) => Math.min(a, b)), upperBounds.reduce((a, b) => Math.max(a, b))]
|
|
243
|
+
};
|
|
244
|
+
return {
|
|
245
|
+
kind,
|
|
246
|
+
value: kind === "gt" || kind === "gte" ? bounds.reduce((a, b) => Math.min(a, b)) : bounds.reduce((a, b) => Math.max(a, b))
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/** Whether a binding can be ordered numerically without decoding or coercion. */
|
|
250
|
+
function isFiniteNumber(value) {
|
|
251
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Selects a superset of the requested rows without repeating the complete filter for every call.
|
|
255
|
+
*
|
|
256
|
+
* Each column condition accepts the values from any call, while AND/OR and positive EXISTS retain
|
|
257
|
+
* their structure. I.e. `(title=one, order=1)` / `(title=two, order=2)` selects candidates using
|
|
258
|
+
* `title IN [one, two] AND order IN [1, 2]`. The exact-match phase rejects cross-combinations afterward.
|
|
259
|
+
* The number of calls changes bound arrays, not the candidate SQL text.
|
|
260
|
+
*/
|
|
261
|
+
function buildCandidateCondition(condition, perCallFilters) {
|
|
262
|
+
return {
|
|
263
|
+
...condition,
|
|
264
|
+
conditions: condition.conditions.map((c) => broadenCandidateCondition(c, perCallFilters))
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/** Widens one condition without losing any row that could match an individual call. */
|
|
268
|
+
function broadenCandidateCondition(c, perCallFilters) {
|
|
269
|
+
if (c.kind === "exp") return buildCandidateCondition(c, perCallFilters);
|
|
270
|
+
if (c.kind === "column") {
|
|
271
|
+
const arg = perCallFilters.get(c);
|
|
272
|
+
if (!arg) return c;
|
|
273
|
+
if (c.cond.kind === "eq" || c.cond.kind === "in") return {
|
|
274
|
+
...c,
|
|
275
|
+
cond: {
|
|
276
|
+
kind: "in",
|
|
277
|
+
value: arg.allValues
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
if (arg.range) return {
|
|
281
|
+
...c,
|
|
282
|
+
cond: arg.range
|
|
283
|
+
};
|
|
284
|
+
return {
|
|
285
|
+
kind: "raw",
|
|
286
|
+
condition: "TRUE",
|
|
287
|
+
aliases: [],
|
|
288
|
+
bindings: [],
|
|
289
|
+
pruneable: false
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
if (c.kind === "exists" && c.subquery.condition && hasVaryingCondition(c, perCallFilters)) {
|
|
293
|
+
if (c.negate) return {
|
|
294
|
+
kind: "raw",
|
|
295
|
+
condition: "TRUE",
|
|
296
|
+
aliases: [],
|
|
297
|
+
bindings: [],
|
|
298
|
+
pruneable: false
|
|
299
|
+
};
|
|
300
|
+
return {
|
|
301
|
+
...c,
|
|
302
|
+
subquery: {
|
|
303
|
+
...c.subquery,
|
|
304
|
+
condition: buildCandidateCondition(c.subquery.condition, perCallFilters)
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
return c;
|
|
309
|
+
}
|
|
310
|
+
/** Builds the SELECT expressions and exact-match SQL for one level of the batch's nested filters. */
|
|
311
|
+
function buildBatchLevel(query, condition, alias, context, parentLevel) {
|
|
312
|
+
const tables = new Map(parentLevel?.tables);
|
|
313
|
+
for (const table of query.tables) tables.set(table.alias, table.table);
|
|
314
|
+
const level = {
|
|
315
|
+
alias,
|
|
316
|
+
select: [],
|
|
317
|
+
exactMatchSql: "",
|
|
318
|
+
tables,
|
|
319
|
+
nested: parentLevel !== void 0
|
|
320
|
+
};
|
|
321
|
+
level.exactMatchSql = buildExactMatchCondition(condition, level, context);
|
|
322
|
+
return level;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Preserves boolean and EXISTS structure while replacing database lookups with projected row values.
|
|
326
|
+
*
|
|
327
|
+
* An EXISTS projection contains records, not independent column arrays: `_r0._c0` and `_r0._c1`
|
|
328
|
+
* come from the same child. A nested EXISTS becomes a record-array field on that particular child.
|
|
329
|
+
*/
|
|
330
|
+
function buildExactMatchCondition(c, level, context) {
|
|
331
|
+
if (c.kind === "exp") return `(${c.conditions.map((child) => buildExactMatchCondition(child, level, context)).join(` ${c.op.toUpperCase()} `)})`;
|
|
332
|
+
const name = `_c${level.select.length}`;
|
|
333
|
+
const reference = kqDot(level.alias, name);
|
|
334
|
+
const arg = c.kind === "column" ? context.perCallFilters.get(c) : void 0;
|
|
335
|
+
if (c.kind === "column" && arg) {
|
|
336
|
+
if (level.nested) {
|
|
337
|
+
let source = level.select.find((v) => v.sourceAlias === c.alias);
|
|
338
|
+
if (!source) {
|
|
339
|
+
source = {
|
|
340
|
+
name,
|
|
341
|
+
dbType: kq(level.tables.get(c.alias)),
|
|
342
|
+
sql: kq(c.alias),
|
|
343
|
+
bindings: [],
|
|
344
|
+
sourceAlias: c.alias
|
|
345
|
+
};
|
|
346
|
+
level.select.push(source);
|
|
347
|
+
}
|
|
348
|
+
return renderExactMatch(c, `(${kqDot(level.alias, source.name)}).${kq(c.column)}`, arg);
|
|
349
|
+
}
|
|
350
|
+
level.select.push({
|
|
351
|
+
name,
|
|
352
|
+
dbType: c.dbType,
|
|
353
|
+
sql: kqDot(c.alias, c.column),
|
|
354
|
+
bindings: []
|
|
355
|
+
});
|
|
356
|
+
return renderExactMatch(c, reference, arg);
|
|
357
|
+
}
|
|
358
|
+
if (c.kind === "exists" && hasVaryingCondition(c, context.perCallFilters)) {
|
|
359
|
+
const childCondition = conditionsForExactMatch(c.subquery.condition, context.perCallFilters);
|
|
360
|
+
const childWhere = sharedConditionsForCandidate(c.subquery.condition, context.perCallFilters);
|
|
361
|
+
const tables = withoutDistinct(c.subquery.tables);
|
|
362
|
+
const scalar = singleMembership(childCondition, context.perCallFilters);
|
|
363
|
+
if (scalar && !c.negate && !level.nested) {
|
|
364
|
+
const requestedChildWhere = {
|
|
365
|
+
kind: "exp",
|
|
366
|
+
op: "and",
|
|
367
|
+
conditions: [childWhere, broadenCandidateCondition(scalar, context.perCallFilters)]
|
|
368
|
+
};
|
|
369
|
+
const child = buildRawQuery({
|
|
370
|
+
...c.subquery,
|
|
371
|
+
tables,
|
|
372
|
+
selects: [kqDot(scalar.alias, scalar.column)],
|
|
373
|
+
condition: requestedChildWhere,
|
|
374
|
+
orderBys: []
|
|
375
|
+
}, {});
|
|
376
|
+
level.select.push({
|
|
377
|
+
name,
|
|
378
|
+
dbType: `${scalar.dbType}[]`,
|
|
379
|
+
sql: `ARRAY(${child.sql})`,
|
|
380
|
+
bindings: [...child.bindings]
|
|
381
|
+
});
|
|
382
|
+
return `${reference} && _find.${context.perCallFilters.get(scalar).columnNames[0]}`;
|
|
383
|
+
}
|
|
384
|
+
const childLevel = buildBatchLevel(c.subquery, childCondition, `_r${context.nextAlias++}`, context, level);
|
|
385
|
+
const childRows = buildRawQuery({
|
|
386
|
+
...c.subquery,
|
|
387
|
+
tables,
|
|
388
|
+
selects: [{
|
|
389
|
+
sql: `ROW(${childLevel.select.map((v) => v.sql).join(", ")})`,
|
|
390
|
+
bindings: childLevel.select.flatMap((v) => v.bindings),
|
|
391
|
+
aliases: c.outerAliases
|
|
392
|
+
}],
|
|
393
|
+
condition: childWhere,
|
|
394
|
+
orderBys: []
|
|
395
|
+
}, {});
|
|
396
|
+
level.select.push({
|
|
397
|
+
name,
|
|
398
|
+
dbType: "record[]",
|
|
399
|
+
sql: `ARRAY(${childRows.sql})`,
|
|
400
|
+
bindings: [...childRows.bindings]
|
|
401
|
+
});
|
|
402
|
+
const columns = childLevel.select.map((v) => `${v.name} ${v.dbType}`).join(", ");
|
|
403
|
+
return `${c.negate ? "NOT " : ""}EXISTS (SELECT 1 FROM unnest(${reference}) AS ${childLevel.alias}(${columns}) WHERE ${childLevel.exactMatchSql})`;
|
|
404
|
+
}
|
|
405
|
+
const [sql, bindings] = buildWhereClause({
|
|
406
|
+
kind: "exp",
|
|
407
|
+
op: "and",
|
|
408
|
+
conditions: [c]
|
|
409
|
+
}, true, (q) => buildRawQuery(q, {}));
|
|
410
|
+
level.select.push({
|
|
411
|
+
name,
|
|
412
|
+
dbType: "boolean",
|
|
413
|
+
sql: `(${sql})`,
|
|
414
|
+
bindings
|
|
415
|
+
});
|
|
416
|
+
return reference;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Renders an exact-match phase comparison against candidate values and typed _find argument columns.
|
|
420
|
+
*
|
|
421
|
+
* I.e. an age BETWEEN filter with reference = "a._c0" and columnNames = ["arg0", "arg1"]
|
|
422
|
+
* becomes `a._c0 BETWEEN _find.arg0 AND _find.arg1`: the candidate's age is compared with each call's bounds.
|
|
423
|
+
*/
|
|
424
|
+
function renderExactMatch(c, reference, arg) {
|
|
425
|
+
if (c.cond.kind === "eq" || c.cond.kind === "in") return `${reference} = ANY(_find.${arg.columnNames[0]})`;
|
|
426
|
+
const [sql] = buildValueCondition(reference, c.cond);
|
|
427
|
+
let index = 0;
|
|
428
|
+
return sql.replace(/(?<!@)\?/g, () => `_find.${arg.columnNames[index++]}`);
|
|
429
|
+
}
|
|
430
|
+
/** Finds the scalar-array overlap case after shared AND filters have been moved to the candidate phase. */
|
|
431
|
+
function singleMembership(c, perCallFilters) {
|
|
432
|
+
if (c.kind === "exp" && c.conditions.length === 1) return singleMembership(c.conditions[0], perCallFilters);
|
|
433
|
+
return c.kind === "column" && perCallFilters.has(c) && (c.cond.kind === "eq" || c.cond.kind === "in") ? c : void 0;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Keeps conditions that still need checking after the candidate phase has applied shared filters.
|
|
437
|
+
*
|
|
438
|
+
* The phases split conditions only at AND: if all calls require `age > 20 AND title = theirTitle`,
|
|
439
|
+
* the candidate phase guarantees age > 20, so the exact-match phase needs only the title.
|
|
440
|
+
* For `age > 20 OR title = theirTitle`, the candidate phase does not guarantee either branch
|
|
441
|
+
* for a particular call, so the exact-match phase keeps the whole OR.
|
|
442
|
+
* `sharedConditionsForCandidate` supplies the complementary restrictions when collecting child rows.
|
|
443
|
+
*/
|
|
444
|
+
function conditionsForExactMatch(c, perCallFilters) {
|
|
445
|
+
if (c.op !== "and") return c;
|
|
446
|
+
return {
|
|
447
|
+
...c,
|
|
448
|
+
conditions: c.conditions.filter((child) => hasVaryingCondition(child, perCallFilters)).map((child) => child.kind === "exp" ? conditionsForExactMatch(child, perCallFilters) : child)
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Keeps shared AND restrictions for the candidate phase when collecting child rows.
|
|
453
|
+
*
|
|
454
|
+
* I.e. calls requesting `book.order = 1 AND book.title = "one"` / `book.order = 1 AND book.title = "two"`
|
|
455
|
+
* can collect only books with order = 1. The exact-match phase then checks each call's title.
|
|
456
|
+
*
|
|
457
|
+
* For `book.order = 1 OR book.title = "one"` / `book.order = 1 OR book.title = "two"`, collecting only
|
|
458
|
+
* books with order = 1 would lose books accepted by the title branch. This helper therefore keeps no
|
|
459
|
+
* restriction from that OR; the exact-match phase checks the entire OR for each call.
|
|
460
|
+
*/
|
|
461
|
+
function sharedConditionsForCandidate(c, perCallFilters) {
|
|
462
|
+
if (!hasVaryingCondition(c, perCallFilters)) return c;
|
|
463
|
+
return {
|
|
464
|
+
kind: "exp",
|
|
465
|
+
op: "and",
|
|
466
|
+
conditions: c.op === "or" ? [] : c.conditions.flatMap((child) => {
|
|
467
|
+
if (!hasVaryingCondition(child, perCallFilters)) return [child];
|
|
468
|
+
return child.kind === "exp" ? [sharedConditionsForCandidate(child, perCallFilters)] : [];
|
|
469
|
+
})
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
/** Whether this condition uses filter values that differ between batched em.find calls, including inside nested EXISTS. */
|
|
473
|
+
function hasVaryingCondition(c, perCallFilters) {
|
|
474
|
+
if (c.kind === "column") return perCallFilters.has(c);
|
|
475
|
+
if (c.kind === "exp") return c.conditions.some((child) => hasVaryingCondition(child, perCallFilters));
|
|
476
|
+
return c.kind === "exists" && !!c.subquery.condition && hasVaryingCondition(c.subquery.condition, perCallFilters);
|
|
477
|
+
}
|
|
478
|
+
/** Whether the candidate phase includes a collection lookup, including a no-children check. */
|
|
479
|
+
function hasCollectionCondition(c) {
|
|
480
|
+
return c.kind === "exists" || c.kind === "exp" && c.conditions.some(hasCollectionCondition);
|
|
481
|
+
}
|
|
482
|
+
/** Suppresses the renderer's automatic DISTINCT for root to-one joins or EXISTS child-record arrays. */
|
|
483
|
+
function withoutDistinct(tables) {
|
|
484
|
+
return tables.map((t) => t.join === "inner" || t.join === "outer" ? {
|
|
485
|
+
...t,
|
|
486
|
+
distinct: false
|
|
487
|
+
} : t);
|
|
488
|
+
}
|
|
489
|
+
/** Raw SQL may be volatile; only plain column correlations are safe to evaluate in a projection. */
|
|
490
|
+
function canProjectCondition(c) {
|
|
491
|
+
if (c.kind === "exp") return c.conditions.length > 0 && c.conditions.every(canProjectCondition);
|
|
492
|
+
if (c.kind === "raw") return c.bindings.length === 0 && /^[\w".]+ = [\w".]+$/.test(c.condition);
|
|
493
|
+
if (c.kind === "exists") return !c.subquery.ctes?.length && !c.subquery.groupBys?.length && c.subquery.tables.every((t) => t.join !== "lateral" && t.join !== "cross") && !!c.subquery.condition && canProjectCondition(c.subquery.condition);
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
export { buildCandidateBatchQuery };
|
|
497
|
+
|
|
498
|
+
//# sourceMappingURL=buildCandidateBatchQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCandidateBatchQuery.js","names":[],"sources":["../../src/dataloaders/buildCandidateBatchQuery.ts"],"sourcesContent":["import { collectFindArguments } from \"src/dataloaders/collectFindArguments.ts\";\nimport type { OpColumn } from \"src/drivers/EntityWriter.ts\";\nimport { buildRawQuery } from \"src/queries/find/buildFindQuery.ts\";\nimport type { ParsedCteClause, ParsedFindQuery, ParsedSelect } from \"src/queries/find/QueryParser.ts\";\nimport type {\n ColumnCondition,\n ParsedExpressionCondition,\n ParsedExpressionFilter,\n ParsedValueFilter,\n} from \"src/queries/parsedConditions.ts\";\nimport { buildValueCondition, buildWhereClause } from \"src/queries/renderConditions.ts\";\nimport { kq, kqDot } from \"src/queries/sql/keywords.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\n\n/** One individual em.find call included in this batch of finds with the same query structure. */\ninterface FindEntry {\n query: ParsedFindQuery;\n bindings: unknown[];\n}\n\n/**\n * Connects one filter to its per-call arguments and optional combined candidate values.\n *\n * I.e. `title IN ['one']` / `IN ['two']` uses columnNames = ['arg0'] to read each call's\n * list from _find, and allValues = ['one', 'two'] to select broad candidates.\n * Numeric ranges instead use range: BETWEEN 20 AND 30 / BETWEEN 40 AND 50\n * becomes BETWEEN 20 AND 50 for candidates. The exact-match phase still reads both bounds from _find.\n */\ninterface BatchFilterArgs {\n /** The exact-match phase reads each call's filter values from these _find columns. */\n columnNames: string[];\n /** The candidate phase uses these distinct eq/in values across all calls as a broad IN filter. */\n allValues?: unknown[];\n /** The candidate phase uses these broad numeric bounds; absent when comparing outside PostgreSQL is unsafe. */\n range?: ParsedValueFilter<number>;\n}\n\n/** The _find CTE and the mapping from filters to its argument columns. */\ninterface FindArguments {\n cte: ParsedCteClause;\n filters: Map<ColumnCondition, BatchFilterArgs>;\n}\n\n/**\n * Describes a SQL expression computed once per candidate or child row and reused for each call's filter.\n *\n * Its result is held in the candidate CTE, either as a column or within a child-record array.\n *\n * I.e. `{ name: \"_c0\", dbType: \"int\", sql: \"a.age\", bindings: [] }` selects `a.age AS _c0`.\n * An author aged 30 contributes the value 30, which the exact-match phase compares with each call's age filter.\n *\n * `{ name: \"_c0\", dbType: \"books\", sql: \"b\", bindings: [], sourceAlias: \"b\" }` selects a whole\n * book row as a field inside a child record. The exact-match phase reads its title and order from that same book.\n */\ninterface CandidateSelectValue {\n name: string;\n dbType: string;\n sql: string;\n bindings: unknown[];\n /** Present when projecting a table's native composite row, shared by all predicates on that alias. */\n sourceAlias?: string;\n}\n\n/**\n * Describes the candidate values and exact-match conditions for one level of the batch's nested filters.\n *\n * The candidate phase collects the values in `select`; the exact-match phase checks those values\n * against each call using `exactMatchSql`.\n *\n * Each batch has one top-level BatchLevel, plus one for each child EXISTS handled through a\n * record array, recursively. Shared EXISTS filters and simple positive eq/in filters handled\n * by scalar-array overlap add no level. Levels are created per batch, not per call or database row.\n * Each collection branch gets its own level: books and tags have separate levels at the same depth.\n *\n * I.e. authors -> books -> reviews uses three levels when both child collections use record arrays.\n * The author level collects book records; the book level describes their fields and same-book\n * exact-match phase conditions, including review records described by the review level.\n */\ninterface BatchLevel {\n /** Alias used to read collected values in the exact-match phase; i.e. \"a\" for _cand or \"_r0\" for unnested books. */\n alias: string;\n /** Values collected during the candidate phase, as top-level columns or fields inside child records. */\n select: CandidateSelectValue[];\n /** Exact-match phase condition comparing collected values with one call's _find arguments. */\n exactMatchSql: string;\n /** Source alias to table name, including outer levels; the candidate phase uses this to type native rows, i.e. \"b\" -> \"books\". */\n tables: Map<string, string>;\n /** Whether this level is inside a child record array; the candidate phase then collects native rows so the exact-match phase retains column collations. */\n nested: boolean;\n}\n\ninterface ExactMatchContext {\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>;\n nextAlias: number;\n}\n\n/**\n * Shares the candidate phase and child lookups across finds by compiling their filter tree.\n *\n * Before: each (author, find entry) pair repeats a collection lookup, then GROUP BY combines tags.\n * Here `_find(tag, arg0)` contains `(0, ['one'])`, `(1, ['two'])`. Simplified SQL:\n *\n * ```sql\n * SELECT a.*, array_agg(f.tag) AS _tags\n * FROM authors a CROSS JOIN _find f\n * WHERE EXISTS (SELECT 1 FROM books b\n * WHERE b.author_id = a.id AND b.title = ANY(f.arg0))\n * GROUP BY a.id;\n * ```\n *\n * After: collect child values once per candidate and compare them in SQL for each entry:\n *\n * ```sql\n * WITH _find(tag, arg0) AS MATERIALIZED (\n * SELECT unnest($1::int[]), unnest_arrays($2::varchar[][])\n * ), _cand AS MATERIALIZED (\n * SELECT a AS _entity,\n * ARRAY(SELECT b.title FROM books b\n * WHERE b.author_id = a.id AND b.title = ANY(ARRAY['one', 'two'])) AS _c0\n * FROM authors a\n * WHERE EXISTS (SELECT 1 FROM books b\n * WHERE b.author_id = a.id AND b.title = ANY(ARRAY['one', 'two']))\n * ), _matched AS MATERIALIZED (\n * SELECT c._entity,\n * ARRAY(SELECT f.tag FROM _find f WHERE c._c0 && f.arg0) AS _tags\n * FROM _cand c\n * )\n * SELECT (m._entity).*, m._tags FROM _matched m WHERE cardinality(m._tags) > 0;\n * ```\n *\n * Here $1 = [0, 1] and $2 = [['one'], ['two']]. The existing buildUnnestCte helper\n * binds arrays, so the _find SQL text stays the same as the number of entries changes.\n *\n * General child predicates use arrays of SQL records instead of independent arrays. I.e. books\n * `(title=one, order=2)` and `(title=two, order=1)` must not match `(title=one AND order=1)`.\n * Each record holds both values from the same child; nested EXISTS recursively collect child-record arrays.\n * Simple positive membership still uses scalar-array overlap, preserving the production fast path.\n *\n * @param query The first entry's prepared query. All entries have the same query structure.\n * @param entries One entry per distinct find, with column-filter values collected in `visitConditions` order.\n * An IN list occupies one slot and BETWEEN occupies two. Raw SQL bindings stay in the query, not this list.\n * @param constantBindings For each binding slot, whether every entry has the same value. I.e. bindings\n * `[30, [\"one\"]]` and `[30, [\"two\"]]` give `[true, false]`: age is shared, but the title list varies.\n */\nexport function buildCandidateBatchQuery(\n query: ParsedFindQuery,\n entries: readonly FindEntry[],\n constantBindings: readonly boolean[],\n): ParsedFindQuery | undefined {\n if (!query.condition || !hasCollectionCondition(query.condition) || query.ctes?.length || query.groupBys?.length)\n return;\n const primary = query.tables.find((t) => t.join === \"primary\")!;\n if (!canSelectCandidateEntities(query, primary.alias)) return;\n\n // _find: one row per call, containing its tag and the filter values that differ between calls.\n const findArguments = buildFindArguments(query, entries, constantBindings);\n if (!findArguments) return;\n const perCallFilters = findArguments.filters;\n\n // Candidate phase (_cand): select broad candidates and collect values needed for the exact-match phase.\n const exactMatchCondition = conditionsForExactMatch(query.condition, perCallFilters);\n if (!canProjectCondition(exactMatchCondition)) return;\n const context: ExactMatchContext = { perCallFilters, nextAlias: 0 };\n const batchLevel = buildBatchLevel(query, exactMatchCondition, primary.alias, context);\n const selects: ParsedSelect[] = [\n // A table's composite row expands back to its original columns without sending helper arrays.\n `${kq(primary.alias)} AS _entity`,\n ...batchLevel.select.map((v) => ({\n sql: `${v.sql} AS ${v.name}`,\n bindings: v.bindings,\n aliases: [primary.alias],\n })),\n ];\n\n // Carry sort values through the fence, including to-one joined columns and PostgreSQL NULL ordering.\n const orderBys = query.orderBys.map((orderBy, index) => {\n const column = `_o${index}`;\n selects.push(`${kqDot(orderBy.alias, orderBy.column)} AS ${column}`);\n return { ...orderBy, alias: primary.alias, column };\n });\n\n // The exact-match phase must carry these columns forward for the final ORDER BY.\n const orderSelects = orderBys.map((o) => kqDot(o.alias, o.column));\n\n // Apply broad filters in the candidate phase; ordering happens after the exact-match phase.\n const candidateCondition = buildCandidateCondition(query.condition, perCallFilters);\n const candidateCte: ParsedCteClause = {\n alias: \"_cand\",\n materialized: true,\n query: {\n kind: \"ast\",\n query: {\n ...query,\n // These joins return at most one row per parent, so DISTINCT is unnecessary.\n tables: withoutDistinct(query.tables),\n selects,\n condition: candidateCondition,\n orderBys: [],\n },\n },\n };\n\n // Exact-match phase (_matched): compare candidate values with _find and collect matching call tags.\n const exactMatchCte: ParsedCteClause = {\n alias: \"_matched\",\n // Prevent PostgreSQL from evaluating the tag subquery twice:\n // once for the nonempty-tags filter and again for the returned tags.\n materialized: true,\n query: {\n kind: \"ast\",\n query: {\n selects: [\n kqDot(primary.alias, \"_entity\"),\n ...orderSelects,\n `ARRAY(SELECT _find.tag FROM _find WHERE ${batchLevel.exactMatchSql}) AS _tags`,\n ],\n tables: [{ join: \"primary\", table: \"_cand\", alias: primary.alias }],\n orderBys: [],\n },\n },\n };\n\n // Only entities with matching calls reach hydration, ordering, and the entity limit.\n return {\n selects: [`(${kqDot(primary.alias, \"_entity\")}).*`, kqDot(primary.alias, \"_tags\")],\n tables: [{ join: \"primary\", table: \"_matched\", alias: primary.alias }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"raw\",\n condition: `cardinality(${kqDot(primary.alias, \"_tags\")}) > 0`,\n aliases: [primary.alias],\n bindings: [],\n pruneable: false,\n },\n ],\n },\n // Ordering and the caller's entity limit apply only after the exact-match phase.\n orderBys,\n ctes: [findArguments.cte, candidateCte, exactMatchCte],\n };\n}\n\n/**\n * Whether the entity comes from one table, without extra CTI fields or preload JSON aggregates.\n *\n * Candidates store that table's row in _entity and later expand it back into entity columns.\n * Fields selected from other CTI tables or added by plugins/preloading would be lost in that expansion.\n */\nfunction canSelectCandidateEntities(query: ParsedFindQuery, primaryAlias: string): boolean {\n // Joined projections (CTI/plugins), row-multiplying joins, and preload JSON need their own row mapping.\n return (\n query.selects.length === 1 &&\n query.selects[0] === `${kq(primaryAlias)}.*` &&\n query.tables.every(canSelectWithoutMultiplyingParents)\n );\n}\n\n/**\n * Whether joining this table returns at most one row per entity being found.\n *\n * Joining an author to its publisher cannot duplicate the author, but joining it to three books can.\n * Collection filters normally use EXISTS to avoid this; remaining collection joins can require DISTINCT\n * to return each entity once. Candidate batching omits DISTINCT, so it accepts only joins known not to\n * duplicate the entity.\n */\nfunction canSelectWithoutMultiplyingParents(table: ParsedFindQuery[\"tables\"][number]): boolean {\n if (table.join === \"primary\") return true;\n\n // Lateral and cross joins do not provide the cardinality guarantees used here.\n if (table.join !== \"inner\" && table.join !== \"outer\") return false;\n\n // Explicit cardinality metadata or a to-one id join guarantees at most one joined row.\n return table.distinct === false || (!table.collection && table.col2 === kqDot(table.alias, \"id\"));\n}\n\n/**\n * Encodes per-call filter arguments as columns of _find and records which filter uses each column.\n *\n * The binding positions must follow collectValues' visit order. Unsupported array encodings return\n * undefined so the caller can use regular batching instead of changing the filter's meaning.\n */\nfunction buildFindArguments(\n query: ParsedFindQuery,\n entries: readonly FindEntry[],\n constantBindings: readonly boolean[],\n): FindArguments | undefined {\n const columns: OpColumn[] = [{ columnName: \"tag\", dbType: \"int\" }];\n const values: unknown[][] = [entries.map((_, i) => i)];\n const filters = new Map<ColumnCondition, BatchFilterArgs>();\n let unsupported = false;\n\n for (const arg of collectFindArguments(query, constantBindings, { arrayEquality: true })) {\n const c = arg.condition;\n const start = arg.bindingIndexes[0];\n\n // Array-valued arguments need an encoding that preserves null elements and ragged dimensions.\n // The existing rectangular _find encoding cannot represent those without losing information.\n if (c.dbType.endsWith(\"[]\")) unsupported = true;\n const columnNames = arg.columns.map((column) => column.columnName);\n for (let slot = 0; slot < arg.bindingIndexes.length; slot++) {\n const i = arg.bindingIndexes[slot];\n const membership = c.cond.kind === \"eq\" || c.cond.kind === \"in\" || c.cond.kind === \"nin\";\n const slotValues = entries.map((entry) => (c.cond.kind === \"eq\" ? [entry.bindings[i]] : entry.bindings[i]));\n // unnest_arrays strips padding NULLs, which would change NOT IN's three-valued logic.\n if (membership && slotValues.some((v) => Array.isArray(v) && v.some((item) => item == null))) unsupported = true;\n columns.push(arg.columns[slot]);\n values.push(slotValues);\n }\n\n // eq/in combine values into a list; numeric ranges use broad bounds. Other operators\n // impose no candidate restriction and are checked only during the exact-match phase.\n let allValues: unknown[] | undefined;\n let range: ParsedValueFilter<number> | undefined;\n const kind = c.cond.kind;\n if (kind === \"eq\") {\n allValues = [...new Set(entries.map((entry) => entry.bindings[start]))];\n } else if (kind === \"in\") {\n allValues = [...new Set(entries.flatMap((entry) => entry.bindings[start] as unknown[]))];\n } else if (\n numericDbTypes.has(c.dbType) &&\n (kind === \"gt\" || kind === \"gte\" || kind === \"lt\" || kind === \"lte\" || kind === \"between\")\n ) {\n // Other database types can use ordering that differs from JavaScript numeric comparison.\n range = broadenNumericRange(kind, entries, start);\n }\n filters.set(c, { columnNames, allValues, range });\n }\n if (unsupported || filters.size === 0) return;\n\n return {\n cte: { ...buildUnnestCte(\"_find\", columns, values), materialized: true },\n filters,\n };\n}\n\nconst numericDbTypes = new Set<string>([\n \"smallint\",\n \"integer\",\n \"int\",\n \"int2\",\n \"int4\",\n \"int8\",\n \"bigint\",\n \"numeric\",\n \"decimal\",\n \"real\",\n \"float4\",\n \"float8\",\n \"double precision\",\n]);\n\n/**\n * Combines finite numeric bounds without applying JavaScript ordering to PostgreSQL strings or custom types.\n *\n * I.e. age >= 30 / age >= 40 becomes age >= 30. Numeric strings, timestamps, and other encoded values\n * are checked in the exact-match phase; converting them here could lose precision or change PostgreSQL's ordering.\n */\nfunction broadenNumericRange(\n kind: \"gt\" | \"gte\" | \"lt\" | \"lte\" | \"between\",\n entries: readonly FindEntry[],\n start: number,\n): ParsedValueFilter<number> | undefined {\n const bounds = entries.map((entry) => entry.bindings[start]);\n const upperBounds = kind === \"between\" ? entries.map((entry) => entry.bindings[start + 1]) : [];\n\n // Encoded numeric strings and non-finite values cannot safely use these JavaScript comparisons.\n if (!bounds.every(isFiniteNumber) || !upperBounds.every(isFiniteNumber)) return;\n\n if (kind === \"between\") {\n const lowestLowerBound = bounds.reduce((a, b) => Math.min(a, b));\n const highestUpperBound = upperBounds.reduce((a, b) => Math.max(a, b));\n return { kind, value: [lowestLowerBound, highestUpperBound] };\n }\n\n const value =\n kind === \"gt\" || kind === \"gte\" ? bounds.reduce((a, b) => Math.min(a, b)) : bounds.reduce((a, b) => Math.max(a, b));\n return { kind, value };\n}\n\n/** Whether a binding can be ordered numerically without decoding or coercion. */\nfunction isFiniteNumber(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value);\n}\n\n/**\n * Selects a superset of the requested rows without repeating the complete filter for every call.\n *\n * Each column condition accepts the values from any call, while AND/OR and positive EXISTS retain\n * their structure. I.e. `(title=one, order=1)` / `(title=two, order=2)` selects candidates using\n * `title IN [one, two] AND order IN [1, 2]`. The exact-match phase rejects cross-combinations afterward.\n * The number of calls changes bound arrays, not the candidate SQL text.\n */\nfunction buildCandidateCondition(\n condition: ParsedExpressionFilter,\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>,\n): ParsedExpressionFilter {\n return {\n ...condition,\n conditions: condition.conditions.map((c) => broadenCandidateCondition(c, perCallFilters)),\n };\n}\n\n/** Widens one condition without losing any row that could match an individual call. */\nfunction broadenCandidateCondition(\n c: ParsedExpressionCondition,\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>,\n): ParsedExpressionCondition {\n if (c.kind === \"exp\") return buildCandidateCondition(c, perCallFilters);\n if (c.kind === \"column\") {\n const arg = perCallFilters.get(c);\n if (!arg) return c;\n if (c.cond.kind === \"eq\" || c.cond.kind === \"in\") {\n return { ...c, cond: { kind: \"in\", value: arg.allValues! } };\n }\n if (arg.range) return { ...c, cond: arg.range };\n // Do not make the candidate phase depend on _find. NOT IN cannot use a union of exclusions,\n // and text/custom-type comparisons depend on PostgreSQL semantics. The exact-match phase handles these.\n return { kind: \"raw\", condition: \"TRUE\", aliases: [], bindings: [], pruneable: false };\n }\n if (c.kind === \"exists\" && c.subquery.condition && hasVaryingCondition(c, perCallFilters)) {\n // Widening the inside of NOT EXISTS would narrow the outside and lose valid candidates.\n // Leave this entire restriction to the exact-match phase; shared NOT EXISTS restrictions stay unchanged.\n if (c.negate) return { kind: \"raw\", condition: \"TRUE\", aliases: [], bindings: [], pruneable: false };\n return {\n ...c,\n subquery: { ...c.subquery, condition: buildCandidateCondition(c.subquery.condition, perCallFilters) },\n };\n }\n return c;\n}\n\n/** Builds the SELECT expressions and exact-match SQL for one level of the batch's nested filters. */\nfunction buildBatchLevel(\n query: ParsedFindQuery,\n condition: ParsedExpressionFilter,\n alias: string,\n context: ExactMatchContext,\n parentLevel?: BatchLevel,\n): BatchLevel {\n const tables = new Map(parentLevel?.tables);\n for (const table of query.tables) tables.set(table.alias, table.table);\n const level: BatchLevel = {\n alias,\n select: [],\n exactMatchSql: \"\",\n tables,\n nested: parentLevel !== undefined,\n };\n level.exactMatchSql = buildExactMatchCondition(condition, level, context);\n return level;\n}\n\n/**\n * Preserves boolean and EXISTS structure while replacing database lookups with projected row values.\n *\n * An EXISTS projection contains records, not independent column arrays: `_r0._c0` and `_r0._c1`\n * come from the same child. A nested EXISTS becomes a record-array field on that particular child.\n */\nfunction buildExactMatchCondition(c: ParsedExpressionCondition, level: BatchLevel, context: ExactMatchContext): string {\n if (c.kind === \"exp\") {\n return `(${c.conditions.map((child) => buildExactMatchCondition(child, level, context)).join(` ${c.op.toUpperCase()} `)})`;\n }\n const name = `_c${level.select.length}`;\n const reference = kqDot(level.alias, name);\n const arg = c.kind === \"column\" ? context.perCallFilters.get(c) : undefined;\n if (c.kind === \"column\" && arg) {\n if (level.nested) {\n // An anonymous record's `text` field loses a column-specific collation when unnested.\n // A native table row retains attribute types AND collations, and is projected once per source alias.\n let source = level.select.find((v) => v.sourceAlias === c.alias);\n if (!source) {\n source = { name, dbType: kq(level.tables.get(c.alias)!), sql: kq(c.alias), bindings: [], sourceAlias: c.alias };\n level.select.push(source);\n }\n return renderExactMatch(c, `(${kqDot(level.alias, source.name)}).${kq(c.column)}`, arg);\n }\n level.select.push({ name, dbType: c.dbType, sql: kqDot(c.alias, c.column), bindings: [] });\n return renderExactMatch(c, reference, arg);\n }\n if (c.kind === \"exists\" && hasVaryingCondition(c, context.perCallFilters)) {\n const childCondition = conditionsForExactMatch(c.subquery.condition!, context.perCallFilters);\n const childWhere = sharedConditionsForCandidate(c.subquery.condition!, context.perCallFilters);\n // A joined child may have several matching rows. Deduplicating its id before the exact-match phase would\n // discard other joined values; EXISTS only needs one match, so duplicate child records are harmless.\n const tables = withoutDistinct(c.subquery.tables);\n const scalar = singleMembership(childCondition, context.perCallFilters);\n if (scalar && !c.negate && !level.nested) {\n // A single membership predicate needs only one scalar array, not a record array + unnest.\n // Only use it on the candidate itself: an array inside an anonymous record would lose its\n // column collation on unnest. Nested levels use native table rows to preserve that metadata.\n // Every call's requested values are a subset of allValues, so other child values cannot\n // affect overlap. Keep shared restrictions while trimming the materialized array.\n const requestedChildWhere: ParsedExpressionFilter = {\n kind: \"exp\",\n op: \"and\",\n conditions: [childWhere, broadenCandidateCondition(scalar, context.perCallFilters)],\n };\n const child = buildRawQuery(\n {\n ...c.subquery,\n tables,\n selects: [kqDot(scalar.alias, scalar.column)],\n condition: requestedChildWhere,\n orderBys: [],\n },\n {},\n );\n level.select.push({\n name,\n dbType: `${scalar.dbType}[]`,\n sql: `ARRAY(${child.sql})`,\n bindings: [...child.bindings],\n });\n return `${reference} && _find.${context.perCallFilters.get(scalar)!.columnNames[0]}`;\n }\n const childLevel = buildBatchLevel(c.subquery, childCondition, `_r${context.nextAlias++}`, context, level);\n const childRows = buildRawQuery(\n {\n ...c.subquery,\n tables,\n selects: [\n {\n sql: `ROW(${childLevel.select.map((v) => v.sql).join(\", \")})`,\n bindings: childLevel.select.flatMap((v) => v.bindings),\n aliases: c.outerAliases,\n },\n ],\n condition: childWhere,\n orderBys: [],\n },\n {},\n );\n level.select.push({\n name,\n dbType: \"record[]\",\n sql: `ARRAY(${childRows.sql})`,\n bindings: [...childRows.bindings],\n });\n const columns = childLevel.select.map((v) => `${v.name} ${v.dbType}`).join(\", \");\n return `${c.negate ? \"NOT \" : \"\"}EXISTS (SELECT 1 FROM unnest(${reference}) AS ${childLevel.alias}(${columns}) WHERE ${childLevel.exactMatchSql})`;\n }\n // Shared predicates below OR must still be checked for each entry. Project the database's boolean\n // result once, preserving NULL semantics and avoiding JS evaluation of types, timestamps, or operators.\n const [sql, bindings] = buildWhereClause({ kind: \"exp\", op: \"and\", conditions: [c] }, true, (q) =>\n buildRawQuery(q, {}),\n )!;\n level.select.push({ name, dbType: \"boolean\", sql: `(${sql})`, bindings });\n return reference;\n}\n\n/**\n * Renders an exact-match phase comparison against candidate values and typed _find argument columns.\n *\n * I.e. an age BETWEEN filter with reference = \"a._c0\" and columnNames = [\"arg0\", \"arg1\"]\n * becomes `a._c0 BETWEEN _find.arg0 AND _find.arg1`: the candidate's age is compared with each call's bounds.\n */\nfunction renderExactMatch(c: ColumnCondition, reference: string, arg: BatchFilterArgs): string {\n if (c.cond.kind === \"eq\" || c.cond.kind === \"in\") return `${reference} = ANY(_find.${arg.columnNames[0]})`;\n const [sql] = buildValueCondition(reference, c.cond);\n let index = 0;\n // This is renderer-generated SQL, not user raw SQL. Replace its placeholders (including ALL(?)),\n // leaving the '?' in PostgreSQL's JSON-path operator '@?' intact.\n return sql.replace(/(?<!@)\\?/g, () => `_find.${arg.columnNames[index++]}`);\n}\n\n/** Finds the scalar-array overlap case after shared AND filters have been moved to the candidate phase. */\nfunction singleMembership(\n c: ParsedExpressionCondition,\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>,\n): ColumnCondition | undefined {\n if (c.kind === \"exp\" && c.conditions.length === 1) return singleMembership(c.conditions[0], perCallFilters);\n return c.kind === \"column\" && perCallFilters.has(c) && (c.cond.kind === \"eq\" || c.cond.kind === \"in\") ? c : undefined;\n}\n\n/**\n * Keeps conditions that still need checking after the candidate phase has applied shared filters.\n *\n * The phases split conditions only at AND: if all calls require `age > 20 AND title = theirTitle`,\n * the candidate phase guarantees age > 20, so the exact-match phase needs only the title.\n * For `age > 20 OR title = theirTitle`, the candidate phase does not guarantee either branch\n * for a particular call, so the exact-match phase keeps the whole OR.\n * `sharedConditionsForCandidate` supplies the complementary restrictions when collecting child rows.\n */\nfunction conditionsForExactMatch(\n c: ParsedExpressionFilter,\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>,\n): ParsedExpressionFilter {\n if (c.op !== \"and\") return c;\n return {\n ...c,\n conditions: c.conditions\n .filter((child) => hasVaryingCondition(child, perCallFilters))\n .map((child) => (child.kind === \"exp\" ? conditionsForExactMatch(child, perCallFilters) : child)),\n };\n}\n\n/**\n * Keeps shared AND restrictions for the candidate phase when collecting child rows.\n *\n * I.e. calls requesting `book.order = 1 AND book.title = \"one\"` / `book.order = 1 AND book.title = \"two\"`\n * can collect only books with order = 1. The exact-match phase then checks each call's title.\n *\n * For `book.order = 1 OR book.title = \"one\"` / `book.order = 1 OR book.title = \"two\"`, collecting only\n * books with order = 1 would lose books accepted by the title branch. This helper therefore keeps no\n * restriction from that OR; the exact-match phase checks the entire OR for each call.\n */\nfunction sharedConditionsForCandidate(\n c: ParsedExpressionFilter,\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>,\n): ParsedExpressionFilter {\n if (!hasVaryingCondition(c, perCallFilters)) return c;\n return {\n kind: \"exp\",\n op: \"and\",\n conditions:\n c.op === \"or\"\n ? []\n : c.conditions.flatMap((child) => {\n if (!hasVaryingCondition(child, perCallFilters)) return [child];\n return child.kind === \"exp\" ? [sharedConditionsForCandidate(child, perCallFilters)] : [];\n }),\n };\n}\n\n/** Whether this condition uses filter values that differ between batched em.find calls, including inside nested EXISTS. */\nfunction hasVaryingCondition(\n c: ParsedExpressionCondition,\n perCallFilters: Map<ColumnCondition, BatchFilterArgs>,\n): boolean {\n if (c.kind === \"column\") return perCallFilters.has(c);\n if (c.kind === \"exp\") return c.conditions.some((child) => hasVaryingCondition(child, perCallFilters));\n return c.kind === \"exists\" && !!c.subquery.condition && hasVaryingCondition(c.subquery.condition, perCallFilters);\n}\n\n/** Whether the candidate phase includes a collection lookup, including a no-children check. */\nfunction hasCollectionCondition(c: ParsedExpressionCondition): boolean {\n return c.kind === \"exists\" || (c.kind === \"exp\" && c.conditions.some(hasCollectionCondition));\n}\n\n/** Suppresses the renderer's automatic DISTINCT for root to-one joins or EXISTS child-record arrays. */\nfunction withoutDistinct(tables: ParsedFindQuery[\"tables\"]): ParsedFindQuery[\"tables\"] {\n return tables.map((t) => (t.join === \"inner\" || t.join === \"outer\" ? { ...t, distinct: false } : t));\n}\n\n/** Raw SQL may be volatile; only plain column correlations are safe to evaluate in a projection. */\nfunction canProjectCondition(c: ParsedExpressionCondition): boolean {\n if (c.kind === \"exp\") return c.conditions.length > 0 && c.conditions.every(canProjectCondition);\n if (c.kind === \"raw\") return c.bindings.length === 0 && /^[\\w\".]+ = [\\w\".]+$/.test(c.condition);\n if (c.kind === \"exists\")\n return (\n !c.subquery.ctes?.length &&\n !c.subquery.groupBys?.length &&\n c.subquery.tables.every((t) => t.join !== \"lateral\" && t.join !== \"cross\") &&\n !!c.subquery.condition &&\n canProjectCondition(c.subquery.condition)\n );\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgJA,SAAgB,yBACd,OACA,SACA,kBAC6B;CAC7B,IA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