joist-core 2.3.0 → 2.4.0-next.2
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 +112 -0
- package/build/BaseEntity.cjs.map +1 -0
- package/build/BaseEntity.d.cts +73 -0
- package/build/BaseEntity.d.cts.map +1 -0
- package/build/BaseEntity.d.mts +73 -0
- package/build/BaseEntity.d.mts.map +1 -0
- package/build/BaseEntity.js +99 -110
- package/build/BaseEntity.js.map +1 -1
- package/build/Entity.cjs +12 -0
- package/build/Entity.cjs.map +1 -0
- package/build/Entity.d.cts +42 -0
- package/build/Entity.d.cts.map +1 -0
- package/build/Entity.d.mts +42 -0
- package/build/Entity.d.mts.map +1 -0
- package/build/Entity.js +8 -5
- package/build/Entity.js.map +1 -1
- package/build/EntityFields.cjs +1 -0
- package/build/EntityFields.d.cts +36 -0
- package/build/EntityFields.d.cts.map +1 -0
- package/build/EntityFields.d.mts +36 -0
- package/build/EntityFields.d.mts.map +1 -0
- package/build/EntityFields.js +1 -3
- package/build/EntityManager.cjs +1935 -0
- package/build/EntityManager.cjs.map +1 -0
- package/build/EntityManager.d.cts +835 -0
- package/build/EntityManager.d.cts.map +1 -0
- package/build/EntityManager.d.mts +835 -0
- package/build/EntityManager.d.mts.map +1 -0
- package/build/EntityManager.js +1812 -2211
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +75 -0
- package/build/EntityMetadata.cjs.map +1 -0
- package/build/EntityMetadata.d.cts +262 -0
- package/build/EntityMetadata.d.cts.map +1 -0
- package/build/EntityMetadata.d.mts +262 -0
- package/build/EntityMetadata.d.mts.map +1 -0
- package/build/EntityMetadata.js +31 -48
- package/build/EntityMetadata.js.map +1 -1
- package/build/EnumMetadata.cjs +1 -0
- package/build/EnumMetadata.d.cts +18 -0
- package/build/EnumMetadata.d.cts.map +1 -0
- package/build/EnumMetadata.d.mts +18 -0
- package/build/EnumMetadata.d.mts.map +1 -0
- package/build/EnumMetadata.js +1 -3
- package/build/IndexManager.cjs +178 -0
- package/build/IndexManager.cjs.map +1 -0
- package/build/IndexManager.d.cts +36 -0
- package/build/IndexManager.d.cts.map +1 -0
- package/build/IndexManager.d.mts +36 -0
- package/build/IndexManager.d.mts.map +1 -0
- package/build/IndexManager.js +169 -218
- package/build/IndexManager.js.map +1 -1
- package/build/InstanceData.cjs +218 -0
- package/build/InstanceData.cjs.map +1 -0
- package/build/InstanceData.d.cts +98 -0
- package/build/InstanceData.d.cts.map +1 -0
- package/build/InstanceData.d.mts +98 -0
- package/build/InstanceData.d.mts.map +1 -0
- package/build/InstanceData.js +215 -222
- package/build/InstanceData.js.map +1 -1
- package/build/PluginManager.cjs +89 -0
- package/build/PluginManager.cjs.map +1 -0
- package/build/PluginManager.d.cts +112 -0
- package/build/PluginManager.d.cts.map +1 -0
- package/build/PluginManager.d.mts +112 -0
- package/build/PluginManager.d.mts.map +1 -0
- package/build/PluginManager.js +80 -106
- package/build/PluginManager.js.map +1 -1
- package/build/RowData.cjs +37 -0
- package/build/RowData.cjs.map +1 -0
- package/build/RowData.d.cts +53 -0
- package/build/RowData.d.cts.map +1 -0
- package/build/RowData.d.mts +53 -0
- package/build/RowData.d.mts.map +1 -0
- package/build/RowData.js +35 -0
- package/build/RowData.js.map +1 -0
- package/build/_virtual/_rolldown/runtime.cjs +23 -0
- package/build/batchloaders/BatchLoader.cjs +49 -0
- package/build/batchloaders/BatchLoader.cjs.map +1 -0
- package/build/batchloaders/BatchLoader.d.cts +17 -0
- package/build/batchloaders/BatchLoader.d.cts.map +1 -0
- package/build/batchloaders/BatchLoader.d.mts +17 -0
- package/build/batchloaders/BatchLoader.d.mts.map +1 -0
- package/build/batchloaders/BatchLoader.js +45 -54
- package/build/batchloaders/BatchLoader.js.map +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.cjs +66 -0
- package/build/batchloaders/enumCollectionBatchLoader.cjs.map +1 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.cts +11 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.mts +11 -0
- package/build/batchloaders/enumCollectionBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/enumCollectionBatchLoader.js +58 -48
- package/build/batchloaders/enumCollectionBatchLoader.js.map +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +78 -0
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -0
- package/build/batchloaders/loadBatchLoader.d.cts +20 -0
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/loadBatchLoader.d.mts +20 -0
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/loadBatchLoader.js +72 -51
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +78 -0
- package/build/batchloaders/manyToManyBatchLoader.cjs.map +1 -0
- package/build/batchloaders/manyToManyBatchLoader.d.cts +11 -0
- package/build/batchloaders/manyToManyBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/manyToManyBatchLoader.d.mts +11 -0
- package/build/batchloaders/manyToManyBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/manyToManyBatchLoader.js +70 -61
- package/build/batchloaders/manyToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +63 -0
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -0
- package/build/batchloaders/oneToManyBatchLoader.d.cts +11 -0
- package/build/batchloaders/oneToManyBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/oneToManyBatchLoader.d.mts +11 -0
- package/build/batchloaders/oneToManyBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/oneToManyBatchLoader.js +58 -48
- package/build/batchloaders/oneToManyBatchLoader.js.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.cjs +64 -0
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -0
- package/build/batchloaders/oneToOneBatchLoader.d.cts +10 -0
- package/build/batchloaders/oneToOneBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/oneToOneBatchLoader.d.mts +10 -0
- package/build/batchloaders/oneToOneBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/oneToOneBatchLoader.js +59 -50
- package/build/batchloaders/oneToOneBatchLoader.js.map +1 -1
- package/build/batchloaders/populateBatchLoader.cjs +155 -0
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -0
- package/build/batchloaders/populateBatchLoader.d.cts +17 -0
- package/build/batchloaders/populateBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/populateBatchLoader.d.mts +17 -0
- package/build/batchloaders/populateBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/populateBatchLoader.js +147 -203
- package/build/batchloaders/populateBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +78 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts +10 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts +10 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/recursiveChildrenBatchLoader.js +71 -72
- package/build/batchloaders/recursiveChildrenBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +83 -0
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts +10 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts +10 -0
- package/build/batchloaders/recursiveM2mBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/recursiveM2mBatchLoader.js +76 -79
- package/build/batchloaders/recursiveM2mBatchLoader.js.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +65 -0
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts +10 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.cts.map +1 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts +10 -0
- package/build/batchloaders/recursiveParentsBatchLoader.d.mts.map +1 -0
- package/build/batchloaders/recursiveParentsBatchLoader.js +58 -55
- package/build/batchloaders/recursiveParentsBatchLoader.js.map +1 -1
- package/build/changes.cjs +221 -0
- package/build/changes.cjs.map +1 -0
- package/build/changes.d.cts +95 -0
- package/build/changes.d.cts.map +1 -0
- package/build/changes.d.mts +95 -0
- package/build/changes.d.mts.map +1 -0
- package/build/changes.js +208 -285
- package/build/changes.js.map +1 -1
- package/build/config.cjs +295 -0
- package/build/config.cjs.map +1 -0
- package/build/config.d.cts +277 -0
- package/build/config.d.cts.map +1 -0
- package/build/config.d.mts +277 -0
- package/build/config.d.mts.map +1 -0
- package/build/config.js +255 -301
- package/build/config.js.map +1 -1
- package/build/configure.cjs +324 -0
- package/build/configure.cjs.map +1 -0
- package/build/configure.d.cts +19 -0
- package/build/configure.d.cts.map +1 -0
- package/build/configure.d.mts +19 -0
- package/build/configure.d.mts.map +1 -0
- package/build/configure.js +265 -348
- package/build/configure.js.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.cjs +140 -0
- package/build/dataloaders/fastWhereFilterHash.cjs.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.d.cts +18 -0
- package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.d.mts +18 -0
- package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -0
- package/build/dataloaders/fastWhereFilterHash.js +108 -133
- package/build/dataloaders/fastWhereFilterHash.js.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.cjs +58 -0
- package/build/dataloaders/findByUniqueDataLoader.cjs.map +1 -0
- package/build/dataloaders/findByUniqueDataLoader.d.cts +10 -0
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findByUniqueDataLoader.d.mts +10 -0
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findByUniqueDataLoader.js +53 -44
- package/build/dataloaders/findByUniqueDataLoader.js.map +1 -1
- package/build/dataloaders/findCountDataLoader.cjs +123 -0
- package/build/dataloaders/findCountDataLoader.cjs.map +1 -0
- package/build/dataloaders/findCountDataLoader.d.cts +19 -0
- package/build/dataloaders/findCountDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findCountDataLoader.d.mts +19 -0
- package/build/dataloaders/findCountDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findCountDataLoader.js +112 -109
- package/build/dataloaders/findCountDataLoader.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +365 -0
- package/build/dataloaders/findDataLoader.cjs.map +1 -0
- package/build/dataloaders/findDataLoader.d.cts +79 -0
- package/build/dataloaders/findDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findDataLoader.d.mts +79 -0
- package/build/dataloaders/findDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findDataLoader.js +298 -382
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +82 -0
- package/build/dataloaders/findIdsDataLoader.cjs.map +1 -0
- package/build/dataloaders/findIdsDataLoader.d.cts +9 -0
- package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findIdsDataLoader.d.mts +9 -0
- package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findIdsDataLoader.js +77 -74
- package/build/dataloaders/findIdsDataLoader.js.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs +120 -0
- package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -0
- package/build/dataloaders/findOrCreateDataLoader.d.cts +15 -0
- package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findOrCreateDataLoader.d.mts +15 -0
- package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findOrCreateDataLoader.js +102 -164
- package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +98 -0
- package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -0
- package/build/dataloaders/findPaginatedDataLoader.d.cts +10 -0
- package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -0
- package/build/dataloaders/findPaginatedDataLoader.d.mts +10 -0
- package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -0
- package/build/dataloaders/findPaginatedDataLoader.js +93 -80
- package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
- package/build/dataloaders/lensDataLoader.cjs +178 -0
- package/build/dataloaders/lensDataLoader.cjs.map +1 -0
- package/build/dataloaders/lensDataLoader.d.cts +15 -0
- package/build/dataloaders/lensDataLoader.d.cts.map +1 -0
- package/build/dataloaders/lensDataLoader.d.mts +15 -0
- package/build/dataloaders/lensDataLoader.d.mts.map +1 -0
- package/build/dataloaders/lensDataLoader.js +172 -176
- package/build/dataloaders/lensDataLoader.js.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.cjs +84 -0
- package/build/dataloaders/manyToManyFindDataLoader.cjs.map +1 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +12 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +12 -0
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -0
- package/build/dataloaders/manyToManyFindDataLoader.js +76 -70
- package/build/dataloaders/manyToManyFindDataLoader.js.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.cjs +77 -0
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +12 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +12 -0
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -0
- package/build/dataloaders/oneToManyFindDataLoader.js +71 -67
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +195 -0
- package/build/defaults.cjs.map +1 -0
- package/build/defaults.d.cts +56 -0
- package/build/defaults.d.cts.map +1 -0
- package/build/defaults.d.mts +56 -0
- package/build/defaults.d.mts.map +1 -0
- package/build/defaults.js +171 -271
- package/build/defaults.js.map +1 -1
- package/build/drivers/Driver.cjs +3 -0
- package/build/drivers/Driver.d.cts +51 -0
- package/build/drivers/Driver.d.cts.map +1 -0
- package/build/drivers/Driver.d.mts +51 -0
- package/build/drivers/Driver.d.mts.map +1 -0
- package/build/drivers/Driver.js +3 -3
- package/build/drivers/EntityWriter.cjs +208 -0
- package/build/drivers/EntityWriter.cjs.map +1 -0
- package/build/drivers/EntityWriter.d.cts +66 -0
- package/build/drivers/EntityWriter.d.cts.map +1 -0
- package/build/drivers/EntityWriter.d.mts +66 -0
- package/build/drivers/EntityWriter.d.mts.map +1 -0
- package/build/drivers/EntityWriter.js +183 -219
- package/build/drivers/EntityWriter.js.map +1 -1
- package/build/drivers/IdAssigner.cjs +89 -0
- package/build/drivers/IdAssigner.cjs.map +1 -0
- package/build/drivers/IdAssigner.d.cts +50 -0
- package/build/drivers/IdAssigner.d.cts.map +1 -0
- package/build/drivers/IdAssigner.d.mts +50 -0
- package/build/drivers/IdAssigner.d.mts.map +1 -0
- package/build/drivers/IdAssigner.js +80 -124
- package/build/drivers/IdAssigner.js.map +1 -1
- package/build/drivers/driverApi.cjs +19 -0
- package/build/drivers/driverApi.cjs.map +1 -0
- package/build/drivers/driverApi.d.cts +22 -0
- package/build/drivers/driverApi.d.cts.map +1 -0
- package/build/drivers/driverApi.d.mts +22 -0
- package/build/drivers/driverApi.d.mts.map +1 -0
- package/build/drivers/driverApi.js +18 -0
- package/build/drivers/driverApi.js.map +1 -0
- package/build/drivers/index.cjs +7 -0
- package/build/drivers/index.d.cts +4 -0
- package/build/drivers/index.d.mts +4 -0
- package/build/drivers/index.js +3 -22
- package/build/fields.cjs +127 -0
- package/build/fields.cjs.map +1 -0
- package/build/fields.d.cts +29 -0
- package/build/fields.d.cts.map +1 -0
- package/build/fields.d.mts +29 -0
- package/build/fields.d.mts.map +1 -0
- package/build/fields.js +98 -160
- package/build/fields.js.map +1 -1
- package/build/flush/FlushLock.cjs +51 -0
- package/build/flush/FlushLock.cjs.map +1 -0
- package/build/flush/FlushLock.d.cts +29 -0
- package/build/flush/FlushLock.d.cts.map +1 -0
- package/build/flush/FlushLock.d.mts +29 -0
- package/build/flush/FlushLock.d.mts.map +1 -0
- package/build/flush/FlushLock.js +51 -0
- package/build/flush/FlushLock.js.map +1 -0
- package/build/flush/JoinRows.cjs +263 -0
- package/build/flush/JoinRows.cjs.map +1 -0
- package/build/flush/JoinRows.d.cts +120 -0
- package/build/flush/JoinRows.d.cts.map +1 -0
- package/build/flush/JoinRows.d.mts +120 -0
- package/build/flush/JoinRows.d.mts.map +1 -0
- package/build/flush/JoinRows.js +261 -0
- package/build/flush/JoinRows.js.map +1 -0
- package/build/flush/PendingChanges.cjs +1 -0
- package/build/flush/PendingChanges.d.cts +29 -0
- package/build/flush/PendingChanges.d.cts.map +1 -0
- package/build/flush/PendingChanges.d.mts +29 -0
- package/build/flush/PendingChanges.d.mts.map +1 -0
- package/build/flush/PendingChanges.js +1 -0
- package/build/flush/Todo.cjs +71 -0
- package/build/flush/Todo.cjs.map +1 -0
- package/build/flush/Todo.d.cts +38 -0
- package/build/flush/Todo.d.cts.map +1 -0
- package/build/flush/Todo.d.mts +38 -0
- package/build/flush/Todo.d.mts.map +1 -0
- package/build/flush/Todo.js +67 -0
- package/build/flush/Todo.js.map +1 -0
- package/build/getProperties.cjs +87 -0
- package/build/getProperties.cjs.map +1 -0
- package/build/getProperties.d.cts +30 -0
- package/build/getProperties.d.cts.map +1 -0
- package/build/getProperties.d.mts +30 -0
- package/build/getProperties.d.mts.map +1 -0
- package/build/getProperties.js +71 -128
- package/build/getProperties.js.map +1 -1
- package/build/index.cjs +524 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +180 -0
- package/build/index.d.cts.map +1 -0
- package/build/index.d.mts +180 -0
- package/build/index.d.mts.map +1 -0
- package/build/index.js +171 -292
- package/build/index.js.map +1 -1
- package/build/json.cjs +79 -0
- package/build/json.cjs.map +1 -0
- package/build/json.d.cts +76 -0
- package/build/json.d.cts.map +1 -0
- package/build/json.d.mts +76 -0
- package/build/json.d.mts.map +1 -0
- package/build/json.js +68 -106
- package/build/json.js.map +1 -1
- package/build/k.cjs +9 -0
- package/build/k.cjs.map +1 -0
- package/build/k.d.cts +1 -0
- package/build/k.d.mts +1 -0
- package/build/k.js +6 -6
- package/build/k.js.map +1 -1
- package/build/keys.cjs +181 -0
- package/build/keys.cjs.map +1 -0
- package/build/keys.d.cts +55 -0
- package/build/keys.d.cts.map +1 -0
- package/build/keys.d.mts +55 -0
- package/build/keys.d.mts.map +1 -0
- package/build/keys.js +129 -162
- package/build/keys.js.map +1 -1
- package/build/loading/HintTree.cjs +67 -0
- package/build/loading/HintTree.cjs.map +1 -0
- package/build/loading/HintTree.d.cts +45 -0
- package/build/loading/HintTree.d.cts.map +1 -0
- package/build/loading/HintTree.d.mts +45 -0
- package/build/loading/HintTree.d.mts.map +1 -0
- package/build/loading/HintTree.js +66 -0
- package/build/loading/HintTree.js.map +1 -0
- package/build/loading/IsLoadedCache.cjs +58 -0
- package/build/loading/IsLoadedCache.cjs.map +1 -0
- package/build/loading/IsLoadedCache.d.cts +35 -0
- package/build/loading/IsLoadedCache.d.cts.map +1 -0
- package/build/loading/IsLoadedCache.d.mts +35 -0
- package/build/loading/IsLoadedCache.d.mts.map +1 -0
- package/build/loading/IsLoadedCache.js +57 -0
- package/build/loading/IsLoadedCache.js.map +1 -0
- package/build/loading/loadHints.cjs +95 -0
- package/build/loading/loadHints.cjs.map +1 -0
- package/build/loading/loadHints.d.cts +116 -0
- package/build/loading/loadHints.d.cts.map +1 -0
- package/build/loading/loadHints.d.mts +116 -0
- package/build/loading/loadHints.d.mts.map +1 -0
- package/build/loading/loadHints.js +88 -0
- package/build/loading/loadHints.js.map +1 -0
- package/build/loading/loadLens.cjs +212 -0
- package/build/loading/loadLens.cjs.map +1 -0
- package/build/loading/loadLens.d.cts +77 -0
- package/build/loading/loadLens.d.cts.map +1 -0
- package/build/loading/loadLens.d.mts +77 -0
- package/build/loading/loadLens.d.mts.map +1 -0
- package/build/loading/loadLens.js +201 -0
- package/build/loading/loadLens.js.map +1 -0
- package/build/loading/withLoaded.cjs +64 -0
- package/build/loading/withLoaded.cjs.map +1 -0
- package/build/loading/withLoaded.d.cts +65 -0
- package/build/loading/withLoaded.d.cts.map +1 -0
- package/build/loading/withLoaded.d.mts +65 -0
- package/build/loading/withLoaded.d.mts.map +1 -0
- package/build/loading/withLoaded.js +61 -0
- package/build/loading/withLoaded.js.map +1 -0
- package/build/logging/FactoryLogger.cjs +66 -0
- package/build/logging/FactoryLogger.cjs.map +1 -0
- package/build/logging/FactoryLogger.d.cts +27 -0
- package/build/logging/FactoryLogger.d.cts.map +1 -0
- package/build/logging/FactoryLogger.d.mts +27 -0
- package/build/logging/FactoryLogger.d.mts.map +1 -0
- package/build/logging/FactoryLogger.js +58 -73
- package/build/logging/FactoryLogger.js.map +1 -1
- package/build/logging/FieldLogger.cjs +57 -0
- package/build/logging/FieldLogger.cjs.map +1 -0
- package/build/logging/FieldLogger.d.cts +32 -0
- package/build/logging/FieldLogger.d.cts.map +1 -0
- package/build/logging/FieldLogger.d.mts +32 -0
- package/build/logging/FieldLogger.d.mts.map +1 -0
- package/build/logging/FieldLogger.js +51 -67
- package/build/logging/FieldLogger.js.map +1 -1
- package/build/logging/ReactionLogger.cjs +93 -0
- package/build/logging/ReactionLogger.cjs.map +1 -0
- package/build/logging/ReactionLogger.d.cts +37 -0
- package/build/logging/ReactionLogger.d.cts.map +1 -0
- package/build/logging/ReactionLogger.d.mts +37 -0
- package/build/logging/ReactionLogger.d.mts.map +1 -0
- package/build/logging/ReactionLogger.js +76 -66
- package/build/logging/ReactionLogger.js.map +1 -1
- package/build/newEntity.cjs +89 -0
- package/build/newEntity.cjs.map +1 -0
- package/build/newEntity.d.cts +48 -0
- package/build/newEntity.d.cts.map +1 -0
- package/build/newEntity.d.mts +48 -0
- package/build/newEntity.d.mts.map +1 -0
- package/build/newEntity.js +71 -94
- package/build/newEntity.js.map +1 -1
- package/build/newTestInstance.cjs +539 -0
- package/build/newTestInstance.cjs.map +1 -0
- package/build/newTestInstance.d.cts +207 -0
- package/build/newTestInstance.d.cts.map +1 -0
- package/build/newTestInstance.d.mts +207 -0
- package/build/newTestInstance.d.mts.map +1 -0
- package/build/newTestInstance.js +459 -721
- package/build/newTestInstance.js.map +1 -1
- package/build/normalizeHints.cjs +58 -0
- package/build/normalizeHints.cjs.map +1 -0
- package/build/normalizeHints.d.cts +24 -0
- package/build/normalizeHints.d.cts.map +1 -0
- package/build/normalizeHints.d.mts +24 -0
- package/build/normalizeHints.d.mts.map +1 -0
- package/build/normalizeHints.js +40 -55
- package/build/normalizeHints.js.map +1 -1
- package/build/nowUTC.cjs +15 -0
- package/build/nowUTC.cjs.map +1 -0
- package/build/nowUTC.d.cts +10 -0
- package/build/nowUTC.d.cts.map +1 -0
- package/build/nowUTC.d.mts +10 -0
- package/build/nowUTC.d.mts.map +1 -0
- package/build/nowUTC.js +14 -0
- package/build/nowUTC.js.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.cjs +21 -0
- package/build/plugins/ImmutableEntitiesPlugin.cjs.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.cts +12 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.cts.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.mts +12 -0
- package/build/plugins/ImmutableEntitiesPlugin.d.mts.map +1 -0
- package/build/plugins/ImmutableEntitiesPlugin.js +19 -20
- package/build/plugins/ImmutableEntitiesPlugin.js.map +1 -1
- package/build/plugins/PreloadPlugin.cjs +3 -0
- package/build/plugins/PreloadPlugin.d.cts +77 -0
- package/build/plugins/PreloadPlugin.d.cts.map +1 -0
- package/build/plugins/PreloadPlugin.d.mts +77 -0
- package/build/plugins/PreloadPlugin.d.mts.map +1 -0
- package/build/plugins/PreloadPlugin.js +3 -3
- package/build/preloading/JsonAggregatePreloader.cjs +280 -0
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -0
- package/build/preloading/JsonAggregatePreloader.d.cts +19 -0
- package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -0
- package/build/preloading/JsonAggregatePreloader.d.mts +19 -0
- package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -0
- package/build/preloading/JsonAggregatePreloader.js +270 -320
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/canPreload.cjs +19 -0
- package/build/preloading/canPreload.cjs.map +1 -0
- package/build/preloading/canPreload.d.cts +6 -0
- package/build/preloading/canPreload.d.cts.map +1 -0
- package/build/preloading/canPreload.d.mts +6 -0
- package/build/preloading/canPreload.d.mts.map +1 -0
- package/build/preloading/canPreload.js +15 -21
- package/build/preloading/canPreload.js.map +1 -1
- package/build/preloading/partitionHint.cjs +43 -0
- package/build/preloading/partitionHint.cjs.map +1 -0
- package/build/preloading/partitionHint.d.cts +8 -0
- package/build/preloading/partitionHint.d.cts.map +1 -0
- package/build/preloading/partitionHint.d.mts +8 -0
- package/build/preloading/partitionHint.d.mts.map +1 -0
- package/build/preloading/partitionHint.js +36 -56
- package/build/preloading/partitionHint.js.map +1 -1
- package/build/queries/ConditionBuilder.cjs +106 -0
- package/build/queries/ConditionBuilder.cjs.map +1 -0
- package/build/queries/ConditionBuilder.d.cts +31 -0
- package/build/queries/ConditionBuilder.d.cts.map +1 -0
- package/build/queries/ConditionBuilder.d.mts +31 -0
- package/build/queries/ConditionBuilder.d.mts.map +1 -0
- package/build/queries/ConditionBuilder.js +105 -0
- package/build/queries/ConditionBuilder.js.map +1 -0
- package/build/queries/conditions.cjs +15 -0
- package/build/queries/conditions.cjs.map +1 -0
- package/build/queries/conditions.d.cts +38 -0
- package/build/queries/conditions.d.cts.map +1 -0
- package/build/queries/conditions.d.mts +38 -0
- package/build/queries/conditions.d.mts.map +1 -0
- package/build/queries/conditions.js +13 -0
- package/build/queries/conditions.js.map +1 -0
- package/build/queries/entityQueryUtils.cjs +60 -0
- package/build/queries/entityQueryUtils.cjs.map +1 -0
- package/build/queries/entityQueryUtils.d.cts +19 -0
- package/build/queries/entityQueryUtils.d.cts.map +1 -0
- package/build/queries/entityQueryUtils.d.mts +19 -0
- package/build/queries/entityQueryUtils.d.mts.map +1 -0
- package/build/queries/entityQueryUtils.js +56 -0
- package/build/queries/entityQueryUtils.js.map +1 -0
- package/build/queries/find/Aliases.cjs +301 -0
- package/build/queries/find/Aliases.cjs.map +1 -0
- package/build/queries/find/Aliases.d.cts +122 -0
- package/build/queries/find/Aliases.d.cts.map +1 -0
- package/build/queries/find/Aliases.d.mts +122 -0
- package/build/queries/find/Aliases.d.mts.map +1 -0
- package/build/queries/find/Aliases.js +293 -0
- package/build/queries/find/Aliases.js.map +1 -0
- package/build/queries/find/DeferredAlias.cjs +25 -0
- package/build/queries/find/DeferredAlias.cjs.map +1 -0
- package/build/queries/find/DeferredAlias.d.cts +22 -0
- package/build/queries/find/DeferredAlias.d.cts.map +1 -0
- package/build/queries/find/DeferredAlias.d.mts +22 -0
- package/build/queries/find/DeferredAlias.d.mts.map +1 -0
- package/build/queries/find/DeferredAlias.js +22 -0
- package/build/queries/find/DeferredAlias.js.map +1 -0
- package/build/queries/find/EntityFilter.cjs +27 -0
- package/build/queries/find/EntityFilter.cjs.map +1 -0
- package/build/queries/find/EntityFilter.d.cts +127 -0
- package/build/queries/find/EntityFilter.d.cts.map +1 -0
- package/build/queries/find/EntityFilter.d.mts +127 -0
- package/build/queries/find/EntityFilter.d.mts.map +1 -0
- package/build/queries/find/EntityFilter.js +26 -0
- package/build/queries/find/EntityFilter.js.map +1 -0
- package/build/queries/find/EntityGraphQLFilter.cjs +52 -0
- package/build/queries/find/EntityGraphQLFilter.cjs.map +1 -0
- package/build/queries/find/EntityGraphQLFilter.d.cts +59 -0
- package/build/queries/find/EntityGraphQLFilter.d.cts.map +1 -0
- package/build/queries/find/EntityGraphQLFilter.d.mts +59 -0
- package/build/queries/find/EntityGraphQLFilter.d.mts.map +1 -0
- package/build/queries/find/EntityGraphQLFilter.js +50 -0
- package/build/queries/find/EntityGraphQLFilter.js.map +1 -0
- package/build/queries/find/QueryParser.cjs +553 -0
- package/build/queries/find/QueryParser.cjs.map +1 -0
- package/build/queries/find/QueryParser.collectionJoins.cjs +353 -0
- package/build/queries/find/QueryParser.collectionJoins.cjs.map +1 -0
- package/build/queries/find/QueryParser.collectionJoins.d.cts +30 -0
- package/build/queries/find/QueryParser.collectionJoins.d.cts.map +1 -0
- package/build/queries/find/QueryParser.collectionJoins.d.mts +30 -0
- package/build/queries/find/QueryParser.collectionJoins.d.mts.map +1 -0
- package/build/queries/find/QueryParser.collectionJoins.js +352 -0
- package/build/queries/find/QueryParser.collectionJoins.js.map +1 -0
- package/build/queries/find/QueryParser.d.cts +192 -0
- package/build/queries/find/QueryParser.d.cts.map +1 -0
- package/build/queries/find/QueryParser.d.mts +192 -0
- package/build/queries/find/QueryParser.d.mts.map +1 -0
- package/build/queries/find/QueryParser.js +546 -0
- package/build/queries/find/QueryParser.js.map +1 -0
- package/build/queries/find/QueryParser.pruning.cjs +115 -0
- package/build/queries/find/QueryParser.pruning.cjs.map +1 -0
- package/build/queries/find/QueryParser.pruning.d.cts +8 -0
- package/build/queries/find/QueryParser.pruning.d.cts.map +1 -0
- package/build/queries/find/QueryParser.pruning.d.mts +8 -0
- package/build/queries/find/QueryParser.pruning.d.mts.map +1 -0
- package/build/queries/find/QueryParser.pruning.js +113 -0
- package/build/queries/find/QueryParser.pruning.js.map +1 -0
- package/build/queries/find/QueryVisitor.cjs +77 -0
- package/build/queries/find/QueryVisitor.cjs.map +1 -0
- package/build/queries/find/QueryVisitor.d.cts +24 -0
- package/build/queries/find/QueryVisitor.d.cts.map +1 -0
- package/build/queries/find/QueryVisitor.d.mts +24 -0
- package/build/queries/find/QueryVisitor.d.mts.map +1 -0
- package/build/queries/find/QueryVisitor.js +74 -0
- package/build/queries/find/QueryVisitor.js.map +1 -0
- package/build/queries/find/buildFindQuery.cjs +112 -0
- package/build/queries/find/buildFindQuery.cjs.map +1 -0
- package/build/queries/find/buildFindQuery.d.cts +24 -0
- package/build/queries/find/buildFindQuery.d.cts.map +1 -0
- package/build/queries/find/buildFindQuery.d.mts +24 -0
- package/build/queries/find/buildFindQuery.d.mts.map +1 -0
- package/build/queries/find/buildFindQuery.js +110 -0
- package/build/queries/find/buildFindQuery.js.map +1 -0
- package/build/queries/find/scopes.cjs +301 -0
- package/build/queries/find/scopes.cjs.map +1 -0
- package/build/queries/find/scopes.d.cts +188 -0
- package/build/queries/find/scopes.d.cts.map +1 -0
- package/build/queries/find/scopes.d.mts +188 -0
- package/build/queries/find/scopes.d.mts.map +1 -0
- package/build/queries/find/scopes.js +296 -0
- package/build/queries/find/scopes.js.map +1 -0
- package/build/queries/parsedConditions.cjs +21 -0
- package/build/queries/parsedConditions.cjs.map +1 -0
- package/build/queries/parsedConditions.d.cts +127 -0
- package/build/queries/parsedConditions.d.cts.map +1 -0
- package/build/queries/parsedConditions.d.mts +127 -0
- package/build/queries/parsedConditions.d.mts.map +1 -0
- package/build/queries/parsedConditions.js +20 -0
- package/build/queries/parsedConditions.js.map +1 -0
- package/build/queries/renderConditions.cjs +66 -0
- package/build/queries/renderConditions.cjs.map +1 -0
- package/build/queries/renderConditions.d.cts +15 -0
- package/build/queries/renderConditions.d.cts.map +1 -0
- package/build/queries/renderConditions.d.mts +15 -0
- package/build/queries/renderConditions.d.mts.map +1 -0
- package/build/queries/renderConditions.js +64 -0
- package/build/queries/renderConditions.js.map +1 -0
- package/build/queries/skipCondition.cjs +14 -0
- package/build/queries/skipCondition.cjs.map +1 -0
- package/build/queries/skipCondition.d.cts +7 -0
- package/build/queries/skipCondition.d.cts.map +1 -0
- package/build/queries/skipCondition.d.mts +7 -0
- package/build/queries/skipCondition.d.mts.map +1 -0
- package/build/queries/skipCondition.js +13 -0
- package/build/queries/skipCondition.js.map +1 -0
- package/build/queries/sql/AliasAssigner.cjs +35 -0
- package/build/queries/sql/AliasAssigner.cjs.map +1 -0
- package/build/queries/sql/AliasAssigner.d.cts +13 -0
- package/build/queries/sql/AliasAssigner.d.cts.map +1 -0
- package/build/queries/sql/AliasAssigner.d.mts +13 -0
- package/build/queries/sql/AliasAssigner.d.mts.map +1 -0
- package/build/queries/sql/AliasAssigner.js +34 -0
- package/build/queries/sql/AliasAssigner.js.map +1 -0
- package/build/queries/sql/Expr.cjs +529 -0
- package/build/queries/sql/Expr.cjs.map +1 -0
- package/build/queries/sql/Expr.d.cts +284 -0
- package/build/queries/sql/Expr.d.cts.map +1 -0
- package/build/queries/sql/Expr.d.mts +284 -0
- package/build/queries/sql/Expr.d.mts.map +1 -0
- package/build/queries/sql/Expr.js +512 -0
- package/build/queries/sql/Expr.js.map +1 -0
- package/build/queries/sql/JoinTree.cjs +72 -0
- package/build/queries/sql/JoinTree.cjs.map +1 -0
- package/build/queries/sql/JoinTree.d.cts +107 -0
- package/build/queries/sql/JoinTree.d.cts.map +1 -0
- package/build/queries/sql/JoinTree.d.mts +107 -0
- package/build/queries/sql/JoinTree.d.mts.map +1 -0
- package/build/queries/sql/JoinTree.js +71 -0
- package/build/queries/sql/JoinTree.js.map +1 -0
- package/build/queries/sql/Tables.cjs +803 -0
- package/build/queries/sql/Tables.cjs.map +1 -0
- package/build/queries/sql/Tables.d.cts +322 -0
- package/build/queries/sql/Tables.d.cts.map +1 -0
- package/build/queries/sql/Tables.d.mts +322 -0
- package/build/queries/sql/Tables.d.mts.map +1 -0
- package/build/queries/sql/Tables.js +786 -0
- package/build/queries/sql/Tables.js.map +1 -0
- package/build/queries/sql/custom.cjs +52 -0
- package/build/queries/sql/custom.cjs.map +1 -0
- package/build/queries/sql/custom.d.cts +85 -0
- package/build/queries/sql/custom.d.cts.map +1 -0
- package/build/queries/sql/custom.d.mts +85 -0
- package/build/queries/sql/custom.d.mts.map +1 -0
- package/build/queries/sql/custom.js +49 -0
- package/build/queries/sql/custom.js.map +1 -0
- package/build/queries/sql/execute.cjs +276 -0
- package/build/queries/sql/execute.cjs.map +1 -0
- package/build/queries/sql/execute.d.cts +294 -0
- package/build/queries/sql/execute.d.cts.map +1 -0
- package/build/queries/sql/execute.d.mts +294 -0
- package/build/queries/sql/execute.d.mts.map +1 -0
- package/build/queries/sql/execute.js +273 -0
- package/build/queries/sql/execute.js.map +1 -0
- package/build/queries/sql/expressions/arrayAgg.cjs +63 -0
- package/build/queries/sql/expressions/arrayAgg.cjs.map +1 -0
- package/build/queries/sql/expressions/arrayAgg.d.cts +24 -0
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -0
- package/build/queries/sql/expressions/arrayAgg.d.mts +24 -0
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -0
- package/build/queries/sql/expressions/arrayAgg.js +61 -0
- package/build/queries/sql/expressions/arrayAgg.js.map +1 -0
- package/build/queries/sql/expressions/case.cjs +71 -0
- package/build/queries/sql/expressions/case.cjs.map +1 -0
- package/build/queries/sql/expressions/case.d.cts +57 -0
- package/build/queries/sql/expressions/case.d.cts.map +1 -0
- package/build/queries/sql/expressions/case.d.mts +57 -0
- package/build/queries/sql/expressions/case.d.mts.map +1 -0
- package/build/queries/sql/expressions/case.js +68 -0
- package/build/queries/sql/expressions/case.js.map +1 -0
- package/build/queries/sql/expressions/coalesce.cjs +25 -0
- package/build/queries/sql/expressions/coalesce.cjs.map +1 -0
- package/build/queries/sql/expressions/coalesce.d.cts +21 -0
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -0
- package/build/queries/sql/expressions/coalesce.d.mts +21 -0
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -0
- package/build/queries/sql/expressions/coalesce.js +22 -0
- package/build/queries/sql/expressions/coalesce.js.map +1 -0
- package/build/queries/sql/expressions/codecs.cjs +126 -0
- package/build/queries/sql/expressions/codecs.cjs.map +1 -0
- package/build/queries/sql/expressions/codecs.d.cts +11 -0
- package/build/queries/sql/expressions/codecs.d.cts.map +1 -0
- package/build/queries/sql/expressions/codecs.d.mts +11 -0
- package/build/queries/sql/expressions/codecs.d.mts.map +1 -0
- package/build/queries/sql/expressions/codecs.js +125 -0
- package/build/queries/sql/expressions/codecs.js.map +1 -0
- package/build/queries/sql/expressions/expression.cjs +102 -0
- package/build/queries/sql/expressions/expression.cjs.map +1 -0
- package/build/queries/sql/expressions/expression.d.cts +23 -0
- package/build/queries/sql/expressions/expression.d.cts.map +1 -0
- package/build/queries/sql/expressions/expression.d.mts +23 -0
- package/build/queries/sql/expressions/expression.d.mts.map +1 -0
- package/build/queries/sql/expressions/expression.js +97 -0
- package/build/queries/sql/expressions/expression.js.map +1 -0
- package/build/queries/sql/expressions/greatest.cjs +25 -0
- package/build/queries/sql/expressions/greatest.cjs.map +1 -0
- package/build/queries/sql/expressions/greatest.d.cts +21 -0
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -0
- package/build/queries/sql/expressions/greatest.d.mts +21 -0
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -0
- package/build/queries/sql/expressions/greatest.js +22 -0
- package/build/queries/sql/expressions/greatest.js.map +1 -0
- package/build/queries/sql/expressions/least.cjs +25 -0
- package/build/queries/sql/expressions/least.cjs.map +1 -0
- package/build/queries/sql/expressions/least.d.cts +21 -0
- package/build/queries/sql/expressions/least.d.cts.map +1 -0
- package/build/queries/sql/expressions/least.d.mts +21 -0
- package/build/queries/sql/expressions/least.d.mts.map +1 -0
- package/build/queries/sql/expressions/least.js +22 -0
- package/build/queries/sql/expressions/least.js.map +1 -0
- package/build/queries/sql/expressions/nullIf.cjs +27 -0
- package/build/queries/sql/expressions/nullIf.cjs.map +1 -0
- package/build/queries/sql/expressions/nullIf.d.cts +22 -0
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -0
- package/build/queries/sql/expressions/nullIf.d.mts +22 -0
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -0
- package/build/queries/sql/expressions/nullIf.js +24 -0
- package/build/queries/sql/expressions/nullIf.js.map +1 -0
- package/build/queries/sql/expressions/parseExpression.cjs +75 -0
- package/build/queries/sql/expressions/parseExpression.cjs.map +1 -0
- package/build/queries/sql/expressions/parseExpression.d.cts +19 -0
- package/build/queries/sql/expressions/parseExpression.d.cts.map +1 -0
- package/build/queries/sql/expressions/parseExpression.d.mts +19 -0
- package/build/queries/sql/expressions/parseExpression.d.mts.map +1 -0
- package/build/queries/sql/expressions/parseExpression.js +70 -0
- package/build/queries/sql/expressions/parseExpression.js.map +1 -0
- package/build/queries/sql/expressions/types.cjs +1 -0
- package/build/queries/sql/expressions/types.d.cts +114 -0
- package/build/queries/sql/expressions/types.d.cts.map +1 -0
- package/build/queries/sql/expressions/types.d.mts +114 -0
- package/build/queries/sql/expressions/types.d.mts.map +1 -0
- package/build/queries/sql/expressions/types.js +1 -0
- package/build/queries/sql/keywords.cjs +136 -0
- package/build/queries/sql/keywords.cjs.map +1 -0
- package/build/queries/sql/keywords.d.cts +18 -0
- package/build/queries/sql/keywords.d.cts.map +1 -0
- package/build/queries/sql/keywords.d.mts +18 -0
- package/build/queries/sql/keywords.d.mts.map +1 -0
- package/build/queries/sql/keywords.js +132 -0
- package/build/queries/sql/keywords.js.map +1 -0
- package/build/queries/sql/query.cjs +1610 -0
- package/build/queries/sql/query.cjs.map +1 -0
- package/build/queries/sql/query.d.cts +844 -0
- package/build/queries/sql/query.d.cts.map +1 -0
- package/build/queries/sql/query.d.mts +844 -0
- package/build/queries/sql/query.d.mts.map +1 -0
- package/build/queries/sql/query.js +1592 -0
- package/build/queries/sql/query.js.map +1 -0
- package/build/queries/unnest.cjs +62 -0
- package/build/queries/unnest.cjs.map +1 -0
- package/build/queries/unnest.d.cts +16 -0
- package/build/queries/unnest.d.cts.map +1 -0
- package/build/queries/unnest.d.mts +16 -0
- package/build/queries/unnest.d.mts.map +1 -0
- package/build/queries/unnest.js +60 -0
- package/build/queries/unnest.js.map +1 -0
- package/build/queries/valueFilters.cjs +240 -0
- package/build/queries/valueFilters.cjs.map +1 -0
- package/build/queries/valueFilters.d.cts +26 -0
- package/build/queries/valueFilters.d.cts.map +1 -0
- package/build/queries/valueFilters.d.mts +26 -0
- package/build/queries/valueFilters.d.mts.map +1 -0
- package/build/queries/valueFilters.js +236 -0
- package/build/queries/valueFilters.js.map +1 -0
- package/build/reactivity/ReactionsManager.cjs +264 -0
- package/build/reactivity/ReactionsManager.cjs.map +1 -0
- package/build/reactivity/ReactionsManager.d.cts +98 -0
- package/build/reactivity/ReactionsManager.d.cts.map +1 -0
- package/build/reactivity/ReactionsManager.d.mts +98 -0
- package/build/reactivity/ReactionsManager.d.mts.map +1 -0
- package/build/reactivity/ReactionsManager.js +263 -0
- package/build/reactivity/ReactionsManager.js.map +1 -0
- package/build/reactivity/reactiveHints.cjs +328 -0
- package/build/reactivity/reactiveHints.cjs.map +1 -0
- package/build/reactivity/reactiveHints.d.cts +143 -0
- package/build/reactivity/reactiveHints.d.cts.map +1 -0
- package/build/reactivity/reactiveHints.d.mts +143 -0
- package/build/reactivity/reactiveHints.d.mts.map +1 -0
- package/build/reactivity/reactiveHints.js +321 -0
- package/build/reactivity/reactiveHints.js.map +1 -0
- package/build/relations/AbstractPropertyImpl.cjs +16 -0
- package/build/relations/AbstractPropertyImpl.cjs.map +1 -0
- package/build/relations/AbstractPropertyImpl.d.cts +11 -0
- package/build/relations/AbstractPropertyImpl.d.cts.map +1 -0
- package/build/relations/AbstractPropertyImpl.d.mts +11 -0
- package/build/relations/AbstractPropertyImpl.d.mts.map +1 -0
- package/build/relations/AbstractPropertyImpl.js +13 -13
- package/build/relations/AbstractPropertyImpl.js.map +1 -1
- package/build/relations/AbstractRelationImpl.cjs +15 -0
- package/build/relations/AbstractRelationImpl.cjs.map +1 -0
- package/build/relations/AbstractRelationImpl.d.cts +43 -0
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -0
- package/build/relations/AbstractRelationImpl.d.mts +43 -0
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -0
- package/build/relations/AbstractRelationImpl.js +12 -17
- package/build/relations/AbstractRelationImpl.js.map +1 -1
- package/build/relations/AsyncProperty.cjs +75 -0
- package/build/relations/AsyncProperty.cjs.map +1 -0
- package/build/relations/AsyncProperty.d.cts +40 -0
- package/build/relations/AsyncProperty.d.cts.map +1 -0
- package/build/relations/AsyncProperty.d.mts +40 -0
- package/build/relations/AsyncProperty.d.mts.map +1 -0
- package/build/relations/AsyncProperty.js +61 -70
- package/build/relations/AsyncProperty.js.map +1 -1
- package/build/relations/AsyncReactiveField.cjs +110 -0
- package/build/relations/AsyncReactiveField.cjs.map +1 -0
- package/build/relations/AsyncReactiveField.d.cts +50 -0
- package/build/relations/AsyncReactiveField.d.cts.map +1 -0
- package/build/relations/AsyncReactiveField.d.mts +50 -0
- package/build/relations/AsyncReactiveField.d.mts.map +1 -0
- package/build/relations/AsyncReactiveField.js +97 -116
- package/build/relations/AsyncReactiveField.js.map +1 -1
- package/build/relations/Collection.cjs +23 -0
- package/build/relations/Collection.cjs.map +1 -0
- package/build/relations/Collection.d.cts +37 -0
- package/build/relations/Collection.d.cts.map +1 -0
- package/build/relations/Collection.d.mts +37 -0
- package/build/relations/Collection.d.mts.map +1 -0
- package/build/relations/Collection.js +14 -11
- package/build/relations/Collection.js.map +1 -1
- package/build/relations/CustomCollection.cjs +144 -0
- package/build/relations/CustomCollection.cjs.map +1 -0
- package/build/relations/CustomCollection.d.cts +74 -0
- package/build/relations/CustomCollection.d.cts.map +1 -0
- package/build/relations/CustomCollection.d.mts +74 -0
- package/build/relations/CustomCollection.d.mts.map +1 -0
- package/build/relations/CustomCollection.js +138 -162
- package/build/relations/CustomCollection.js.map +1 -1
- package/build/relations/CustomReference.cjs +142 -0
- package/build/relations/CustomReference.cjs.map +1 -0
- package/build/relations/CustomReference.d.cts +76 -0
- package/build/relations/CustomReference.d.cts.map +1 -0
- package/build/relations/CustomReference.d.mts +76 -0
- package/build/relations/CustomReference.d.mts.map +1 -0
- package/build/relations/CustomReference.js +135 -147
- package/build/relations/CustomReference.js.map +1 -1
- package/build/relations/EnumCollection.cjs +178 -0
- package/build/relations/EnumCollection.cjs.map +1 -0
- package/build/relations/EnumCollection.d.cts +86 -0
- package/build/relations/EnumCollection.d.cts.map +1 -0
- package/build/relations/EnumCollection.d.mts +86 -0
- package/build/relations/EnumCollection.d.mts.map +1 -0
- package/build/relations/EnumCollection.js +172 -207
- package/build/relations/EnumCollection.js.map +1 -1
- package/build/relations/LargeCollection.cjs +4 -0
- package/build/relations/LargeCollection.d.cts +22 -0
- package/build/relations/LargeCollection.d.cts.map +1 -0
- package/build/relations/LargeCollection.d.mts +22 -0
- package/build/relations/LargeCollection.d.mts.map +1 -0
- package/build/relations/LargeCollection.js +4 -3
- package/build/relations/LazyField.cjs +140 -0
- package/build/relations/LazyField.cjs.map +1 -0
- package/build/relations/LazyField.d.cts +51 -0
- package/build/relations/LazyField.d.cts.map +1 -0
- package/build/relations/LazyField.d.mts +51 -0
- package/build/relations/LazyField.d.mts.map +1 -0
- package/build/relations/LazyField.js +134 -0
- package/build/relations/LazyField.js.map +1 -0
- package/build/relations/ManyToManyCollection.cjs +421 -0
- package/build/relations/ManyToManyCollection.cjs.map +1 -0
- package/build/relations/ManyToManyCollection.d.cts +59 -0
- package/build/relations/ManyToManyCollection.d.cts.map +1 -0
- package/build/relations/ManyToManyCollection.d.mts +59 -0
- package/build/relations/ManyToManyCollection.d.mts.map +1 -0
- package/build/relations/ManyToManyCollection.js +411 -471
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +91 -0
- package/build/relations/ManyToManyLargeCollection.cjs.map +1 -0
- package/build/relations/ManyToManyLargeCollection.d.cts +34 -0
- package/build/relations/ManyToManyLargeCollection.d.cts.map +1 -0
- package/build/relations/ManyToManyLargeCollection.d.mts +34 -0
- package/build/relations/ManyToManyLargeCollection.d.mts.map +1 -0
- package/build/relations/ManyToManyLargeCollection.js +85 -118
- package/build/relations/ManyToManyLargeCollection.js.map +1 -1
- package/build/relations/ManyToOneReference.cjs +364 -0
- package/build/relations/ManyToOneReference.cjs.map +1 -0
- package/build/relations/ManyToOneReference.d.cts +121 -0
- package/build/relations/ManyToOneReference.d.cts.map +1 -0
- package/build/relations/ManyToOneReference.d.mts +121 -0
- package/build/relations/ManyToOneReference.d.mts.map +1 -0
- package/build/relations/ManyToOneReference.js +344 -411
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +492 -0
- package/build/relations/OneToManyCollection.cjs.map +1 -0
- package/build/relations/OneToManyCollection.d.cts +69 -0
- package/build/relations/OneToManyCollection.d.cts.map +1 -0
- package/build/relations/OneToManyCollection.d.mts +69 -0
- package/build/relations/OneToManyCollection.d.mts.map +1 -0
- package/build/relations/OneToManyCollection.js +480 -579
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +85 -0
- package/build/relations/OneToManyLargeCollection.cjs.map +1 -0
- package/build/relations/OneToManyLargeCollection.d.cts +29 -0
- package/build/relations/OneToManyLargeCollection.d.cts.map +1 -0
- package/build/relations/OneToManyLargeCollection.d.mts +29 -0
- package/build/relations/OneToManyLargeCollection.d.mts.map +1 -0
- package/build/relations/OneToManyLargeCollection.js +79 -99
- package/build/relations/OneToManyLargeCollection.js.map +1 -1
- package/build/relations/OneToOneReference.cjs +209 -0
- package/build/relations/OneToOneReference.cjs.map +1 -0
- package/build/relations/OneToOneReference.d.cts +97 -0
- package/build/relations/OneToOneReference.d.cts.map +1 -0
- package/build/relations/OneToOneReference.d.mts +97 -0
- package/build/relations/OneToOneReference.d.mts.map +1 -0
- package/build/relations/OneToOneReference.js +193 -221
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +210 -0
- package/build/relations/PolymorphicReference.cjs.map +1 -0
- package/build/relations/PolymorphicReference.d.cts +93 -0
- package/build/relations/PolymorphicReference.d.cts.map +1 -0
- package/build/relations/PolymorphicReference.d.mts +93 -0
- package/build/relations/PolymorphicReference.d.mts.map +1 -0
- package/build/relations/PolymorphicReference.js +200 -237
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/PropertySymbols.cjs +7 -0
- package/build/relations/PropertySymbols.cjs.map +1 -0
- package/build/relations/PropertySymbols.d.cts +5 -0
- package/build/relations/PropertySymbols.d.cts.map +1 -0
- package/build/relations/PropertySymbols.d.mts +5 -0
- package/build/relations/PropertySymbols.d.mts.map +1 -0
- package/build/relations/PropertySymbols.js +6 -0
- package/build/relations/PropertySymbols.js.map +1 -0
- package/build/relations/ReactiveField.cjs +114 -0
- package/build/relations/ReactiveField.cjs.map +1 -0
- package/build/relations/ReactiveField.d.cts +88 -0
- package/build/relations/ReactiveField.d.cts.map +1 -0
- package/build/relations/ReactiveField.d.mts +88 -0
- package/build/relations/ReactiveField.d.mts.map +1 -0
- package/build/relations/ReactiveField.js +104 -137
- package/build/relations/ReactiveField.js.map +1 -1
- package/build/relations/ReactiveGetter.cjs +40 -0
- package/build/relations/ReactiveGetter.cjs.map +1 -0
- package/build/relations/ReactiveGetter.d.cts +33 -0
- package/build/relations/ReactiveGetter.d.cts.map +1 -0
- package/build/relations/ReactiveGetter.d.mts +33 -0
- package/build/relations/ReactiveGetter.d.mts.map +1 -0
- package/build/relations/ReactiveGetter.js +30 -31
- package/build/relations/ReactiveGetter.js.map +1 -1
- package/build/relations/ReactiveManyToMany.cjs +198 -0
- package/build/relations/ReactiveManyToMany.cjs.map +1 -0
- package/build/relations/ReactiveManyToMany.d.cts +63 -0
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -0
- package/build/relations/ReactiveManyToMany.d.mts +63 -0
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -0
- package/build/relations/ReactiveManyToMany.js +187 -238
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +148 -0
- package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.cts +53 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.cts.map +1 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.mts +53 -0
- package/build/relations/ReactiveManyToManyOtherSide.d.mts.map +1 -0
- package/build/relations/ReactiveManyToManyOtherSide.js +139 -152
- package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
- package/build/relations/ReactiveReference.cjs +336 -0
- package/build/relations/ReactiveReference.cjs.map +1 -0
- package/build/relations/ReactiveReference.d.cts +124 -0
- package/build/relations/ReactiveReference.d.cts.map +1 -0
- package/build/relations/ReactiveReference.d.mts +124 -0
- package/build/relations/ReactiveReference.d.mts.map +1 -0
- package/build/relations/ReactiveReference.js +321 -385
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/ReadOnlyCollection.cjs +18 -0
- package/build/relations/ReadOnlyCollection.cjs.map +1 -0
- package/build/relations/ReadOnlyCollection.d.cts +22 -0
- package/build/relations/ReadOnlyCollection.d.cts.map +1 -0
- package/build/relations/ReadOnlyCollection.d.mts +22 -0
- package/build/relations/ReadOnlyCollection.d.mts.map +1 -0
- package/build/relations/ReadOnlyCollection.js +9 -9
- package/build/relations/ReadOnlyCollection.js.map +1 -1
- package/build/relations/RecursiveCollection.cjs +386 -0
- package/build/relations/RecursiveCollection.cjs.map +1 -0
- package/build/relations/RecursiveCollection.d.cts +112 -0
- package/build/relations/RecursiveCollection.d.cts.map +1 -0
- package/build/relations/RecursiveCollection.d.mts +112 -0
- package/build/relations/RecursiveCollection.d.mts.map +1 -0
- package/build/relations/RecursiveCollection.js +367 -427
- package/build/relations/RecursiveCollection.js.map +1 -1
- package/build/relations/RecursiveCycleError.cjs +17 -0
- package/build/relations/RecursiveCycleError.cjs.map +1 -0
- package/build/relations/RecursiveCycleError.d.cts +15 -0
- package/build/relations/RecursiveCycleError.d.cts.map +1 -0
- package/build/relations/RecursiveCycleError.d.mts +15 -0
- package/build/relations/RecursiveCycleError.d.mts.map +1 -0
- package/build/relations/RecursiveCycleError.js +14 -13
- package/build/relations/RecursiveCycleError.js.map +1 -1
- package/build/relations/Reference.cjs +25 -0
- package/build/relations/Reference.cjs.map +1 -0
- package/build/relations/Reference.d.cts +39 -0
- package/build/relations/Reference.d.cts.map +1 -0
- package/build/relations/Reference.d.mts +39 -0
- package/build/relations/Reference.d.mts.map +1 -0
- package/build/relations/Reference.js +15 -14
- package/build/relations/Reference.js.map +1 -1
- package/build/relations/ReferenceSymbols.cjs +7 -0
- package/build/relations/ReferenceSymbols.cjs.map +1 -0
- package/build/relations/ReferenceSymbols.d.cts +5 -0
- package/build/relations/ReferenceSymbols.d.cts.map +1 -0
- package/build/relations/ReferenceSymbols.d.mts +5 -0
- package/build/relations/ReferenceSymbols.d.mts.map +1 -0
- package/build/relations/ReferenceSymbols.js +6 -0
- package/build/relations/ReferenceSymbols.js.map +1 -0
- package/build/relations/Relation.cjs +17 -0
- package/build/relations/Relation.cjs.map +1 -0
- package/build/relations/Relation.d.cts +16 -0
- package/build/relations/Relation.d.cts.map +1 -0
- package/build/relations/Relation.d.mts +16 -0
- package/build/relations/Relation.d.mts.map +1 -0
- package/build/relations/Relation.js +10 -8
- package/build/relations/Relation.js.map +1 -1
- package/build/relations/RelationSymbols.cjs +9 -0
- package/build/relations/RelationSymbols.cjs.map +1 -0
- package/build/relations/RelationSymbols.d.cts +6 -0
- package/build/relations/RelationSymbols.d.cts.map +1 -0
- package/build/relations/RelationSymbols.d.mts +6 -0
- package/build/relations/RelationSymbols.d.mts.map +1 -0
- package/build/relations/RelationSymbols.js +7 -0
- package/build/relations/RelationSymbols.js.map +1 -0
- package/build/relations/hasAsyncMethod.cjs +47 -0
- package/build/relations/hasAsyncMethod.cjs.map +1 -0
- package/build/relations/hasAsyncMethod.d.cts +29 -0
- package/build/relations/hasAsyncMethod.d.cts.map +1 -0
- package/build/relations/hasAsyncMethod.d.mts +29 -0
- package/build/relations/hasAsyncMethod.d.mts.map +1 -0
- package/build/relations/hasAsyncMethod.js +40 -43
- package/build/relations/hasAsyncMethod.js.map +1 -1
- package/build/relations/hasManyDerived.cjs +35 -0
- package/build/relations/hasManyDerived.cjs.map +1 -0
- package/build/relations/hasManyDerived.d.cts +25 -0
- package/build/relations/hasManyDerived.d.cts.map +1 -0
- package/build/relations/hasManyDerived.d.mts +25 -0
- package/build/relations/hasManyDerived.d.mts.map +1 -0
- package/build/relations/hasManyDerived.js +30 -28
- package/build/relations/hasManyDerived.js.map +1 -1
- package/build/relations/hasManyThrough.cjs +29 -0
- package/build/relations/hasManyThrough.cjs.map +1 -0
- package/build/relations/hasManyThrough.d.cts +16 -0
- package/build/relations/hasManyThrough.d.cts.map +1 -0
- package/build/relations/hasManyThrough.d.mts +16 -0
- package/build/relations/hasManyThrough.d.mts.map +1 -0
- package/build/relations/hasManyThrough.js +24 -20
- package/build/relations/hasManyThrough.js.map +1 -1
- package/build/relations/hasOneDerived.cjs +32 -0
- package/build/relations/hasOneDerived.cjs.map +1 -0
- package/build/relations/hasOneDerived.d.cts +15 -0
- package/build/relations/hasOneDerived.d.cts.map +1 -0
- package/build/relations/hasOneDerived.d.mts +15 -0
- package/build/relations/hasOneDerived.d.mts.map +1 -0
- package/build/relations/hasOneDerived.js +27 -20
- package/build/relations/hasOneDerived.js.map +1 -1
- package/build/relations/hasOneThrough.cjs +31 -0
- package/build/relations/hasOneThrough.cjs.map +1 -0
- package/build/relations/hasOneThrough.d.cts +16 -0
- package/build/relations/hasOneThrough.d.cts.map +1 -0
- package/build/relations/hasOneThrough.d.mts +16 -0
- package/build/relations/hasOneThrough.d.mts.map +1 -0
- package/build/relations/hasOneThrough.js +26 -22
- package/build/relations/hasOneThrough.js.map +1 -1
- package/build/relations/hasProperty.cjs +109 -0
- package/build/relations/hasProperty.cjs.map +1 -0
- package/build/relations/hasProperty.d.cts +53 -0
- package/build/relations/hasProperty.d.cts.map +1 -0
- package/build/relations/hasProperty.d.mts +53 -0
- package/build/relations/hasProperty.d.mts.map +1 -0
- package/build/relations/hasProperty.js +90 -95
- package/build/relations/hasProperty.js.map +1 -1
- package/build/relations/index.cjs +99 -0
- package/build/relations/index.d.cts +32 -0
- package/build/relations/index.d.mts +32 -0
- package/build/relations/index.js +31 -97
- package/build/relations/isCascadeDelete.cjs +11 -0
- package/build/relations/isCascadeDelete.cjs.map +1 -0
- package/build/relations/isCascadeDelete.d.cts +7 -0
- package/build/relations/isCascadeDelete.d.cts.map +1 -0
- package/build/relations/isCascadeDelete.d.mts +7 -0
- package/build/relations/isCascadeDelete.d.mts.map +1 -0
- package/build/relations/isCascadeDelete.js +10 -0
- package/build/relations/isCascadeDelete.js.map +1 -0
- package/build/resurrection.cjs +74 -0
- package/build/resurrection.cjs.map +1 -0
- package/build/resurrection.d.cts +13 -0
- package/build/resurrection.d.cts.map +1 -0
- package/build/resurrection.d.mts +13 -0
- package/build/resurrection.d.mts.map +1 -0
- package/build/resurrection.js +48 -69
- package/build/resurrection.js.map +1 -1
- package/build/rules.cjs +227 -0
- package/build/rules.cjs.map +1 -0
- package/build/rules.d.cts +145 -0
- package/build/rules.d.cts.map +1 -0
- package/build/rules.d.mts +145 -0
- package/build/rules.d.mts.map +1 -0
- package/build/rules.js +189 -204
- package/build/rules.js.map +1 -1
- package/build/runtimeConfig.cjs +25 -0
- package/build/runtimeConfig.cjs.map +1 -0
- package/build/runtimeConfig.d.cts +24 -0
- package/build/runtimeConfig.d.cts.map +1 -0
- package/build/runtimeConfig.d.mts +24 -0
- package/build/runtimeConfig.d.mts.map +1 -0
- package/build/runtimeConfig.js +16 -12
- package/build/runtimeConfig.js.map +1 -1
- package/build/serde/TypeInfo.cjs +80 -0
- package/build/serde/TypeInfo.cjs.map +1 -0
- package/build/serde/TypeInfo.d.cts +57 -0
- package/build/serde/TypeInfo.d.cts.map +1 -0
- package/build/serde/TypeInfo.d.mts +57 -0
- package/build/serde/TypeInfo.d.mts.map +1 -0
- package/build/serde/TypeInfo.js +78 -0
- package/build/serde/TypeInfo.js.map +1 -0
- package/build/serde/columns.cjs +63 -0
- package/build/serde/columns.cjs.map +1 -0
- package/build/serde/columns.d.cts +38 -0
- package/build/serde/columns.d.cts.map +1 -0
- package/build/serde/columns.d.mts +38 -0
- package/build/serde/columns.d.mts.map +1 -0
- package/build/serde/columns.js +62 -0
- package/build/serde/columns.js.map +1 -0
- package/build/serde/fieldSerde.cjs +188 -0
- package/build/serde/fieldSerde.cjs.map +1 -0
- package/build/serde/fieldSerde.d.cts +87 -0
- package/build/serde/fieldSerde.d.cts.map +1 -0
- package/build/serde/fieldSerde.d.mts +87 -0
- package/build/serde/fieldSerde.d.mts.map +1 -0
- package/build/serde/fieldSerde.js +182 -0
- package/build/serde/fieldSerde.js.map +1 -0
- package/build/serde/serde.cjs +499 -0
- package/build/serde/serde.cjs.map +1 -0
- package/build/serde/serde.d.cts +248 -0
- package/build/serde/serde.d.cts.map +1 -0
- package/build/serde/serde.d.mts +248 -0
- package/build/serde/serde.d.mts.map +1 -0
- package/build/serde/serde.js +485 -0
- package/build/serde/serde.js.map +1 -0
- package/build/serde/temporal.cjs +57 -0
- package/build/serde/temporal.cjs.map +1 -0
- package/build/serde/temporal.d.cts +44 -0
- package/build/serde/temporal.d.cts.map +1 -0
- package/build/serde/temporal.d.mts +44 -0
- package/build/serde/temporal.d.mts.map +1 -0
- package/build/serde/temporal.js +55 -0
- package/build/serde/temporal.js.map +1 -0
- package/build/serde/temporalMappers.cjs +62 -0
- package/build/serde/temporalMappers.cjs.map +1 -0
- package/build/serde/temporalMappers.d.cts +36 -0
- package/build/serde/temporalMappers.d.cts.map +1 -0
- package/build/serde/temporalMappers.d.mts +36 -0
- package/build/serde/temporalMappers.d.mts.map +1 -0
- package/build/serde/temporalMappers.js +58 -0
- package/build/serde/temporalMappers.js.map +1 -0
- package/build/trusted.cjs +16 -0
- package/build/trusted.cjs.map +1 -0
- package/build/trusted.d.cts +8 -0
- package/build/trusted.d.cts.map +1 -0
- package/build/trusted.d.mts +8 -0
- package/build/trusted.d.mts.map +1 -0
- package/build/trusted.js +8 -8
- package/build/trusted.js.map +1 -1
- package/build/typeMap.cjs +3 -0
- package/build/typeMap.d.cts +88 -0
- package/build/typeMap.d.cts.map +1 -0
- package/build/typeMap.d.mts +88 -0
- package/build/typeMap.d.mts.map +1 -0
- package/build/typeMap.js +3 -3
- package/build/upsert.cjs +175 -0
- package/build/upsert.cjs.map +1 -0
- package/build/upsert.d.cts +42 -0
- package/build/upsert.d.cts.map +1 -0
- package/build/upsert.d.mts +42 -0
- package/build/upsert.d.mts.map +1 -0
- package/build/upsert.js +159 -274
- package/build/upsert.js.map +1 -1
- package/build/utils.cjs +204 -0
- package/build/utils.cjs.map +1 -0
- package/build/utils.d.cts +65 -0
- package/build/utils.d.cts.map +1 -0
- package/build/utils.d.mts +65 -0
- package/build/utils.d.mts.map +1 -0
- package/build/utils.js +123 -192
- package/build/utils.js.map +1 -1
- package/package.json +34 -14
- package/build/AliasAssigner.d.ts +0 -10
- package/build/AliasAssigner.d.ts.map +0 -1
- package/build/AliasAssigner.js +0 -39
- package/build/AliasAssigner.js.map +0 -1
- package/build/Aliases.d.ts +0 -117
- package/build/Aliases.d.ts.map +0 -1
- package/build/Aliases.js +0 -457
- package/build/Aliases.js.map +0 -1
- package/build/BaseEntity.d.ts +0 -68
- package/build/BaseEntity.d.ts.map +0 -1
- package/build/ConditionBuilder.d.ts +0 -29
- package/build/ConditionBuilder.d.ts.map +0 -1
- package/build/ConditionBuilder.js +0 -112
- package/build/ConditionBuilder.js.map +0 -1
- package/build/Entity.d.ts +0 -39
- package/build/Entity.d.ts.map +0 -1
- package/build/EntityFields.d.ts +0 -37
- package/build/EntityFields.d.ts.map +0 -1
- package/build/EntityFields.js.map +0 -1
- package/build/EntityFilter.d.ts +0 -134
- package/build/EntityFilter.d.ts.map +0 -1
- package/build/EntityFilter.js +0 -21
- package/build/EntityFilter.js.map +0 -1
- package/build/EntityGraphQLFilter.d.ts +0 -56
- package/build/EntityGraphQLFilter.d.ts.map +0 -1
- package/build/EntityGraphQLFilter.js +0 -53
- package/build/EntityGraphQLFilter.js.map +0 -1
- package/build/EntityManager.d.ts +0 -740
- package/build/EntityManager.d.ts.map +0 -1
- package/build/EntityMetadata.d.ts +0 -233
- package/build/EntityMetadata.d.ts.map +0 -1
- package/build/EnumMetadata.d.ts +0 -15
- package/build/EnumMetadata.d.ts.map +0 -1
- package/build/EnumMetadata.js.map +0 -1
- package/build/FlushLock.d.ts +0 -26
- package/build/FlushLock.d.ts.map +0 -1
- package/build/FlushLock.js +0 -57
- package/build/FlushLock.js.map +0 -1
- package/build/HintTree.d.ts +0 -42
- package/build/HintTree.d.ts.map +0 -1
- package/build/HintTree.js +0 -64
- package/build/HintTree.js.map +0 -1
- package/build/IndexManager.d.ts +0 -31
- package/build/IndexManager.d.ts.map +0 -1
- package/build/InstanceData.d.ts +0 -79
- package/build/InstanceData.d.ts.map +0 -1
- package/build/IsLoadedCache.d.ts +0 -32
- package/build/IsLoadedCache.d.ts.map +0 -1
- package/build/IsLoadedCache.js +0 -91
- package/build/IsLoadedCache.js.map +0 -1
- package/build/JoinRows.d.ts +0 -117
- package/build/JoinRows.d.ts.map +0 -1
- package/build/JoinRows.js +0 -320
- package/build/JoinRows.js.map +0 -1
- package/build/PendingChanges.d.ts +0 -26
- package/build/PendingChanges.d.ts.map +0 -1
- package/build/PendingChanges.js +0 -3
- package/build/PendingChanges.js.map +0 -1
- package/build/PluginManager.d.ts +0 -102
- package/build/PluginManager.d.ts.map +0 -1
- package/build/QueryParser.collectionJoins.d.ts +0 -27
- package/build/QueryParser.collectionJoins.d.ts.map +0 -1
- package/build/QueryParser.collectionJoins.js +0 -466
- package/build/QueryParser.collectionJoins.js.map +0 -1
- package/build/QueryParser.collectionJoins.test.d.ts +0 -2
- package/build/QueryParser.collectionJoins.test.d.ts.map +0 -1
- package/build/QueryParser.collectionJoins.test.js +0 -772
- package/build/QueryParser.collectionJoins.test.js.map +0 -1
- package/build/QueryParser.d.ts +0 -336
- package/build/QueryParser.d.ts.map +0 -1
- package/build/QueryParser.js +0 -965
- package/build/QueryParser.js.map +0 -1
- package/build/QueryParser.pruning.d.ts +0 -7
- package/build/QueryParser.pruning.d.ts.map +0 -1
- package/build/QueryParser.pruning.js +0 -195
- package/build/QueryParser.pruning.js.map +0 -1
- package/build/QueryParser.pruning.test.d.ts +0 -2
- package/build/QueryParser.pruning.test.d.ts.map +0 -1
- package/build/QueryParser.pruning.test.js +0 -106
- package/build/QueryParser.pruning.test.js.map +0 -1
- package/build/QueryParser.test.d.ts +0 -2
- package/build/QueryParser.test.d.ts.map +0 -1
- package/build/QueryParser.test.js +0 -27
- package/build/QueryParser.test.js.map +0 -1
- package/build/QueryVisitor.d.ts +0 -19
- package/build/QueryVisitor.d.ts.map +0 -1
- package/build/QueryVisitor.js +0 -106
- package/build/QueryVisitor.js.map +0 -1
- package/build/ReactionsManager.d.ts +0 -85
- package/build/ReactionsManager.d.ts.map +0 -1
- package/build/ReactionsManager.js +0 -315
- package/build/ReactionsManager.js.map +0 -1
- package/build/Todo.d.ts +0 -35
- package/build/Todo.d.ts.map +0 -1
- package/build/Todo.js +0 -73
- package/build/Todo.js.map +0 -1
- package/build/batchloaders/BatchLoader.d.ts +0 -14
- package/build/batchloaders/BatchLoader.d.ts.map +0 -1
- package/build/batchloaders/enumCollectionBatchLoader.d.ts +0 -7
- package/build/batchloaders/enumCollectionBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/loadBatchLoader.d.ts +0 -17
- package/build/batchloaders/loadBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/manyToManyBatchLoader.d.ts +0 -7
- package/build/batchloaders/manyToManyBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/oneToManyBatchLoader.d.ts +0 -7
- package/build/batchloaders/oneToManyBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/oneToOneBatchLoader.d.ts +0 -7
- package/build/batchloaders/oneToOneBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/populateBatchLoader.d.ts +0 -13
- package/build/batchloaders/populateBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.d.ts +0 -7
- package/build/batchloaders/recursiveChildrenBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/recursiveM2mBatchLoader.d.ts +0 -7
- package/build/batchloaders/recursiveM2mBatchLoader.d.ts.map +0 -1
- package/build/batchloaders/recursiveParentsBatchLoader.d.ts +0 -7
- package/build/batchloaders/recursiveParentsBatchLoader.d.ts.map +0 -1
- package/build/changes.d.ts +0 -92
- package/build/changes.d.ts.map +0 -1
- package/build/config.d.ts +0 -250
- package/build/config.d.ts.map +0 -1
- package/build/config.test.d.ts +0 -2
- package/build/config.test.d.ts.map +0 -1
- package/build/config.test.js +0 -53
- package/build/config.test.js.map +0 -1
- package/build/configure.d.ts +0 -15
- package/build/configure.d.ts.map +0 -1
- package/build/dataloaders/fastWhereFilterHash.d.ts +0 -15
- package/build/dataloaders/fastWhereFilterHash.d.ts.map +0 -1
- package/build/dataloaders/fastWhereFilterHash.test.d.ts +0 -2
- package/build/dataloaders/fastWhereFilterHash.test.d.ts.map +0 -1
- package/build/dataloaders/fastWhereFilterHash.test.js +0 -59
- package/build/dataloaders/fastWhereFilterHash.test.js.map +0 -1
- package/build/dataloaders/findByUniqueDataLoader.d.ts +0 -7
- package/build/dataloaders/findByUniqueDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findCountDataLoader.d.ts +0 -16
- package/build/dataloaders/findCountDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findDataLoader.d.ts +0 -76
- package/build/dataloaders/findDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findIdsDataLoader.d.ts +0 -6
- package/build/dataloaders/findIdsDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findOrCreateDataLoader.d.ts +0 -13
- package/build/dataloaders/findOrCreateDataLoader.d.ts.map +0 -1
- package/build/dataloaders/findPaginatedDataLoader.d.ts +0 -7
- package/build/dataloaders/findPaginatedDataLoader.d.ts.map +0 -1
- package/build/dataloaders/lensDataLoader.d.ts +0 -12
- package/build/dataloaders/lensDataLoader.d.ts.map +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.ts +0 -8
- package/build/dataloaders/manyToManyFindDataLoader.d.ts.map +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.ts +0 -8
- package/build/dataloaders/oneToManyFindDataLoader.d.ts.map +0 -1
- package/build/defaults.d.ts +0 -54
- package/build/defaults.d.ts.map +0 -1
- package/build/driverApi.d.ts +0 -19
- package/build/driverApi.d.ts.map +0 -1
- package/build/driverApi.js +0 -17
- package/build/driverApi.js.map +0 -1
- package/build/drivers/Driver.d.ts +0 -26
- package/build/drivers/Driver.d.ts.map +0 -1
- package/build/drivers/Driver.js.map +0 -1
- package/build/drivers/EntityWriter.d.ts +0 -64
- package/build/drivers/EntityWriter.d.ts.map +0 -1
- package/build/drivers/IdAssigner.d.ts +0 -48
- package/build/drivers/IdAssigner.d.ts.map +0 -1
- package/build/drivers/buildRawQuery.d.ts +0 -22
- package/build/drivers/buildRawQuery.d.ts.map +0 -1
- package/build/drivers/buildRawQuery.js +0 -153
- package/build/drivers/buildRawQuery.js.map +0 -1
- package/build/drivers/buildUtils.d.ts +0 -9
- package/build/drivers/buildUtils.d.ts.map +0 -1
- package/build/drivers/buildUtils.js +0 -88
- package/build/drivers/buildUtils.js.map +0 -1
- package/build/drivers/index.d.ts +0 -6
- package/build/drivers/index.d.ts.map +0 -1
- package/build/drivers/index.js.map +0 -1
- package/build/fields.d.ts +0 -26
- package/build/fields.d.ts.map +0 -1
- package/build/getProperties.d.ts +0 -28
- package/build/getProperties.d.ts.map +0 -1
- package/build/index.d.ts +0 -133
- package/build/index.d.ts.map +0 -1
- package/build/json.d.ts +0 -77
- package/build/json.d.ts.map +0 -1
- package/build/k.d.ts +0 -2
- package/build/k.d.ts.map +0 -1
- package/build/keys.d.ts +0 -49
- package/build/keys.d.ts.map +0 -1
- package/build/keywords.d.ts +0 -5
- package/build/keywords.d.ts.map +0 -1
- package/build/keywords.js +0 -124
- package/build/keywords.js.map +0 -1
- package/build/loadHints.d.ts +0 -121
- package/build/loadHints.d.ts.map +0 -1
- package/build/loadHints.js +0 -129
- package/build/loadHints.js.map +0 -1
- package/build/loadLens.d.ts +0 -77
- package/build/loadLens.d.ts.map +0 -1
- package/build/loadLens.js +0 -320
- package/build/loadLens.js.map +0 -1
- package/build/logging/FactoryLogger.d.ts +0 -24
- package/build/logging/FactoryLogger.d.ts.map +0 -1
- package/build/logging/FieldLogger.d.ts +0 -27
- package/build/logging/FieldLogger.d.ts.map +0 -1
- package/build/logging/ReactionLogger.d.ts +0 -27
- package/build/logging/ReactionLogger.d.ts.map +0 -1
- package/build/newEntity.d.ts +0 -45
- package/build/newEntity.d.ts.map +0 -1
- package/build/newTestInstance.d.ts +0 -208
- package/build/newTestInstance.d.ts.map +0 -1
- package/build/normalizeHints.d.ts +0 -23
- package/build/normalizeHints.d.ts.map +0 -1
- package/build/plugins/ImmutableEntitiesPlugin.d.ts +0 -9
- package/build/plugins/ImmutableEntitiesPlugin.d.ts.map +0 -1
- package/build/plugins/PreloadPlugin.d.ts +0 -69
- package/build/plugins/PreloadPlugin.d.ts.map +0 -1
- package/build/plugins/PreloadPlugin.js.map +0 -1
- package/build/preloading/JsonAggregatePreloader.d.ts +0 -16
- package/build/preloading/JsonAggregatePreloader.d.ts.map +0 -1
- package/build/preloading/canPreload.d.ts +0 -3
- package/build/preloading/canPreload.d.ts.map +0 -1
- package/build/preloading/partitionHint.d.ts +0 -5
- package/build/preloading/partitionHint.d.ts.map +0 -1
- package/build/reactiveHints.d.ts +0 -146
- package/build/reactiveHints.d.ts.map +0 -1
- package/build/reactiveHints.js +0 -509
- package/build/reactiveHints.js.map +0 -1
- package/build/relations/AbstractPropertyImpl.d.ts +0 -8
- package/build/relations/AbstractPropertyImpl.d.ts.map +0 -1
- package/build/relations/AbstractRelationImpl.d.ts +0 -41
- package/build/relations/AbstractRelationImpl.d.ts.map +0 -1
- package/build/relations/AsyncProperty.d.ts +0 -36
- package/build/relations/AsyncProperty.d.ts.map +0 -1
- package/build/relations/AsyncReactiveField.d.ts +0 -41
- package/build/relations/AsyncReactiveField.d.ts.map +0 -1
- package/build/relations/Collection.d.ts +0 -33
- package/build/relations/Collection.d.ts.map +0 -1
- package/build/relations/CustomCollection.d.ts +0 -69
- package/build/relations/CustomCollection.d.ts.map +0 -1
- package/build/relations/CustomReference.d.ts +0 -71
- package/build/relations/CustomReference.d.ts.map +0 -1
- package/build/relations/EnumCollection.d.ts +0 -81
- package/build/relations/EnumCollection.d.ts.map +0 -1
- package/build/relations/LargeCollection.d.ts +0 -19
- package/build/relations/LargeCollection.d.ts.map +0 -1
- package/build/relations/LargeCollection.js.map +0 -1
- package/build/relations/ManyToManyCollection.d.ts +0 -52
- package/build/relations/ManyToManyCollection.d.ts.map +0 -1
- package/build/relations/ManyToManyLargeCollection.d.ts +0 -31
- package/build/relations/ManyToManyLargeCollection.d.ts.map +0 -1
- package/build/relations/ManyToOneReference.d.ts +0 -117
- package/build/relations/ManyToOneReference.d.ts.map +0 -1
- package/build/relations/OneToManyCollection.d.ts +0 -62
- package/build/relations/OneToManyCollection.d.ts.map +0 -1
- package/build/relations/OneToManyLargeCollection.d.ts +0 -26
- package/build/relations/OneToManyLargeCollection.d.ts.map +0 -1
- package/build/relations/OneToOneReference.d.ts +0 -93
- package/build/relations/OneToOneReference.d.ts.map +0 -1
- package/build/relations/PolymorphicReference.d.ts +0 -89
- package/build/relations/PolymorphicReference.d.ts.map +0 -1
- package/build/relations/ReactiveField.d.ts +0 -85
- package/build/relations/ReactiveField.d.ts.map +0 -1
- package/build/relations/ReactiveGetter.d.ts +0 -30
- package/build/relations/ReactiveGetter.d.ts.map +0 -1
- package/build/relations/ReactiveManyToMany.d.ts +0 -57
- package/build/relations/ReactiveManyToMany.d.ts.map +0 -1
- package/build/relations/ReactiveManyToManyOtherSide.d.ts +0 -48
- package/build/relations/ReactiveManyToManyOtherSide.d.ts.map +0 -1
- package/build/relations/ReactiveReference.d.ts +0 -119
- package/build/relations/ReactiveReference.d.ts.map +0 -1
- package/build/relations/ReadOnlyCollection.d.ts +0 -19
- package/build/relations/ReadOnlyCollection.d.ts.map +0 -1
- package/build/relations/RecursiveCollection.d.ts +0 -108
- package/build/relations/RecursiveCollection.d.ts.map +0 -1
- package/build/relations/RecursiveCycleError.d.ts +0 -13
- package/build/relations/RecursiveCycleError.d.ts.map +0 -1
- package/build/relations/Reference.d.ts +0 -35
- package/build/relations/Reference.d.ts.map +0 -1
- package/build/relations/Relation.d.ts +0 -14
- package/build/relations/Relation.d.ts.map +0 -1
- package/build/relations/hasAsyncMethod.d.ts +0 -27
- package/build/relations/hasAsyncMethod.d.ts.map +0 -1
- package/build/relations/hasManyDerived.d.ts +0 -22
- package/build/relations/hasManyDerived.d.ts.map +0 -1
- package/build/relations/hasManyThrough.d.ts +0 -10
- package/build/relations/hasManyThrough.d.ts.map +0 -1
- package/build/relations/hasOneDerived.d.ts +0 -12
- package/build/relations/hasOneDerived.d.ts.map +0 -1
- package/build/relations/hasOneThrough.d.ts +0 -10
- package/build/relations/hasOneThrough.d.ts.map +0 -1
- package/build/relations/hasProperty.d.ts +0 -50
- package/build/relations/hasProperty.d.ts.map +0 -1
- package/build/relations/index.d.ts +0 -30
- package/build/relations/index.d.ts.map +0 -1
- package/build/relations/index.js.map +0 -1
- package/build/resurrection.d.ts +0 -10
- package/build/resurrection.d.ts.map +0 -1
- package/build/rules.d.ts +0 -123
- package/build/rules.d.ts.map +0 -1
- package/build/runtimeConfig.d.ts +0 -17
- package/build/runtimeConfig.d.ts.map +0 -1
- package/build/scopes.d.ts +0 -185
- package/build/scopes.d.ts.map +0 -1
- package/build/scopes.js +0 -302
- package/build/scopes.js.map +0 -1
- package/build/serde.d.ts +0 -277
- package/build/serde.d.ts.map +0 -1
- package/build/serde.js +0 -517
- package/build/serde.js.map +0 -1
- package/build/temporal.d.ts +0 -46
- package/build/temporal.d.ts.map +0 -1
- package/build/temporal.js +0 -66
- package/build/temporal.js.map +0 -1
- package/build/temporalMappers.d.ts +0 -25
- package/build/temporalMappers.d.ts.map +0 -1
- package/build/temporalMappers.js +0 -59
- package/build/temporalMappers.js.map +0 -1
- package/build/trusted.d.ts +0 -5
- package/build/trusted.d.ts.map +0 -1
- package/build/typeMap.d.ts +0 -68
- package/build/typeMap.d.ts.map +0 -1
- package/build/typeMap.js.map +0 -1
- package/build/unnest.d.ts +0 -13
- package/build/unnest.d.ts.map +0 -1
- package/build/unnest.js +0 -85
- package/build/unnest.js.map +0 -1
- package/build/upsert.d.ts +0 -42
- package/build/upsert.d.ts.map +0 -1
- package/build/utils.d.ts +0 -60
- package/build/utils.d.ts.map +0 -1
- package/build/withLoaded.d.ts +0 -56
- package/build/withLoaded.d.ts.map +0 -1
- package/build/withLoaded.js +0 -76
- package/build/withLoaded.js.map +0 -1
|
@@ -0,0 +1,1592 @@
|
|
|
1
|
+
import { kq, kqStar, safeKq } from "./keywords.js";
|
|
2
|
+
import { skipCondition } from "../skipCondition.js";
|
|
3
|
+
import { predicateBrand } from "../conditions.js";
|
|
4
|
+
import { isDeferredAliasCondition } from "../find/DeferredAlias.js";
|
|
5
|
+
import { ConditionBuilder } from "../ConditionBuilder.js";
|
|
6
|
+
import { filterSoftDeletes, lazyExcludedSelects, stiSubtypeFilter } from "../entityQueryUtils.js";
|
|
7
|
+
import { deepFindConditions } from "../parsedConditions.js";
|
|
8
|
+
import { BaseExpr, TemplateExpr, asNode, deferredCondition, deferredSym, isExpr, orderByToSql, resolveDeferredConditions, selectKeyBrand } from "./Expr.js";
|
|
9
|
+
import { fail } from "../../utils.js";
|
|
10
|
+
import { getBaseMeta } from "../../EntityMetadata.js";
|
|
11
|
+
import { buildWhereClause } from "../renderConditions.js";
|
|
12
|
+
import { AliasAssigner } from "./AliasAssigner.js";
|
|
13
|
+
import { JoinTableHandle, collectionJoin, getTableMetadata, getTableMgmt, inQueryCondition, isEntityTable, isTable, m2mJoinTable, referenceJoinSource, tableSqlName } from "./Tables.js";
|
|
14
|
+
import { buildExpr } from "./expressions/expression.js";
|
|
15
|
+
import { compileJoinTree } from "./JoinTree.js";
|
|
16
|
+
//#region src/queries/sql/query.ts
|
|
17
|
+
/**
|
|
18
|
+
* `em.query`: SQL-shaped queries as plain object literals.
|
|
19
|
+
*
|
|
20
|
+
* A query is data, a `Query<S, J>` POJO, `{ from, join, where, groupBy, having, select, orderBy, ... }`
|
|
21
|
+
* in SQL evaluation order:
|
|
22
|
+
*
|
|
23
|
+
* const [a, b] = tables(Author, Book);
|
|
24
|
+
* const bookStats = query({ from: b, groupBy: [b.author_id], select: { authorId: b.author_id, n: b.id.count() } });
|
|
25
|
+
* const rows = await em.query({
|
|
26
|
+
* from: a,
|
|
27
|
+
* join: [{ left: bookStats, on: bookStats.authorId.eq(a.id) }],
|
|
28
|
+
* select: { name: a.first_name, n: bookStats.n },
|
|
29
|
+
* orderBy: { n: "DESC" },
|
|
30
|
+
* });
|
|
31
|
+
* // rows: { name: string; n: number | undefined }[] (undefined because of the LEFT join)
|
|
32
|
+
*
|
|
33
|
+
* `em.query(pojo)` runs it. `select` decides the row type: a bare table returns entities, an array of
|
|
34
|
+
* columns or a `{ key: expr }` object returns typed POJOs, and a bare subquery returns its rows.
|
|
35
|
+
*
|
|
36
|
+
* `query(pojo)` turns the *same* POJO into a value: a derived table with typed columns, a scalar
|
|
37
|
+
* expression, or an entity list. It is the one non-POJO step, and the subquery analog of `table(Author)`:
|
|
38
|
+
* to reference a query's columns, the outer query needs *values* for them, and no POJO can manufacture
|
|
39
|
+
* values keyed off its own `select` keys.
|
|
40
|
+
*
|
|
41
|
+
* `table()`/`tables()` and `query()` are the only free functions a query needs, plus the `sql` tagged
|
|
42
|
+
* template as the escape hatch for SQL with no modeled shape. Everything else is in-DSL: join kinds are
|
|
43
|
+
* keyword keys (`{ left: b, on }`), SQL functions are methods on
|
|
44
|
+
* expressions (`b.id.count()`, `b.title.max()`, `x.coalesce(0)`), conditions are methods
|
|
45
|
+
* (`a.age.gte(18)`), and pruning is `undefined`: an `undefined` condition drops out, and a join nothing
|
|
46
|
+
* references anymore drops with it (see "Pruning" below).
|
|
47
|
+
*
|
|
48
|
+
* User documentation: `docs/src/content/docs/features/queries-raw.md`.
|
|
49
|
+
*/
|
|
50
|
+
const subqueryBrand = Symbol("joist.subquery");
|
|
51
|
+
const entityQueryBrand = Symbol("joist.entityQuery");
|
|
52
|
+
const scalarQueryBrand = Symbol("joist.scalarQuery");
|
|
53
|
+
function query(q) {
|
|
54
|
+
return createQueryValue(q);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Builds a query value only when its user-supplied `where` or join-tree filters survive pruning.
|
|
58
|
+
*
|
|
59
|
+
* Missing or empty conditions prune the value, including nested groups and `pruneIfUndefined`.
|
|
60
|
+
* Alias-only joins, HAVING, and implicit soft-delete/STI conditions do not keep the value alive.
|
|
61
|
+
*
|
|
62
|
+
* I.e. `queryMaybe({ from: b, where: b.authorId.eq(enabled ? a.id : undefined), select: b.id })`
|
|
63
|
+
* returns `undefined` when `enabled` is false, so an enclosing `notExists` also prunes.
|
|
64
|
+
*/
|
|
65
|
+
function queryMaybe(q) {
|
|
66
|
+
return createMaybeQueryValue(q);
|
|
67
|
+
}
|
|
68
|
+
/** Applies queryMaybe's structural pruning before creating any kind of read-query value. */
|
|
69
|
+
function createMaybeQueryValue(q) {
|
|
70
|
+
const normalized = normalizeQueryJoins(q);
|
|
71
|
+
const where = normalizeWhere(normalized.where);
|
|
72
|
+
checkCondition(where);
|
|
73
|
+
return isPrunedQueryCondition(where) ? void 0 : createQueryValue(normalized);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Declares a `WITH RECURSIVE` CTE from its two terms, and returns the CTE as a readable value.
|
|
77
|
+
*
|
|
78
|
+
* `base` is the non-recursive term, which seeds the rows and, as in PostgreSQL, supplies the CTE's
|
|
79
|
+
* columns. `step` is the recursive term: it receives the CTE itself, so it can join back to the rows
|
|
80
|
+
* found so far. The two terms are combined with UNION ALL, or UNION when `union: "distinct"` drops
|
|
81
|
+
* duplicates, which is how a cyclic graph is kept from looping forever.
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* const [a] = tables(Author);
|
|
85
|
+
* const tree = recursiveQuery(
|
|
86
|
+
* "tree",
|
|
87
|
+
* { from: a, where: a.mentor_id.isNull(), select: { id: a.id, mentorId: a.mentor_id } },
|
|
88
|
+
* (self) => ({
|
|
89
|
+
* from: a,
|
|
90
|
+
* join: [{ inner: self, on: a.mentor_id.eq(self.id) }],
|
|
91
|
+
* select: { id: a.id, mentorId: a.mentor_id },
|
|
92
|
+
* }),
|
|
93
|
+
* );
|
|
94
|
+
* const rows = await em.query({ with: tree, from: tree, select: tree });
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* Unlike `query()`, the name is required, because the step term must name it.
|
|
98
|
+
*/
|
|
99
|
+
function recursiveQuery(name, base, step, opts = {}) {
|
|
100
|
+
if (typeof name !== "string" || name === "") fail("A recursive CTE needs a name");
|
|
101
|
+
if (opts.union !== void 0 && opts.union !== "all" && opts.union !== "distinct") fail("A recursive CTE's union must be 'all' or 'distinct'");
|
|
102
|
+
const handle = new SubqueryHandle(toQuery(base), true);
|
|
103
|
+
if (handle.output().kind !== "pojo") fail("A recursive CTE's base term needs a named projection");
|
|
104
|
+
const self = newSubqueryProxy(handle);
|
|
105
|
+
const operands = [base, step(self)];
|
|
106
|
+
handle.setBody(opts.union === "distinct" ? {
|
|
107
|
+
union: operands,
|
|
108
|
+
as: name
|
|
109
|
+
} : {
|
|
110
|
+
unionAll: operands,
|
|
111
|
+
as: name
|
|
112
|
+
});
|
|
113
|
+
return self;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Builds a SQL expression from a tagged template.
|
|
117
|
+
*
|
|
118
|
+
* For an Author alias `a` assigned the SQL alias `a1`:
|
|
119
|
+
*
|
|
120
|
+
* ```ts
|
|
121
|
+
* sql`${a.age} * 2` // Expression: a1.age * 2
|
|
122
|
+
* sql`${a.age.gte(18)}` // Condition: (a1.age >= ?), bindings [18]
|
|
123
|
+
* sql`${"Alice"}` // Value: ?, bindings ["Alice"]
|
|
124
|
+
*
|
|
125
|
+
* // Selecting this expression keeps the join to Book b.
|
|
126
|
+
* sql.number`${b.order} * ${2}`
|
|
127
|
+
*
|
|
128
|
+
* // Reference an unmodeled column; prefer the table's own `column`, which keeps its source key.
|
|
129
|
+
* a.column<string>("ts_search")
|
|
130
|
+
* sql.condition`${a.column("ts_search")} @@ plainto_tsquery(${term})`
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
function sql(strings, ...values) {
|
|
134
|
+
return typedSql(strings, ...values);
|
|
135
|
+
}
|
|
136
|
+
/** Shorthand for `sql<number>`; does not cast or convert the SQL result. */
|
|
137
|
+
sql.number = typedSql;
|
|
138
|
+
/** Shorthand for `sql<number | null>`; does not cast or convert the SQL result. */
|
|
139
|
+
sql.numberOrNull = typedSql;
|
|
140
|
+
/** Shorthand for `sql<number[]>`; does not cast or convert the SQL result. */
|
|
141
|
+
sql.numberArray = typedSql;
|
|
142
|
+
/** Shorthand for `sql<number[] | null>`; does not cast or convert the SQL result. */
|
|
143
|
+
sql.numberArrayOrNull = typedSql;
|
|
144
|
+
/** Shorthand for `sql<string>`; does not cast or convert the SQL result. */
|
|
145
|
+
sql.string = typedSql;
|
|
146
|
+
/** Shorthand for `sql<string | null>`; does not cast or convert the SQL result. */
|
|
147
|
+
sql.stringOrNull = typedSql;
|
|
148
|
+
/** Shorthand for `sql<string[]>`; does not cast or convert the SQL result. */
|
|
149
|
+
sql.stringArray = typedSql;
|
|
150
|
+
/** Shorthand for `sql<string[] | null>`; does not cast or convert the SQL result. */
|
|
151
|
+
sql.stringArrayOrNull = typedSql;
|
|
152
|
+
/** Shorthand for `sql<boolean>`; does not cast or convert the SQL result. */
|
|
153
|
+
sql.boolean = typedSql;
|
|
154
|
+
/** Shorthand for `sql<boolean | null>`; does not cast or convert the SQL result. */
|
|
155
|
+
sql.booleanOrNull = typedSql;
|
|
156
|
+
/** Shorthand for `sql<boolean[]>`; does not cast or convert the SQL result. */
|
|
157
|
+
sql.booleanArray = typedSql;
|
|
158
|
+
/** Shorthand for `sql<boolean[] | null>`; does not cast or convert the SQL result. */
|
|
159
|
+
sql.booleanArrayOrNull = typedSql;
|
|
160
|
+
/** A raw condition for `where`, `having`, or `on`. */
|
|
161
|
+
sql.condition = function condition(strings, ...values) {
|
|
162
|
+
return deferredCondition((ctx) => new TemplateExpr(strings, values).toSql(ctx));
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Parses `arg` (a `Query` POJO or `query(...)` value) into a runnable `Plan`.
|
|
166
|
+
*
|
|
167
|
+
* `EntityManager.query` runs the plan; this module deliberately does not import `EntityManager` (see
|
|
168
|
+
* `EntityHydrator`), so it parses and hands back `{ sql, bindings, decodeRows }` instead of executing.
|
|
169
|
+
*/
|
|
170
|
+
function parseUserQuery(arg) {
|
|
171
|
+
if (arg instanceof SubqueryExpr) fail("Scalar query values are expressions, not executable read inputs");
|
|
172
|
+
return parseQuery(toQuery(arg), void 0, new AliasAssigner());
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Parses a read that sits inside another statement, i.e. an INSERT's SELECT source, so it resolves that
|
|
176
|
+
* statement's CTEs and shares its alias space instead of generating names that could collide with them.
|
|
177
|
+
*/
|
|
178
|
+
function parseNestedQuery(arg, parent, assigner) {
|
|
179
|
+
if (arg instanceof SubqueryExpr) fail("Scalar query values are expressions, not executable read inputs");
|
|
180
|
+
return parseQuery(toQuery(arg), parent, assigner);
|
|
181
|
+
}
|
|
182
|
+
/** Recognizes read brands, including malformed hybrids that must reach read validation rather than mutation execution. */
|
|
183
|
+
function isReadQueryValue(arg) {
|
|
184
|
+
return isSubqueryValue(arg) || isEntityQueryValue(arg);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Compiles scalar or nonempty named expression projections, shared by SELECT and mutation RETURNING.
|
|
188
|
+
* Source-shaped values need read hydration/source rules and are deliberately excluded here.
|
|
189
|
+
*/
|
|
190
|
+
function projectionToSql(select, ctx, joins) {
|
|
191
|
+
const output = joinedOutput(projectionOutput(select), joins);
|
|
192
|
+
if (output.kind === "scalar") {
|
|
193
|
+
const expr = output.columns[0][1];
|
|
194
|
+
const fragment = expr.toSql(ctx);
|
|
195
|
+
return {
|
|
196
|
+
selects: [{
|
|
197
|
+
...fragment,
|
|
198
|
+
sql: `${fragment.sql} AS value`
|
|
199
|
+
}],
|
|
200
|
+
decodeRows: (_, rows) => rows.map((row) => decodeValue(expr, row.value)),
|
|
201
|
+
output
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const entries = output.columns;
|
|
205
|
+
return {
|
|
206
|
+
selects: entries.map((entry) => {
|
|
207
|
+
const [key, expr] = entry;
|
|
208
|
+
const fragment = expr.toSql(ctx);
|
|
209
|
+
return {
|
|
210
|
+
...fragment,
|
|
211
|
+
sql: `${fragment.sql} AS ${safeKq(key)}`
|
|
212
|
+
};
|
|
213
|
+
}),
|
|
214
|
+
decodeRows: (_, rows) => rows.map((row) => decodeRow(row, entries)),
|
|
215
|
+
output
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/** The runtime identity of a `query(...)` value; `Ctx.aliasFor` keys on it, like a table's `TableMgmt`. */
|
|
219
|
+
var SubqueryHandle = class {
|
|
220
|
+
recursive;
|
|
221
|
+
#q;
|
|
222
|
+
constructor(q, recursive = false) {
|
|
223
|
+
this.recursive = recursive;
|
|
224
|
+
this.#q = q;
|
|
225
|
+
}
|
|
226
|
+
get q() {
|
|
227
|
+
return this.#q;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Gives a recursive CTE its finished body. `recursiveQuery` starts the handle on its base term, so
|
|
231
|
+
* the step term can read the CTE's columns while the body that will hold that step is still being
|
|
232
|
+
* built. The base term supplies the CTE's columns either way, PostgreSQL's rule for a recursive WITH.
|
|
233
|
+
*/
|
|
234
|
+
setBody(q) {
|
|
235
|
+
if (!this.recursive) fail("Only a recursive CTE replaces its body");
|
|
236
|
+
this.#q = q;
|
|
237
|
+
}
|
|
238
|
+
get name() {
|
|
239
|
+
return this.q.as;
|
|
240
|
+
}
|
|
241
|
+
/** The select keys, for `select: <subquery>` and for reporting unknown columns. */
|
|
242
|
+
columnKeys() {
|
|
243
|
+
const output = this.output();
|
|
244
|
+
if (output.kind === "pojo") return output.columns.map(([key]) => key);
|
|
245
|
+
return fail(`A subquery with an entity or scalar select has no columns`);
|
|
246
|
+
}
|
|
247
|
+
/** The inner expression behind `key`, for its decoder/encoder. */
|
|
248
|
+
columnExpr(key) {
|
|
249
|
+
return this.output().columns.find(([name]) => name === key)?.[1] ?? fail(`Subquery ${this.describe()} has no column ${key}`);
|
|
250
|
+
}
|
|
251
|
+
/** Resolve output metadata without parsing SQL or caching aliases from an enclosing query. */
|
|
252
|
+
output() {
|
|
253
|
+
return queryOutput(this.q);
|
|
254
|
+
}
|
|
255
|
+
column(key) {
|
|
256
|
+
return new SubqueryColumnExpr(this, key, this.columnExpr(key));
|
|
257
|
+
}
|
|
258
|
+
describe() {
|
|
259
|
+
return this.q.as ? `'${this.q.as}'` : "(anonymous)";
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
/** A column of a joined/from'd subquery, i.e. `bookStats.bookCount`, which becomes `book_stats."bookCount"`. */
|
|
263
|
+
var SubqueryColumnExpr = class extends BaseExpr {
|
|
264
|
+
handle;
|
|
265
|
+
key;
|
|
266
|
+
inner;
|
|
267
|
+
constructor(handle, key, inner) {
|
|
268
|
+
super();
|
|
269
|
+
this.handle = handle;
|
|
270
|
+
this.key = key;
|
|
271
|
+
this.inner = inner;
|
|
272
|
+
}
|
|
273
|
+
get [selectKeyBrand]() {
|
|
274
|
+
return this.key;
|
|
275
|
+
}
|
|
276
|
+
toSql(ctx) {
|
|
277
|
+
const alias = ctx.aliasFor(this.handle);
|
|
278
|
+
return {
|
|
279
|
+
sql: `${safeKq(alias)}.${safeKq(this.key)}`,
|
|
280
|
+
bindings: [],
|
|
281
|
+
refs: [alias]
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
decode(value) {
|
|
285
|
+
return this.inner.decode(value);
|
|
286
|
+
}
|
|
287
|
+
encode(value) {
|
|
288
|
+
return this.inner.encode(value);
|
|
289
|
+
}
|
|
290
|
+
get outputType() {
|
|
291
|
+
return this.inner.outputType;
|
|
292
|
+
}
|
|
293
|
+
get sqlNullable() {
|
|
294
|
+
return this.inner.sqlNullable;
|
|
295
|
+
}
|
|
296
|
+
get sqlSource() {
|
|
297
|
+
return this.handle;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* A scalar (or IN-list) subquery, i.e. `query({ from: b, where: [...], select: b.id.count() })`.
|
|
302
|
+
*
|
|
303
|
+
* It closes over the outer aliases it references, so correlation is free; those references are the
|
|
304
|
+
* subquery's "free" aliases and count toward the outer query's join pruning.
|
|
305
|
+
*/
|
|
306
|
+
var SubqueryExpr = class extends BaseExpr {
|
|
307
|
+
handle;
|
|
308
|
+
[scalarQueryBrand] = true;
|
|
309
|
+
constructor(handle) {
|
|
310
|
+
super();
|
|
311
|
+
this.handle = handle;
|
|
312
|
+
}
|
|
313
|
+
get subquerySelect() {
|
|
314
|
+
const expr = this.handle.output().columns[0][1];
|
|
315
|
+
return expr instanceof OutputExpr ? expr.inner : expr;
|
|
316
|
+
}
|
|
317
|
+
get outputType() {
|
|
318
|
+
return this.subquerySelect.outputType;
|
|
319
|
+
}
|
|
320
|
+
get sqlNullable() {
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
toSql(ctx) {
|
|
324
|
+
const bare = this.toSqlBare(ctx);
|
|
325
|
+
return {
|
|
326
|
+
...bare,
|
|
327
|
+
sql: `(${bare.sql})`
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
toSqlBare(ctx) {
|
|
331
|
+
const parent = ctx instanceof Ctx ? ctx : fail("Subqueries need the query parser's context");
|
|
332
|
+
const plan = parseQuery(this.handle.q, parent, parent.assigner);
|
|
333
|
+
return {
|
|
334
|
+
sql: plan.sql,
|
|
335
|
+
bindings: plan.bindings,
|
|
336
|
+
refs: plan.outerRefs
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
decode(value) {
|
|
340
|
+
return this.subquerySelect.decode(value);
|
|
341
|
+
}
|
|
342
|
+
encode(value) {
|
|
343
|
+
return this.subquerySelect.encode(value);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
function newSubqueryProxy(handle) {
|
|
347
|
+
return new Proxy({}, {
|
|
348
|
+
get(_, key) {
|
|
349
|
+
if (key === subqueryBrand) return handle;
|
|
350
|
+
if (typeof key === "string") return handle.column(key);
|
|
351
|
+
},
|
|
352
|
+
has(_, key) {
|
|
353
|
+
return key === subqueryBrand || typeof key === "string" && handle.columnKeys().includes(key);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
function isSubqueryValue(value) {
|
|
358
|
+
return typeof value === "object" && value !== null && subqueryBrand in value;
|
|
359
|
+
}
|
|
360
|
+
function isEntityQueryValue(value) {
|
|
361
|
+
return typeof value === "object" && value !== null && entityQueryBrand in value;
|
|
362
|
+
}
|
|
363
|
+
function isPlainSelect(select) {
|
|
364
|
+
return typeof select === "object" && select !== null && !isExpr(select) && !isSubqueryValue(select) && !isEntityQueryValue(select) && (Object.getPrototypeOf(select) === Object.prototype || Object.getPrototypeOf(select) === null);
|
|
365
|
+
}
|
|
366
|
+
/** Returns the runtime identity of a source: a table's `TableMgmt` or a subquery's handle. */
|
|
367
|
+
function handleOf(source) {
|
|
368
|
+
if (isTable(source)) return getTableMgmt(source);
|
|
369
|
+
if (isSubqueryValue(source)) return readValueHandle(source);
|
|
370
|
+
return fail(`Expected a table or a query(...) value, got ${source}`);
|
|
371
|
+
}
|
|
372
|
+
function toQuery(arg) {
|
|
373
|
+
if (isReadQueryValue(arg)) return toQuery(readValueHandle(arg).q);
|
|
374
|
+
if (arg instanceof SubqueryExpr) return toQuery(arg.handle.q);
|
|
375
|
+
validateReadQuery(arg);
|
|
376
|
+
return arg;
|
|
377
|
+
}
|
|
378
|
+
/** Virtual subquery columns are not own clauses; attached properties on the value are always rejected. */
|
|
379
|
+
function readValueHandle(arg) {
|
|
380
|
+
if (!isSubqueryValue(arg) && !isEntityQueryValue(arg)) return fail("Expected a branded read query value");
|
|
381
|
+
validateQueryKeys(arg, [isSubqueryValue(arg) ? subqueryBrand : entityQueryBrand], "Read query values");
|
|
382
|
+
const handle = isSubqueryValue(arg) ? arg[subqueryBrand] : arg[entityQueryBrand];
|
|
383
|
+
return handle instanceof SubqueryHandle ? handle : fail("Invalid read query value handle");
|
|
384
|
+
}
|
|
385
|
+
const SET_OPERATIONS = {
|
|
386
|
+
union: "UNION",
|
|
387
|
+
unionAll: "UNION ALL",
|
|
388
|
+
intersect: "INTERSECT",
|
|
389
|
+
intersectAll: "INTERSECT ALL",
|
|
390
|
+
except: "EXCEPT",
|
|
391
|
+
exceptAll: "EXCEPT ALL"
|
|
392
|
+
};
|
|
393
|
+
const MUTATION_KEYS = [
|
|
394
|
+
"insert",
|
|
395
|
+
"update",
|
|
396
|
+
"delete",
|
|
397
|
+
"values",
|
|
398
|
+
"set",
|
|
399
|
+
"returning",
|
|
400
|
+
"allowAll"
|
|
401
|
+
];
|
|
402
|
+
const READ_KEYS = [
|
|
403
|
+
"with",
|
|
404
|
+
"from",
|
|
405
|
+
"join",
|
|
406
|
+
"where",
|
|
407
|
+
"groupBy",
|
|
408
|
+
"having",
|
|
409
|
+
"select",
|
|
410
|
+
"orderBy",
|
|
411
|
+
"limit",
|
|
412
|
+
"offset",
|
|
413
|
+
"distinct",
|
|
414
|
+
"pruneJoins",
|
|
415
|
+
"softDeletes",
|
|
416
|
+
"as"
|
|
417
|
+
];
|
|
418
|
+
/**
|
|
419
|
+
* Checks every ordinary or compound root before exposing output metadata or compiling SQL.
|
|
420
|
+
* Validate options before applying defaults so wrong-type values, including null, cannot disappear.
|
|
421
|
+
*/
|
|
422
|
+
function validateReadQuery(arg) {
|
|
423
|
+
if (typeof arg !== "object" || arg === null || Array.isArray(arg)) fail("em.query expects a { from, select, ... } object or a query(...) value");
|
|
424
|
+
if (isSetQuery(arg)) setOperands(arg);
|
|
425
|
+
else {
|
|
426
|
+
validateQueryKeys(arg, READ_KEYS, "Read queries");
|
|
427
|
+
if (!("from" in arg && "select" in arg)) fail("em.query expects a { from, select, ... } object or a query(...) value");
|
|
428
|
+
}
|
|
429
|
+
const options = arg;
|
|
430
|
+
for (const key of ["limit", "offset"]) {
|
|
431
|
+
const value = options[key];
|
|
432
|
+
if (value !== void 0 && (typeof value !== "number" || !Number.isInteger(value) || value < 0)) fail(`Read query ${key} must be a nonnegative finite integer`);
|
|
433
|
+
}
|
|
434
|
+
if (options.softDeletes !== void 0 && options.softDeletes !== "include" && options.softDeletes !== "exclude") fail("Read query softDeletes must be 'include' or 'exclude'");
|
|
435
|
+
for (const key of ["distinct", "pruneJoins"]) if (options[key] !== void 0 && typeof options[key] !== "boolean") fail(`Read query ${key} must be a boolean`);
|
|
436
|
+
if (options.as !== void 0 && typeof options.as !== "string") fail("Read query as must be a string");
|
|
437
|
+
}
|
|
438
|
+
/** Includes undefined, symbol, non-enumerable, and inherited clauses rather than silently ignoring them. */
|
|
439
|
+
function validateQueryKeys(arg, allowed, description) {
|
|
440
|
+
for (let object = arg; object && object !== Object.prototype; object = Object.getPrototypeOf(object)) for (const key of Reflect.ownKeys(object)) {
|
|
441
|
+
if (allowed.includes(key)) continue;
|
|
442
|
+
if (MUTATION_KEYS.includes(key)) fail(`Read queries do not support mutation clause '${String(key)}'; use em.execute`);
|
|
443
|
+
fail(`${description} do not support clause '${String(key)}'`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
/** Detect operation keys even when their values are invalid, so mixed roots cannot fall through to SELECT. */
|
|
447
|
+
function isSetQuery(value) {
|
|
448
|
+
return typeof value === "object" && value !== null && Object.keys(SET_OPERATIONS).some((key) => key in value);
|
|
449
|
+
}
|
|
450
|
+
/** Validate each root independently; no operand, including the left side of EXCEPT, can be pruned. */
|
|
451
|
+
function setOperands(q) {
|
|
452
|
+
const keys = Object.keys(SET_OPERATIONS).filter((key) => key in q);
|
|
453
|
+
if (keys.length !== 1) fail("A set query requires exactly one operation key");
|
|
454
|
+
validateQueryKeys(q, [
|
|
455
|
+
keys[0],
|
|
456
|
+
"with",
|
|
457
|
+
"orderBy",
|
|
458
|
+
"limit",
|
|
459
|
+
"offset",
|
|
460
|
+
"as"
|
|
461
|
+
], "Set queries");
|
|
462
|
+
const operands = q[keys[0]];
|
|
463
|
+
if (!Array.isArray(operands) || operands.length < 2) fail("Set operations require at least two operands");
|
|
464
|
+
return [keys[0], operands];
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Resolve ordered output columns without rendering SQL. Set compatibility is deliberately conservative:
|
|
468
|
+
* every column needs the same known SQL representation, logical domain, and precise ID target.
|
|
469
|
+
*
|
|
470
|
+
* I.e. Author.id and Book.author share the Author key codec, but Book.id must never decode as Author.id.
|
|
471
|
+
* The first branch supplies names and conversions only after every branch passes these checks.
|
|
472
|
+
* UNION admits NULL from any branch; EXCEPT/INTERSECT retain the left branch's nullable facts.
|
|
473
|
+
* Unknown nullability stays unknown unless another UNION branch is known nullable.
|
|
474
|
+
*/
|
|
475
|
+
function queryOutput(q) {
|
|
476
|
+
validateReadQuery(q);
|
|
477
|
+
if (isSetQuery(q)) {
|
|
478
|
+
const [operation, operands] = setOperands(q);
|
|
479
|
+
const first = queryOutput(toQuery(operands[0]));
|
|
480
|
+
const columns = [...first.columns];
|
|
481
|
+
for (const operand of operands) {
|
|
482
|
+
const output = operand === operands[0] ? first : queryOutput(toQuery(operand));
|
|
483
|
+
if (output.kind !== "pojo") fail(output.kind === "entity" ? "Set operations do not support entity-mode operands" : "Set operations require POJO operands; wrap scalar expressions in a named select projection");
|
|
484
|
+
if (output.columns.length !== first.columns.length) fail("Set operands must have the same POJO keys");
|
|
485
|
+
for (let i = 0; i < columns.length; i++) {
|
|
486
|
+
const [key, expr] = columns[i];
|
|
487
|
+
const other = output.columns.find(([name]) => name === key)?.[1];
|
|
488
|
+
if (!other) fail(`Set operands must have the same POJO keys; missing '${key}'`);
|
|
489
|
+
const left = expr.outputType;
|
|
490
|
+
const right = other.outputType;
|
|
491
|
+
if (!left || !right) fail(`Set column '${key}' has an unknown or unsupported output codec; sql<R> does not declare a SQL type or codec`);
|
|
492
|
+
if (left.dbType !== right.dbType || left.domain !== right.domain || left.idMeta !== right.idMeta) fail(`Set column '${key}' has incompatible output codecs (${left.dbType} and ${right.dbType}); use matching SQL representations and logical domains`);
|
|
493
|
+
if (operation === "union" || operation === "unionAll") {
|
|
494
|
+
const nullable = expr.sqlNullable === true || other.sqlNullable === true ? true : expr.sqlNullable === void 0 || other.sqlNullable === void 0 ? void 0 : false;
|
|
495
|
+
if (nullable !== expr.sqlNullable) columns[i] = [key, new OutputExpr(expr, nullable)];
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
setOrderBys(q, first);
|
|
500
|
+
return {
|
|
501
|
+
kind: first.kind,
|
|
502
|
+
columns
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
q = normalizeQueryJoins(q);
|
|
506
|
+
const { select } = q;
|
|
507
|
+
if (isTable(select)) return {
|
|
508
|
+
kind: "entity",
|
|
509
|
+
columns: []
|
|
510
|
+
};
|
|
511
|
+
if (isSubqueryValue(select)) return readValueHandle(select).output();
|
|
512
|
+
return joinedOutput(projectionOutput(select), q.join);
|
|
513
|
+
}
|
|
514
|
+
/** Validates the projection before compiling SQL or exposing reusable query columns. */
|
|
515
|
+
function projectionOutput(select) {
|
|
516
|
+
if (isExpr(select)) return {
|
|
517
|
+
kind: "scalar",
|
|
518
|
+
columns: [["value", asExpr(select, "select")]]
|
|
519
|
+
};
|
|
520
|
+
if (Array.isArray(select)) {
|
|
521
|
+
if (select.length === 0) fail("A column array projection must not be empty");
|
|
522
|
+
const columns = select.map((value, index) => {
|
|
523
|
+
const expr = asExpr(value, `select[${index}]`);
|
|
524
|
+
const key = expr[selectKeyBrand];
|
|
525
|
+
if (typeof key !== "string") fail(`select[${index}] must be a physical or subquery column`);
|
|
526
|
+
return [key, expr];
|
|
527
|
+
});
|
|
528
|
+
if (new Set(columns.map(([key]) => key)).size !== columns.length) fail("A column array projection must not contain duplicate field names");
|
|
529
|
+
return {
|
|
530
|
+
kind: "pojo",
|
|
531
|
+
columns
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
if (isPlainSelect(select)) {
|
|
535
|
+
const columns = [];
|
|
536
|
+
for (const key of Reflect.ownKeys(select)) {
|
|
537
|
+
if (typeof key !== "string") fail("Projection keys must be strings");
|
|
538
|
+
if (Object.prototype.propertyIsEnumerable.call(select, key)) columns.push([key, asSelectExpr(select[key], `select.${key}`)]);
|
|
539
|
+
}
|
|
540
|
+
if (columns.length === 0) fail("A named expression projection must not be empty");
|
|
541
|
+
return {
|
|
542
|
+
kind: "pojo",
|
|
543
|
+
columns
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
return fail("Expected a scalar expression or a nonempty named expression projection");
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Adds SQL nullability from unmatched LEFT joins without mutating shared expressions or their codecs.
|
|
550
|
+
* Only direct columns carry sqlSource; COUNT and COALESCE retain their own SQL nullability.
|
|
551
|
+
* I.e. selecting Book.title from a LEFT-joined Book makes its output nullable, but COUNT(Book.id) stays NOT NULL.
|
|
552
|
+
*/
|
|
553
|
+
function joinedOutput(output, joins) {
|
|
554
|
+
if (!joins?.some((join) => join?.left)) return output;
|
|
555
|
+
const left = /* @__PURE__ */ new Set();
|
|
556
|
+
for (const join of resolveReferenceJoins(joins)) if (join.left) left.add(handleOf(join.left));
|
|
557
|
+
return {
|
|
558
|
+
kind: output.kind,
|
|
559
|
+
columns: output.columns.map((column) => {
|
|
560
|
+
const [key, expr] = column;
|
|
561
|
+
return expr.sqlSource && left.has(expr.sqlSource) && expr.sqlNullable !== true ? [key, new OutputExpr(expr, true)] : column;
|
|
562
|
+
})
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Resolves reference joins in declaration order without changing reusable join entries.
|
|
567
|
+
* Only .as() carries a source handle; explicit INNER joins retain their filtering semantics.
|
|
568
|
+
* I.e. LEFT Book followed by Book.author.as(a) adds Author to the set of nullable handles.
|
|
569
|
+
*/
|
|
570
|
+
function resolveReferenceJoins(joins) {
|
|
571
|
+
const left = /* @__PURE__ */ new Set();
|
|
572
|
+
return (joins ?? []).filter(isDefined).map((join) => {
|
|
573
|
+
const source = join[referenceJoinSource];
|
|
574
|
+
if (join.inner && source && left.has(source)) {
|
|
575
|
+
const { inner, ...rest } = join;
|
|
576
|
+
const resolved = {
|
|
577
|
+
...rest,
|
|
578
|
+
left: inner
|
|
579
|
+
};
|
|
580
|
+
left.add(handleOf(inner));
|
|
581
|
+
return resolved;
|
|
582
|
+
}
|
|
583
|
+
if (join.left) left.add(handleOf(join.left));
|
|
584
|
+
return join;
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
/** An output-only nullability adjustment that preserves the selected expression's SQL and conversions. */
|
|
588
|
+
var OutputExpr = class extends BaseExpr {
|
|
589
|
+
inner;
|
|
590
|
+
nullable;
|
|
591
|
+
constructor(inner, nullable) {
|
|
592
|
+
super();
|
|
593
|
+
this.inner = inner;
|
|
594
|
+
this.nullable = nullable;
|
|
595
|
+
}
|
|
596
|
+
get outputType() {
|
|
597
|
+
return this.inner.outputType;
|
|
598
|
+
}
|
|
599
|
+
get sqlNullable() {
|
|
600
|
+
return this.nullable;
|
|
601
|
+
}
|
|
602
|
+
toSql(ctx) {
|
|
603
|
+
return this.inner.toSql(ctx);
|
|
604
|
+
}
|
|
605
|
+
decode(value) {
|
|
606
|
+
return this.inner.decode(value);
|
|
607
|
+
}
|
|
608
|
+
encode(value) {
|
|
609
|
+
return this.inner.encode(value);
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* Compile siblings in separate local scopes with the same enclosing context. Projection wrappers align
|
|
614
|
+
* output positions without moving DISTINCT/order/pagination or repeating volatile selected expressions.
|
|
615
|
+
* Parenthesizing each accumulated left side preserves array association and explicit nested grouping.
|
|
616
|
+
*/
|
|
617
|
+
function parseSetQuery(q, parent, assigner, recursiveSelf) {
|
|
618
|
+
const [operation, operands] = setOperands(q);
|
|
619
|
+
const output = queryOutput(q);
|
|
620
|
+
const ctx = new Ctx(assigner, parent);
|
|
621
|
+
if (recursiveSelf) ctx.setRecursiveSelf(recursiveSelf);
|
|
622
|
+
const ctes = registerCtes(q, ctx, assigner);
|
|
623
|
+
const plans = operands.map((operand) => parseQuery(toQuery(operand), ctx, assigner));
|
|
624
|
+
let sql = "";
|
|
625
|
+
for (const plan of plans) {
|
|
626
|
+
let branch = plan.sql;
|
|
627
|
+
if (output.columns.some(([key], i) => plan.output.columns[i][0] !== key)) {
|
|
628
|
+
const alias = safeKq(assigner.getLiteralAlias("sq"));
|
|
629
|
+
branch = `SELECT ${output.columns.map(([key]) => `${alias}.${safeKq(key)} AS ${safeKq(key)}`).join(", ")} FROM (${branch}) AS ${alias}`;
|
|
630
|
+
}
|
|
631
|
+
sql = sql ? `(${sql}) ${SET_OPERATIONS[operation]} (${branch})` : branch;
|
|
632
|
+
}
|
|
633
|
+
const orderBys = setOrderBys(q, output);
|
|
634
|
+
if (orderBys.length > 0) sql += ` ORDER BY ${orderBys.join(", ")}`;
|
|
635
|
+
const bindings = plans.flatMap((plan) => plan.bindings);
|
|
636
|
+
if (q.limit !== void 0) {
|
|
637
|
+
sql += " LIMIT ?";
|
|
638
|
+
bindings.push(q.limit);
|
|
639
|
+
}
|
|
640
|
+
if (q.offset !== void 0) {
|
|
641
|
+
sql += " OFFSET ?";
|
|
642
|
+
bindings.push(q.offset);
|
|
643
|
+
}
|
|
644
|
+
const keptCtes = pruneCtes(ctes, new Set(plans.flatMap((plan) => plan.outerRefs)));
|
|
645
|
+
if (keptCtes.length > 0) {
|
|
646
|
+
const clause = withFragment(keptCtes);
|
|
647
|
+
sql = clause.sql + sql;
|
|
648
|
+
bindings.unshift(...clause.bindings);
|
|
649
|
+
}
|
|
650
|
+
const cteAliases = new Set(ctes.map((cte) => cte.alias));
|
|
651
|
+
const outerRefs = [...ctx.outerRefs, ...plans.flatMap((plan) => plan.outerRefs)];
|
|
652
|
+
return {
|
|
653
|
+
sql,
|
|
654
|
+
bindings,
|
|
655
|
+
outerRefs: [...new Set(outerRefs.filter((ref) => !cteAliases.has(ref)))],
|
|
656
|
+
output,
|
|
657
|
+
decodeRows: (_, rows) => rows.map((row) => decodeRow(row, output.columns))
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
/** Validate and quote only named set output sorts, including before a reusable value is parsed. */
|
|
661
|
+
function setOrderBys(q, output) {
|
|
662
|
+
const orderBys = [];
|
|
663
|
+
for (const entry of Array.isArray(q.orderBy) ? q.orderBy : q.orderBy ? [q.orderBy] : []) {
|
|
664
|
+
if (entry === void 0) continue;
|
|
665
|
+
if (!entry || typeof entry !== "object" || isExpr(entry)) fail("Set orderBy requires output-key hashes; use an outer query for expressions");
|
|
666
|
+
for (const [key, direction] of Object.entries(entry)) {
|
|
667
|
+
if (direction === void 0) continue;
|
|
668
|
+
if (!output.columns.some(([name]) => name === key)) fail(`Set orderBy key '${key}' is not a named output column`);
|
|
669
|
+
if (!ORDER_BY_DIRECTIONS.includes(direction)) fail("Set orderBy requires output-key directions; use an outer query for expressions");
|
|
670
|
+
orderBys.push(`${safeKq(key)} ${direction}`);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return orderBys;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* What an expression needs from the query it is generating SQL for.
|
|
677
|
+
*
|
|
678
|
+
* Each (sub)query gets its own `Ctx`; a lookup that misses locally walks up to the enclosing query and
|
|
679
|
+
* records the hit in `outerRefs`, which is how a correlated subquery reports the outer aliases it
|
|
680
|
+
* depends on (the way `ExistsCondition.outerAliases` does), so join pruning keeps them.
|
|
681
|
+
*/
|
|
682
|
+
var Ctx = class {
|
|
683
|
+
assigner;
|
|
684
|
+
parent;
|
|
685
|
+
aliases = /* @__PURE__ */ new Map();
|
|
686
|
+
/**
|
|
687
|
+
* The subset of `aliases` that are CTE names. A `from`/`join` on one of these emits just the name,
|
|
688
|
+
* i.e. `FROM book_stats`, where an ordinary `query(...)` value emits its whole body inline, i.e.
|
|
689
|
+
* `FROM (SELECT ...) AS sq`.
|
|
690
|
+
*/
|
|
691
|
+
ctes = /* @__PURE__ */ new Map();
|
|
692
|
+
/**
|
|
693
|
+
* `with` entries named but not yet turned into SQL. `registerCtes` names every entry first, then
|
|
694
|
+
* generates the bodies one at a time, so while one body is being generated the entries after it sit
|
|
695
|
+
* here. Reading one of those is a forward reference.
|
|
696
|
+
*/
|
|
697
|
+
pendingCtes = /* @__PURE__ */ new Map();
|
|
698
|
+
/** CTEs already read by this query's `from`/`join`, so a second read fails instead of colliding. */
|
|
699
|
+
usedCtes = /* @__PURE__ */ new Set();
|
|
700
|
+
/** The recursive CTE whose body this query is part of, if any; see `recursiveSelf`. */
|
|
701
|
+
ownRecursiveSelf;
|
|
702
|
+
outerRefs = /* @__PURE__ */ new Set();
|
|
703
|
+
constructor(assigner, parent) {
|
|
704
|
+
this.assigner = assigner;
|
|
705
|
+
this.parent = parent;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* One handle can hold only one alias per query, so a value used twice must be told apart, not
|
|
709
|
+
* silently collapsed into the second registration's alias.
|
|
710
|
+
*/
|
|
711
|
+
register(handle, alias) {
|
|
712
|
+
if (this.aliases.has(handle)) fail(`${describeHandle(handle)} is already in this query's \`with\`/\`from\`/\`join\`; use a separate table(...)/query(...) value for each use`);
|
|
713
|
+
this.aliases.set(handle, alias);
|
|
714
|
+
}
|
|
715
|
+
/** Names every `with` entry up front, so a CTE reading a later sibling is reported, not inlined. */
|
|
716
|
+
declareCte(handle, alias) {
|
|
717
|
+
this.pendingCtes.set(handle, alias);
|
|
718
|
+
}
|
|
719
|
+
/** Brings a pending CTE into scope, for the sources and columns that may now read it. */
|
|
720
|
+
promoteCte(handle) {
|
|
721
|
+
const alias = this.pendingCtes.get(handle) ?? fail("CTE was not declared");
|
|
722
|
+
this.pendingCtes.delete(handle);
|
|
723
|
+
this.ctes.set(handle, alias);
|
|
724
|
+
this.register(handle, alias);
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* The CTE name for `handle`, looking in the enclosing queries too, because a CTE is in scope for the
|
|
728
|
+
* whole statement.
|
|
729
|
+
*
|
|
730
|
+
* Unlike `aliasFor`, a hit in an enclosing query is not added to `outerRefs`: reading a CTE by name
|
|
731
|
+
* is not a correlated reference, so it must not keep an enclosing join alive.
|
|
732
|
+
*/
|
|
733
|
+
cteAliasFor(handle) {
|
|
734
|
+
return this.ctes.get(handle) ?? this.parent?.cteAliasFor(handle);
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* The recursive CTE this query's terms belong to, inherited from the enclosing query.
|
|
738
|
+
*
|
|
739
|
+
* PostgreSQL requires a recursive term to reference its own CTE, so that reference is not optional
|
|
740
|
+
* and must survive pruning, unlike an ordinary explicit join that nothing else reads.
|
|
741
|
+
*/
|
|
742
|
+
get recursiveSelf() {
|
|
743
|
+
return this.ownRecursiveSelf ?? this.parent?.recursiveSelf;
|
|
744
|
+
}
|
|
745
|
+
setRecursiveSelf(handle) {
|
|
746
|
+
this.ownRecursiveSelf = handle;
|
|
747
|
+
}
|
|
748
|
+
/** Whether `handle` is a CTE with no SQL yet, i.e. itself or a later `with` entry. */
|
|
749
|
+
isPendingCte(handle) {
|
|
750
|
+
return this.pendingCtes.has(handle) || (this.parent?.isPendingCte(handle) ?? false);
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Fails if this query already reads `handle`. A `Ctx` maps each handle to a single alias, so two
|
|
754
|
+
* reads of one CTE value would render as the same name, i.e. `FROM tree JOIN tree`, and neither the
|
|
755
|
+
* SQL nor a column expression could say which one it meant. Each read needs its own `query(...)`.
|
|
756
|
+
*
|
|
757
|
+
* Only this query is checked, not the enclosing ones: a nested subquery has its own FROM, so reading
|
|
758
|
+
* the same CTE in there is fine.
|
|
759
|
+
*/
|
|
760
|
+
useCte(handle) {
|
|
761
|
+
if (this.usedCtes.has(handle)) fail(`${describeHandle(handle)} is already in this query's \`from\`/\`join\`; use a separate query(...) value for each use`);
|
|
762
|
+
this.usedCtes.add(handle);
|
|
763
|
+
}
|
|
764
|
+
aliasFor(handle) {
|
|
765
|
+
const local = this.aliases.get(handle);
|
|
766
|
+
if (local) return local;
|
|
767
|
+
if (this.parent) {
|
|
768
|
+
const outer = this.parent.aliasFor(handle);
|
|
769
|
+
this.outerRefs.add(outer);
|
|
770
|
+
return outer;
|
|
771
|
+
}
|
|
772
|
+
return fail(`${describeHandle(handle)} is not in this query's from/join`);
|
|
773
|
+
}
|
|
774
|
+
conditionToSql(cond) {
|
|
775
|
+
return conditionToSql(cond, this, false);
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
function describeHandle(handle) {
|
|
779
|
+
if (handle instanceof SubqueryHandle) return `Subquery ${handle.describe()}`;
|
|
780
|
+
if (handle instanceof JoinTableHandle) return `Join table ${handle.joinTableName}`;
|
|
781
|
+
if ("tableName" in handle) return `Table for ${handle.tableName}`;
|
|
782
|
+
return "Table";
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Parses one `Query` POJO into SQL, recursively for subqueries.
|
|
786
|
+
*
|
|
787
|
+
* 1. Register every source's runtime identity with its SQL alias in this parse's context.
|
|
788
|
+
* 2. Generate SQL for sources, selects, conditions, group-bys, and order-bys against the context; every fragment
|
|
789
|
+
* reports the aliases it references.
|
|
790
|
+
* 3. Prune: drop joins nothing references (see below), then reject a kept join whose ON collapsed.
|
|
791
|
+
* 4. Assemble the SQL from the kept fragments, so pruned bindings disappear with their SQL.
|
|
792
|
+
*/
|
|
793
|
+
function parseQuery(q, parent, assigner, recursiveSelf) {
|
|
794
|
+
validateReadQuery(q);
|
|
795
|
+
if (isSetQuery(q)) return parseSetQuery(q, parent, assigner, recursiveSelf);
|
|
796
|
+
q = normalizeQueryJoins(q);
|
|
797
|
+
const ctx = new Ctx(assigner, parent);
|
|
798
|
+
if (recursiveSelf) ctx.setRecursiveSelf(recursiveSelf);
|
|
799
|
+
const joinEntries = resolveReferenceJoins(q.join);
|
|
800
|
+
const ctes = registerCtes(q, ctx, assigner);
|
|
801
|
+
const parseFrom = registerSource(q.from, ctx, assigner);
|
|
802
|
+
const pendingJoins = joinEntries.flatMap((j) => {
|
|
803
|
+
const kind = "inner" in j && j.inner ? "inner" : "left";
|
|
804
|
+
const alias = kind === "inner" ? j.inner : j.left;
|
|
805
|
+
const keep = j.keep ?? false;
|
|
806
|
+
const softDeletes = j[collectionJoin] === true;
|
|
807
|
+
const target = {
|
|
808
|
+
kind,
|
|
809
|
+
keep,
|
|
810
|
+
on: j.on,
|
|
811
|
+
softDeletes,
|
|
812
|
+
parseSource: registerSource(alias, ctx, assigner)
|
|
813
|
+
};
|
|
814
|
+
const m2m = j[m2mJoinTable];
|
|
815
|
+
if (!m2m) return [target];
|
|
816
|
+
return [{
|
|
817
|
+
kind,
|
|
818
|
+
keep,
|
|
819
|
+
on: m2m.on,
|
|
820
|
+
softDeletes: false,
|
|
821
|
+
parseSource: registerJoinTable(m2m.handle, ctx, assigner)
|
|
822
|
+
}, target];
|
|
823
|
+
});
|
|
824
|
+
const softDeletes = q.softDeletes ?? "exclude";
|
|
825
|
+
const from = parseFrom();
|
|
826
|
+
const userJoins = pendingJoins.map((j) => {
|
|
827
|
+
const source = j.parseSource();
|
|
828
|
+
const userOn = conditionToSql(j.on, ctx, true);
|
|
829
|
+
const injected = injectedConditions(source, j.softDeletes ? softDeletes : "include");
|
|
830
|
+
const fullOn = userOn && injected.length > 0 ? conditionToSql({ and: [j.on, ...injected] }, ctx, true) : userOn;
|
|
831
|
+
return {
|
|
832
|
+
kind: j.kind,
|
|
833
|
+
keep: j.keep,
|
|
834
|
+
source,
|
|
835
|
+
userOn,
|
|
836
|
+
fullOn
|
|
837
|
+
};
|
|
838
|
+
});
|
|
839
|
+
const cti = ctiEntityPlan(q, from, assigner);
|
|
840
|
+
const joins = [...cti.joins, ...userJoins];
|
|
841
|
+
const sti = stiEntityPlan(q, from);
|
|
842
|
+
const { selects, decodeRows, output } = selectsToSql(q, ctx, from, cti.selects ?? sti.selects);
|
|
843
|
+
const fromInjected = [...injectedConditions(from, softDeletes), ...sti.conditions];
|
|
844
|
+
const predicate = normalizeWhere(q.where);
|
|
845
|
+
const where = conditionToSql(fromInjected.length > 0 ? { and: [predicate, ...fromInjected] } : predicate, ctx, true);
|
|
846
|
+
const having = conditionToSql(q.having, ctx, true);
|
|
847
|
+
const groupBys = (q.groupBy ?? []).map((g) => asExpr(g, "groupBy").toSql(ctx));
|
|
848
|
+
const orderBys = orderBysToSql(q, ctx);
|
|
849
|
+
const { joins: kept, ctes: keptCtes } = pruneJoins(q, ctx, from, joins, ctes, [
|
|
850
|
+
...selects,
|
|
851
|
+
...groupBys,
|
|
852
|
+
...orderBys,
|
|
853
|
+
where,
|
|
854
|
+
having
|
|
855
|
+
].filter(isDefined));
|
|
856
|
+
const laterAliases = new Set(kept.map((j) => j.source.alias));
|
|
857
|
+
for (const j of kept) {
|
|
858
|
+
if (!j.userOn) fail(`Join ${describeHandle(j.source.handle)} has no ON condition left (they all pruned), but the query still references it`);
|
|
859
|
+
laterAliases.delete(j.source.alias);
|
|
860
|
+
const forward = j.fullOn.refs.find((r) => laterAliases.has(r));
|
|
861
|
+
if (forward) fail(`Join ${describeHandle(j.source.handle)} references '${forward}', which is joined later; move that join earlier in the join array`);
|
|
862
|
+
}
|
|
863
|
+
const out = [];
|
|
864
|
+
if (keptCtes.length > 0) out.push(withFragment(keptCtes));
|
|
865
|
+
out.push({
|
|
866
|
+
sql: `SELECT ${q.distinct ? "DISTINCT " : ""}`,
|
|
867
|
+
bindings: [],
|
|
868
|
+
refs: []
|
|
869
|
+
});
|
|
870
|
+
out.push(joinFragmentParts(selects, ", "));
|
|
871
|
+
out.push({
|
|
872
|
+
sql: ` FROM ${from.sql}`,
|
|
873
|
+
bindings: from.bindings,
|
|
874
|
+
refs: []
|
|
875
|
+
});
|
|
876
|
+
for (const j of kept) {
|
|
877
|
+
const keyword = j.kind === "inner" ? "JOIN" : "LEFT OUTER JOIN";
|
|
878
|
+
out.push({
|
|
879
|
+
sql: ` ${keyword} ${j.source.sql} ON ${j.fullOn.sql}`,
|
|
880
|
+
bindings: [...j.source.bindings, ...j.fullOn.bindings],
|
|
881
|
+
refs: []
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
if (where) out.push({
|
|
885
|
+
sql: ` WHERE ${where.sql}`,
|
|
886
|
+
bindings: where.bindings,
|
|
887
|
+
refs: []
|
|
888
|
+
});
|
|
889
|
+
if (groupBys.length > 0) out.push({
|
|
890
|
+
...joinFragmentParts(groupBys, ", "),
|
|
891
|
+
sql: ` GROUP BY ${groupBys.map((g) => g.sql).join(", ")}`
|
|
892
|
+
});
|
|
893
|
+
if (having) out.push({
|
|
894
|
+
sql: ` HAVING ${having.sql}`,
|
|
895
|
+
bindings: having.bindings,
|
|
896
|
+
refs: []
|
|
897
|
+
});
|
|
898
|
+
if (orderBys.length > 0) out.push({
|
|
899
|
+
...joinFragmentParts(orderBys, ", "),
|
|
900
|
+
sql: ` ORDER BY ${orderBys.map((o) => o.sql).join(", ")}`
|
|
901
|
+
});
|
|
902
|
+
if (q.limit !== void 0) out.push({
|
|
903
|
+
sql: ` LIMIT ?`,
|
|
904
|
+
bindings: [q.limit],
|
|
905
|
+
refs: []
|
|
906
|
+
});
|
|
907
|
+
if (q.offset !== void 0) out.push({
|
|
908
|
+
sql: ` OFFSET ?`,
|
|
909
|
+
bindings: [q.offset],
|
|
910
|
+
refs: []
|
|
911
|
+
});
|
|
912
|
+
return {
|
|
913
|
+
sql: out.map((o) => o.sql).join(""),
|
|
914
|
+
bindings: out.flatMap((o) => o.bindings),
|
|
915
|
+
outerRefs: [...ctx.outerRefs],
|
|
916
|
+
output,
|
|
917
|
+
decodeRows
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Assigns a SQL alias to a source and returns a function that parses it after all sources are registered.
|
|
922
|
+
*
|
|
923
|
+
* Conditions resolve source identities through the context when their SQL is generated.
|
|
924
|
+
* Each entity source reads only its physical table, without inheritance joins or class tags.
|
|
925
|
+
*/
|
|
926
|
+
function registerSource(source, ctx, assigner) {
|
|
927
|
+
const handle = handleOf(source);
|
|
928
|
+
const cteAlias = ctx.cteAliasFor(handle);
|
|
929
|
+
if (cteAlias) {
|
|
930
|
+
ctx.useCte(handle);
|
|
931
|
+
return () => ({
|
|
932
|
+
handle,
|
|
933
|
+
alias: cteAlias,
|
|
934
|
+
sql: safeKq(cteAlias),
|
|
935
|
+
bindings: [],
|
|
936
|
+
refs: [],
|
|
937
|
+
entitySelects: [],
|
|
938
|
+
meta: void 0
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
if (ctx.isPendingCte(handle)) fail(`${describeHandle(handle)} is declared later in this query's \`with\`; a CTE can only read earlier ones, and cannot read itself`);
|
|
942
|
+
if (handle instanceof SubqueryHandle) {
|
|
943
|
+
const alias = handle.name ? assigner.getLiteralAlias(handle.name) : assigner.getLiteralAlias("sq");
|
|
944
|
+
ctx.register(handle, alias);
|
|
945
|
+
return () => {
|
|
946
|
+
const inner = parseQuery(handle.q, ctx, assigner);
|
|
947
|
+
return {
|
|
948
|
+
handle,
|
|
949
|
+
alias,
|
|
950
|
+
sql: `(${inner.sql}) AS ${safeKq(alias)}`,
|
|
951
|
+
bindings: inner.bindings,
|
|
952
|
+
refs: inner.outerRefs,
|
|
953
|
+
entitySelects: [],
|
|
954
|
+
meta: void 0
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
} else {
|
|
958
|
+
const mgmt = getTableMgmt(source);
|
|
959
|
+
const { tableName } = mgmt;
|
|
960
|
+
const meta = "meta" in mgmt ? mgmt.meta : void 0;
|
|
961
|
+
const alias = assigner.getAlias(tableName);
|
|
962
|
+
ctx.register(handle, alias);
|
|
963
|
+
return () => {
|
|
964
|
+
const entitySelects = !meta ? [] : meta.hasLazyColumns ? lazyExcludedSelects(meta, alias) : [kqStar(alias)];
|
|
965
|
+
return {
|
|
966
|
+
handle,
|
|
967
|
+
alias,
|
|
968
|
+
sql: `${tableSqlName(mgmt)} AS ${kq(alias)}`,
|
|
969
|
+
bindings: [],
|
|
970
|
+
refs: [],
|
|
971
|
+
entitySelects,
|
|
972
|
+
meta
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* Per-source soft-delete injections: `alias.deleted_at IS NULL` for a soft-deletable entity.
|
|
979
|
+
* CTI subtypes are skipped because their deleted-at column belongs to the base table (see
|
|
980
|
+
* `filterSoftDeletes`). STI sources read all physical rows without discriminator predicates.
|
|
981
|
+
*
|
|
982
|
+
* The conditions go into the from's WHERE or the join's ON, and never keep an otherwise unreferenced
|
|
983
|
+
* join alive, which is what `pruneable: true` means on em.find's side.
|
|
984
|
+
*/
|
|
985
|
+
function injectedConditions(source, softDeletes) {
|
|
986
|
+
const { meta } = source;
|
|
987
|
+
if (!meta) return [];
|
|
988
|
+
const conditions = [];
|
|
989
|
+
if (filterSoftDeletes(meta, softDeletes)) {
|
|
990
|
+
const field = meta.allFields[getBaseMeta(meta).timestampFields.deletedAt];
|
|
991
|
+
const column = field.serde.columns[0];
|
|
992
|
+
conditions.push({
|
|
993
|
+
kind: "column",
|
|
994
|
+
alias: `${source.alias}${field.aliasSuffix}`,
|
|
995
|
+
column: column.columnName,
|
|
996
|
+
dbType: column.dbType,
|
|
997
|
+
cond: { kind: "is-null" },
|
|
998
|
+
pruneable: true
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
return conditions;
|
|
1002
|
+
}
|
|
1003
|
+
/** Registers a sugar m2m join table, i.e. `authors_to_tags`: a raw table with no entity metadata. */
|
|
1004
|
+
function registerJoinTable(handle, ctx, assigner) {
|
|
1005
|
+
const alias = assigner.getAlias(handle.joinTableName);
|
|
1006
|
+
ctx.register(handle, alias);
|
|
1007
|
+
return () => ({
|
|
1008
|
+
handle,
|
|
1009
|
+
alias,
|
|
1010
|
+
sql: `${kq(handle.joinTableName)} AS ${kq(alias)}`,
|
|
1011
|
+
bindings: [],
|
|
1012
|
+
refs: [],
|
|
1013
|
+
entitySelects: [],
|
|
1014
|
+
meta: void 0
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
/** Generates the `select` clause SQL and returns how to decode the resulting rows. */
|
|
1018
|
+
function selectsToSql(q, ctx, from, entitySelects) {
|
|
1019
|
+
const { select } = q;
|
|
1020
|
+
if (isTable(select) && !isEntityTable(select)) fail("A custom table cannot be selected as an entity; select its columns individually");
|
|
1021
|
+
if (isEntityTable(select)) {
|
|
1022
|
+
if (from.handle !== getTableMgmt(select)) fail("Selecting a joined table is not supported yet; select the from table, or select its columns individually");
|
|
1023
|
+
const alias = ctx.aliasFor(getTableMgmt(select));
|
|
1024
|
+
const meta = getTableMetadata(select);
|
|
1025
|
+
return {
|
|
1026
|
+
selects: entitySelects ?? from.entitySelects.map((s) => ({
|
|
1027
|
+
sql: s,
|
|
1028
|
+
bindings: [],
|
|
1029
|
+
refs: [alias]
|
|
1030
|
+
})),
|
|
1031
|
+
decodeRows: (em, rows) => em.hydrate(meta.cstr, rows),
|
|
1032
|
+
output: {
|
|
1033
|
+
kind: "entity",
|
|
1034
|
+
columns: []
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
} else if (isSubqueryValue(select)) {
|
|
1038
|
+
const handle = readValueHandle(select);
|
|
1039
|
+
if (from.handle !== handle) fail("Selecting a joined subquery is not supported; select the from subquery, or select its columns individually");
|
|
1040
|
+
const alias = ctx.aliasFor(handle);
|
|
1041
|
+
const output = handle.output();
|
|
1042
|
+
return {
|
|
1043
|
+
selects: output.columns.map(([k]) => ({
|
|
1044
|
+
sql: `${safeKq(alias)}.${safeKq(k)} AS ${safeKq(k)}`,
|
|
1045
|
+
bindings: [],
|
|
1046
|
+
refs: [alias]
|
|
1047
|
+
})),
|
|
1048
|
+
decodeRows: (_, rows) => rows.map((row) => decodeRow(row, output.columns)),
|
|
1049
|
+
output
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
return projectionToSql(select, ctx, q.join);
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Builds the mandatory CTI joins and flat row projection needed by entity hydration.
|
|
1056
|
+
*
|
|
1057
|
+
* The joins use the same ParsedJoin path as user joins, but `keep: true` makes them survive pruning.
|
|
1058
|
+
* They are generated only for an entity selection of the from source; POJO and scalar reads keep their
|
|
1059
|
+
* physical-table behavior. User source aliases have already been allocated, so the preferred `_bN` and
|
|
1060
|
+
* `_sN` aliases can be made unique before their projection fragments are built.
|
|
1061
|
+
*/
|
|
1062
|
+
function ctiEntityPlan(q, from, assigner) {
|
|
1063
|
+
if (!isEntityTable(q.select) || from.handle !== getTableMgmt(q.select)) return {
|
|
1064
|
+
joins: [],
|
|
1065
|
+
selects: void 0
|
|
1066
|
+
};
|
|
1067
|
+
const meta = getTableMetadata(q.select);
|
|
1068
|
+
if (meta.inheritanceType !== "cti") return {
|
|
1069
|
+
joins: [],
|
|
1070
|
+
selects: void 0
|
|
1071
|
+
};
|
|
1072
|
+
const joins = [];
|
|
1073
|
+
const selects = from.entitySelects.map((sql) => ({
|
|
1074
|
+
sql,
|
|
1075
|
+
bindings: [],
|
|
1076
|
+
refs: [from.alias]
|
|
1077
|
+
}));
|
|
1078
|
+
for (const [i, baseMeta] of meta.baseTypes.entries()) {
|
|
1079
|
+
const alias = assigner.getLiteralAlias(`${from.alias}_b${i}`);
|
|
1080
|
+
joins.push(ctiJoin(from, baseMeta, alias));
|
|
1081
|
+
selects.push(...entitySelectFragments(baseMeta, alias));
|
|
1082
|
+
}
|
|
1083
|
+
const subtypeColumns = /* @__PURE__ */ new Map();
|
|
1084
|
+
for (const [i, subtypeMeta] of meta.subTypes.entries()) {
|
|
1085
|
+
const alias = assigner.getLiteralAlias(`${from.alias}_s${i}`);
|
|
1086
|
+
joins.push(ctiJoin(from, subtypeMeta, alias));
|
|
1087
|
+
selects.push(...entitySelectFragments(subtypeMeta, alias));
|
|
1088
|
+
for (const field of Object.values(subtypeMeta.fields)) {
|
|
1089
|
+
if (field.fieldName === "id" || !field.serde || field.kind === "primitive" && field.lazy) continue;
|
|
1090
|
+
for (const column of field.serde.columns) {
|
|
1091
|
+
const aliases = subtypeColumns.get(column.columnName);
|
|
1092
|
+
if (aliases) aliases.push(alias);
|
|
1093
|
+
else subtypeColumns.set(column.columnName, [alias]);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
selects.push({
|
|
1098
|
+
sql: `${safeKq(from.alias)}.${kq("id")} AS ${kq("id")}`,
|
|
1099
|
+
bindings: [],
|
|
1100
|
+
refs: [from.alias]
|
|
1101
|
+
});
|
|
1102
|
+
for (const [column, aliases] of subtypeColumns) {
|
|
1103
|
+
if (aliases.length < 2) continue;
|
|
1104
|
+
selects.push({
|
|
1105
|
+
sql: `COALESCE(${aliases.map((alias) => `${safeKq(alias)}.${kq(column)}`).join(", ")}) AS ${kq(column)}`,
|
|
1106
|
+
bindings: [],
|
|
1107
|
+
refs: aliases
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
if (meta.subTypes.length > 0) {
|
|
1111
|
+
const subtypeAliases = joins.slice(meta.baseTypes.length).map((join) => join.source.alias);
|
|
1112
|
+
selects.push({
|
|
1113
|
+
sql: `CASE ${subtypeAliases.map((alias) => `WHEN ${safeKq(alias)}.${kq("id")} IS NOT NULL THEN ?`).join(" ")} ELSE '_' END AS ${kq("__class")}`,
|
|
1114
|
+
bindings: meta.subTypes.map((subtype) => subtype.type),
|
|
1115
|
+
refs: subtypeAliases
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
return {
|
|
1119
|
+
joins,
|
|
1120
|
+
selects
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
/** Adds the discriminator projection and subtype filter required by STI entity hydration. */
|
|
1124
|
+
function stiEntityPlan(q, from) {
|
|
1125
|
+
if (!isEntityTable(q.select) || from.handle !== getTableMgmt(q.select)) return {
|
|
1126
|
+
selects: void 0,
|
|
1127
|
+
conditions: []
|
|
1128
|
+
};
|
|
1129
|
+
const meta = getTableMetadata(q.select);
|
|
1130
|
+
if (meta.inheritanceType !== "sti") return {
|
|
1131
|
+
selects: void 0,
|
|
1132
|
+
conditions: []
|
|
1133
|
+
};
|
|
1134
|
+
const selects = from.entitySelects.map((sql) => ({
|
|
1135
|
+
sql,
|
|
1136
|
+
bindings: [],
|
|
1137
|
+
refs: [from.alias]
|
|
1138
|
+
}));
|
|
1139
|
+
if (!(from.entitySelects.length === 1 && from.entitySelects[0] === kqStar(from.alias))) {
|
|
1140
|
+
const discriminator = getBaseMeta(meta).stiDiscriminatorColumnName;
|
|
1141
|
+
selects.push({
|
|
1142
|
+
sql: `${safeKq(from.alias)}.${kq(discriminator)} AS ${kq(discriminator)}`,
|
|
1143
|
+
bindings: [],
|
|
1144
|
+
refs: [from.alias]
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
const condition = stiSubtypeFilter(meta, from.alias);
|
|
1148
|
+
return {
|
|
1149
|
+
selects,
|
|
1150
|
+
conditions: condition ? [condition] : []
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
/** Creates one mandatory CTI join through the selected source's primary key. */
|
|
1154
|
+
function ctiJoin(from, meta, alias) {
|
|
1155
|
+
const on = {
|
|
1156
|
+
sql: `${safeKq(from.alias)}.${kq("id")} = ${safeKq(alias)}.${kq("id")}`,
|
|
1157
|
+
bindings: [],
|
|
1158
|
+
refs: [from.alias, alias]
|
|
1159
|
+
};
|
|
1160
|
+
return {
|
|
1161
|
+
kind: "left",
|
|
1162
|
+
source: {
|
|
1163
|
+
handle: {
|
|
1164
|
+
tableName: meta.tableName,
|
|
1165
|
+
meta
|
|
1166
|
+
},
|
|
1167
|
+
alias,
|
|
1168
|
+
sql: `${kq(meta.tableName)} AS ${safeKq(alias)}`,
|
|
1169
|
+
bindings: [],
|
|
1170
|
+
refs: [],
|
|
1171
|
+
entitySelects: [],
|
|
1172
|
+
meta
|
|
1173
|
+
},
|
|
1174
|
+
userOn: on,
|
|
1175
|
+
fullOn: on,
|
|
1176
|
+
keep: true
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
/** Selects one physical CTI table while preserving lazy-field exclusions. */
|
|
1180
|
+
function entitySelectFragments(meta, alias) {
|
|
1181
|
+
return (meta.hasLazyColumns ? lazyExcludedSelects(meta, alias) : [kqStar(alias)]).map((sql) => ({
|
|
1182
|
+
sql,
|
|
1183
|
+
bindings: [],
|
|
1184
|
+
refs: [alias]
|
|
1185
|
+
}));
|
|
1186
|
+
}
|
|
1187
|
+
function decodeRow(row, decoders) {
|
|
1188
|
+
const result = {};
|
|
1189
|
+
for (const [key, expr] of decoders) {
|
|
1190
|
+
const value = row[key];
|
|
1191
|
+
const decoded = decodeValue(expr, value);
|
|
1192
|
+
if (key === "__proto__") Object.defineProperty(result, key, {
|
|
1193
|
+
value: decoded,
|
|
1194
|
+
enumerable: true,
|
|
1195
|
+
configurable: true,
|
|
1196
|
+
writable: true
|
|
1197
|
+
});
|
|
1198
|
+
else result[key] = decoded;
|
|
1199
|
+
}
|
|
1200
|
+
return result;
|
|
1201
|
+
}
|
|
1202
|
+
/** Decodes a top-level projected SQL NULL using Joist's undefined convention. */
|
|
1203
|
+
function decodeValue(expr, value) {
|
|
1204
|
+
return value === null ? void 0 : expr.decode(value);
|
|
1205
|
+
}
|
|
1206
|
+
const ORDER_BY_DIRECTIONS = [
|
|
1207
|
+
"ASC",
|
|
1208
|
+
"DESC",
|
|
1209
|
+
"ASC NULLS FIRST",
|
|
1210
|
+
"ASC NULLS LAST",
|
|
1211
|
+
"DESC NULLS FIRST",
|
|
1212
|
+
"DESC NULLS LAST"
|
|
1213
|
+
];
|
|
1214
|
+
/**
|
|
1215
|
+
* Generates ORDER BY SQL in entry order for keyed/expression arrays or a single entry.
|
|
1216
|
+
*
|
|
1217
|
+
* Expression entries retain bindings and alias references for join pruning. Undefined entries and
|
|
1218
|
+
* directions are omitted before expression references are collected.
|
|
1219
|
+
*/
|
|
1220
|
+
function orderBysToSql(q, ctx) {
|
|
1221
|
+
const { orderBy, select } = q;
|
|
1222
|
+
if (!orderBy) return [];
|
|
1223
|
+
const result = [];
|
|
1224
|
+
for (const entry of Array.isArray(orderBy) ? orderBy : [orderBy]) {
|
|
1225
|
+
if (entry === void 0) continue;
|
|
1226
|
+
if (isExpr(entry.sort)) {
|
|
1227
|
+
const fragment = orderByToSql(entry, ctx);
|
|
1228
|
+
if (fragment) result.push(fragment);
|
|
1229
|
+
continue;
|
|
1230
|
+
}
|
|
1231
|
+
for (const [key, dir] of Object.entries(entry)) {
|
|
1232
|
+
if (dir === void 0) continue;
|
|
1233
|
+
if (!ORDER_BY_DIRECTIONS.includes(dir)) return fail(`Invalid orderBy direction '${dir}'`);
|
|
1234
|
+
if (isTable(select)) {
|
|
1235
|
+
const column = select[key];
|
|
1236
|
+
if (!isExpr(column)) return fail(`orderBy key '${key}' is not a sortable column of the table`);
|
|
1237
|
+
const fragment = asNode(column).toSql(ctx);
|
|
1238
|
+
result.push({
|
|
1239
|
+
...fragment,
|
|
1240
|
+
sql: `${fragment.sql} ${dir}`
|
|
1241
|
+
});
|
|
1242
|
+
} else {
|
|
1243
|
+
if (isExpr(select)) return fail(`the keyed orderBy form needs a POJO or entity select`);
|
|
1244
|
+
if (!(isSubqueryValue(select) ? select[subqueryBrand].columnKeys() : projectionOutput(select).columns.map(([key]) => key)).includes(key)) return fail(`orderBy key '${key}' is not a key of select`);
|
|
1245
|
+
result.push({
|
|
1246
|
+
sql: `${safeKq(key)} ${dir}`,
|
|
1247
|
+
bindings: [],
|
|
1248
|
+
refs: []
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
return result;
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Parses a user-facing condition (a single condition or an `{ and }`/`{ or }` filter) with the same
|
|
1257
|
+
* `ConditionBuilder` `em.find` uses, so `undefined` members drop out, empty groups drop, and
|
|
1258
|
+
* `pruneIfUndefined` applies unchanged. Deferred SQL expression conditions are resolved
|
|
1259
|
+
* against the context first.
|
|
1260
|
+
*/
|
|
1261
|
+
function conditionToSql(cond, ctx, topLevel) {
|
|
1262
|
+
checkCondition(cond);
|
|
1263
|
+
if (cond === void 0) return void 0;
|
|
1264
|
+
const resolved = resolveDeferredConditions(resolveQueryCondition(cond, ctx), ctx);
|
|
1265
|
+
if (resolved === void 0) return void 0;
|
|
1266
|
+
const filter = isFilter(resolved) ? resolved : { and: [resolved] };
|
|
1267
|
+
const cb = new ConditionBuilder();
|
|
1268
|
+
cb.maybeAddExpression(filter);
|
|
1269
|
+
const parsed = cb.toExpressionFilter();
|
|
1270
|
+
if (!parsed) return void 0;
|
|
1271
|
+
const where = buildWhereClause(parsed, topLevel);
|
|
1272
|
+
if (!where) return void 0;
|
|
1273
|
+
return {
|
|
1274
|
+
sql: where[0],
|
|
1275
|
+
bindings: where[1],
|
|
1276
|
+
refs: refsOf(parsed)
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Rejects malformed predicates throughout a condition tree before pruning can discard a restriction.
|
|
1281
|
+
* I.e. an invalid Author-name condition stays invalid even inside a group that would otherwise prune,
|
|
1282
|
+
* while an explicitly omitted query-valued condition is allowed to prune.
|
|
1283
|
+
*/
|
|
1284
|
+
function checkCondition(value) {
|
|
1285
|
+
if (isDeferredAliasCondition(value) || value && typeof value === "object" && predicateBrand in value && value[predicateBrand] === "domain") fail("Domain alias conditions are only supported by em.find; use table(...) predicates in SQL queries and mutations.");
|
|
1286
|
+
if (value === void 0 || value === skipCondition) return;
|
|
1287
|
+
if (isInQueryCondition(value)) {
|
|
1288
|
+
checkCondition(normalizeWhere(normalizeQueryJoins(toQuery(value[inQueryCondition].query)).where));
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
if (!value || typeof value !== "object" || Array.isArray(value) || isExpr(value)) fail("Query predicate must be a condition or an and/or group");
|
|
1292
|
+
const condition = value;
|
|
1293
|
+
if ("and" in condition || "or" in condition) {
|
|
1294
|
+
if ("and" in condition === "or" in condition) fail("Query conditions require exactly one and/or group");
|
|
1295
|
+
const key = "and" in condition ? "and" : "or";
|
|
1296
|
+
checkConditionKeys(condition, [key, "pruneIfUndefined"], "Query condition group");
|
|
1297
|
+
if (!Array.isArray(condition[key])) fail("Query condition groups require an array");
|
|
1298
|
+
if (condition.pruneIfUndefined !== void 0 && condition.pruneIfUndefined !== "any" && condition.pruneIfUndefined !== "all") fail("Invalid query pruneIfUndefined policy");
|
|
1299
|
+
for (const child of condition[key]) checkCondition(child);
|
|
1300
|
+
} else if ("exists" in condition || "notExists" in condition) {
|
|
1301
|
+
const key = "exists" in condition ? "exists" : "notExists";
|
|
1302
|
+
checkConditionKeys(condition, [key], "Query existence condition");
|
|
1303
|
+
const query = condition[key];
|
|
1304
|
+
if (query === void 0) return;
|
|
1305
|
+
if (!(query instanceof SubqueryExpr) && !isReadQueryValue(query)) fail(`Query ${key} requires a query(...) value`);
|
|
1306
|
+
toQuery(query);
|
|
1307
|
+
} else if (condition.kind === "raw") {
|
|
1308
|
+
checkConditionKeys(condition, [
|
|
1309
|
+
"kind",
|
|
1310
|
+
"aliases",
|
|
1311
|
+
"condition",
|
|
1312
|
+
"bindings",
|
|
1313
|
+
"pruneable",
|
|
1314
|
+
deferredSym,
|
|
1315
|
+
predicateBrand
|
|
1316
|
+
], "Query raw condition");
|
|
1317
|
+
if (typeof condition.condition !== "string" || !Array.isArray(condition.aliases) || !condition.aliases.every((alias) => typeof alias === "string") || !Array.isArray(condition.bindings) || typeof condition.pruneable !== "boolean") fail("Malformed query raw condition");
|
|
1318
|
+
} else if (condition.kind === "column") {
|
|
1319
|
+
checkConditionKeys(condition, [
|
|
1320
|
+
"kind",
|
|
1321
|
+
"alias",
|
|
1322
|
+
"column",
|
|
1323
|
+
"dbType",
|
|
1324
|
+
"cond",
|
|
1325
|
+
"pruneable",
|
|
1326
|
+
predicateBrand
|
|
1327
|
+
], "Query column condition");
|
|
1328
|
+
if (typeof condition.alias !== "string" || typeof condition.column !== "string" || typeof condition.dbType !== "string" || condition.pruneable !== void 0 && typeof condition.pruneable !== "boolean") fail("Malformed query column condition");
|
|
1329
|
+
const filter = condition.cond;
|
|
1330
|
+
if (!filter) fail("Malformed query column filter");
|
|
1331
|
+
checkConditionKeys(filter, ["kind", "value"], "Query column filter");
|
|
1332
|
+
const unary = filter.kind === "is-null" || filter.kind === "not-null";
|
|
1333
|
+
if (!unary && (![
|
|
1334
|
+
"eq",
|
|
1335
|
+
"ne",
|
|
1336
|
+
"in",
|
|
1337
|
+
"nin",
|
|
1338
|
+
"gt",
|
|
1339
|
+
"gte",
|
|
1340
|
+
"lt",
|
|
1341
|
+
"lte",
|
|
1342
|
+
"like",
|
|
1343
|
+
"nlike",
|
|
1344
|
+
"ilike",
|
|
1345
|
+
"nilike",
|
|
1346
|
+
"regex",
|
|
1347
|
+
"nregex",
|
|
1348
|
+
"iregex",
|
|
1349
|
+
"niregex",
|
|
1350
|
+
"contains",
|
|
1351
|
+
"ncontains",
|
|
1352
|
+
"overlaps",
|
|
1353
|
+
"noverlaps",
|
|
1354
|
+
"containedBy",
|
|
1355
|
+
"between",
|
|
1356
|
+
"jsonPathExists",
|
|
1357
|
+
"jsonPathPredicate"
|
|
1358
|
+
].includes(filter.kind) || !("value" in filter))) fail("Malformed query column filter");
|
|
1359
|
+
if (unary && "value" in filter) fail("Unary query filters do not accept values");
|
|
1360
|
+
} else fail("Unknown query condition");
|
|
1361
|
+
}
|
|
1362
|
+
/** Conditions use own enumerable POJO fields, with predicate-brand and SQL-resolver symbols allowed. */
|
|
1363
|
+
function checkConditionKeys(value, allowed, description) {
|
|
1364
|
+
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) fail(`${description} must be a plain POJO`);
|
|
1365
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
1366
|
+
if (!allowed.includes(key)) fail(`${description} does not support '${String(key)}'`);
|
|
1367
|
+
if (typeof key === "string" && !Object.prototype.propertyIsEnumerable.call(value, key)) fail(`${description} requires enumerable fields`);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Converts query-valued predicates to SQL conditions for the shared condition builder.
|
|
1372
|
+
* Keeps each subquery's projection and reports its outer aliases for join pruning.
|
|
1373
|
+
*/
|
|
1374
|
+
function resolveQueryCondition(cond, ctx) {
|
|
1375
|
+
if (cond === void 0) return void 0;
|
|
1376
|
+
if (isInQueryCondition(cond)) {
|
|
1377
|
+
const { column, query } = cond[inQueryCondition];
|
|
1378
|
+
const value = createMaybeQueryValue(query);
|
|
1379
|
+
if (value === void 0) return void 0;
|
|
1380
|
+
if (!isExpr(value)) return fail("An in query literal must select one expression");
|
|
1381
|
+
return column.in(value);
|
|
1382
|
+
}
|
|
1383
|
+
if ("and" in cond && cond.and) return {
|
|
1384
|
+
and: cond.and.map((child) => resolveQueryCondition(child, ctx)),
|
|
1385
|
+
pruneIfUndefined: cond.pruneIfUndefined
|
|
1386
|
+
};
|
|
1387
|
+
if ("or" in cond && cond.or) return {
|
|
1388
|
+
or: cond.or.map((child) => resolveQueryCondition(child, ctx)),
|
|
1389
|
+
pruneIfUndefined: cond.pruneIfUndefined
|
|
1390
|
+
};
|
|
1391
|
+
if ("exists" in cond || "notExists" in cond) {
|
|
1392
|
+
const positive = "exists" in cond;
|
|
1393
|
+
const subquery = positive ? cond.exists : cond.notExists;
|
|
1394
|
+
if (subquery === void 0) return void 0;
|
|
1395
|
+
const plan = parseQuery(toQuery(subquery), ctx, ctx.assigner);
|
|
1396
|
+
return {
|
|
1397
|
+
kind: "raw",
|
|
1398
|
+
condition: `${positive ? "EXISTS" : "NOT EXISTS"} (${plan.sql})`,
|
|
1399
|
+
bindings: plan.bindings,
|
|
1400
|
+
aliases: plan.outerRefs,
|
|
1401
|
+
pruneable: false
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
return cond;
|
|
1405
|
+
}
|
|
1406
|
+
function isFilter(cond) {
|
|
1407
|
+
return "and" in cond && cond.and !== void 0 || "or" in cond && cond.or !== void 0;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Checks structural pruning without resolving SQL or correlated aliases.
|
|
1411
|
+
*
|
|
1412
|
+
* Keeps individual predicates and applies ConditionBuilder's pruning policy (i.e. pruneIfUndefined) to groups.
|
|
1413
|
+
* I.e. an Author condition AND an omitted Book condition survives unless the group uses `any`.
|
|
1414
|
+
*/
|
|
1415
|
+
function isPrunedQueryCondition(cond) {
|
|
1416
|
+
if (cond === void 0 || cond === skipCondition) return true;
|
|
1417
|
+
if (isInQueryCondition(cond)) return isPrunedQueryCondition(normalizeWhere(normalizeQueryJoins(cond[inQueryCondition].query).where));
|
|
1418
|
+
if ("and" in cond || "or" in cond) {
|
|
1419
|
+
const children = (cond.and ?? cond.or ?? []).map(isPrunedQueryCondition);
|
|
1420
|
+
return children.every((pruned) => pruned) || "pruneIfUndefined" in cond && cond.pruneIfUndefined === "any" && children.some((pruned) => pruned);
|
|
1421
|
+
}
|
|
1422
|
+
if ("exists" in cond) return cond.exists === void 0;
|
|
1423
|
+
if ("notExists" in cond) return cond.notExists === void 0;
|
|
1424
|
+
return false;
|
|
1425
|
+
}
|
|
1426
|
+
/** Recognizes the direct query-literal condition created by EntityColumn.in. */
|
|
1427
|
+
function isInQueryCondition(value) {
|
|
1428
|
+
return typeof value === "object" && value !== null && inQueryCondition in value;
|
|
1429
|
+
}
|
|
1430
|
+
/** The physical source aliases a parsed condition tree references. */
|
|
1431
|
+
function refsOf(parsed) {
|
|
1432
|
+
return deepFindConditions(parsed, false).flatMap((c) => c.kind === "column" ? [c.alias] : c.kind === "raw" ? c.aliases : c.outerAliases);
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Pruning: em.find's paradigm, on a flat join list.
|
|
1436
|
+
*
|
|
1437
|
+
* A condition given `undefined` was already dropped by `ConditionBuilder`. Now a join that nothing
|
|
1438
|
+
* references anymore drops with it: a join is required if the source, a select, a surviving condition,
|
|
1439
|
+
* a group-by, an order-by, or another required join's ON references it, or if it is pinned with
|
|
1440
|
+
* `keep: true`. Marking follows ON dependencies transitively, exactly like `pruneUnusedJoins`'s
|
|
1441
|
+
* `DependencyTracker`.
|
|
1442
|
+
*
|
|
1443
|
+
* em.find's joins almost never filter rows by themselves, so pruning them is semantics-preserving. An
|
|
1444
|
+
* explicit `{ inner: b, on }` here does filter rows, so pruning it when unreferenced drops that filter;
|
|
1445
|
+
* that matches `{ books: { title: undefined } }` in em.find and is deliberate. `keep: true` pins it, and
|
|
1446
|
+
* a pure existence filter is better written as `a.id.in(query({ ... }))`, which is never `undefined`.
|
|
1447
|
+
*
|
|
1448
|
+
* CTEs prune on the same rule and through the same dependency map: a `with` entry nothing reads
|
|
1449
|
+
* anymore drops with the join that read it, and a CTE read only by another CTE survives with it.
|
|
1450
|
+
* A CTE joined into the query shares its alias with that join, so their dependencies are merged.
|
|
1451
|
+
*
|
|
1452
|
+
* The one join that never prunes is a recursive term's reference to its own CTE: PostgreSQL requires
|
|
1453
|
+
* it, so it is not the caller's optional filter (see `Ctx.recursiveSelf`).
|
|
1454
|
+
*/
|
|
1455
|
+
function pruneJoins(q, ctx, from, joins, ctes, used) {
|
|
1456
|
+
if (q.pruneJoins === false) return {
|
|
1457
|
+
joins,
|
|
1458
|
+
ctes
|
|
1459
|
+
};
|
|
1460
|
+
const deps = /* @__PURE__ */ new Map();
|
|
1461
|
+
function addDeps(alias, refs) {
|
|
1462
|
+
const own = refs.filter((r) => r !== alias);
|
|
1463
|
+
const existing = deps.get(alias);
|
|
1464
|
+
if (existing) existing.push(...own);
|
|
1465
|
+
else deps.set(alias, own);
|
|
1466
|
+
}
|
|
1467
|
+
for (const j of joins) addDeps(j.source.alias, [...j.userOn?.refs ?? [], ...j.source.refs]);
|
|
1468
|
+
for (const c of ctes) addDeps(c.alias, c.plan.outerRefs);
|
|
1469
|
+
const required = /* @__PURE__ */ new Set();
|
|
1470
|
+
function markRequired(alias) {
|
|
1471
|
+
if (required.has(alias)) return;
|
|
1472
|
+
required.add(alias);
|
|
1473
|
+
for (const dep of deps.get(alias) ?? []) markRequired(dep);
|
|
1474
|
+
}
|
|
1475
|
+
markRequired(from.alias);
|
|
1476
|
+
for (const r of used.flatMap((u) => u.refs)) markRequired(r);
|
|
1477
|
+
for (const j of joins) if (j.keep) markRequired(j.source.alias);
|
|
1478
|
+
for (const j of joins) if (j.source.handle === ctx.recursiveSelf) markRequired(j.source.alias);
|
|
1479
|
+
return {
|
|
1480
|
+
joins: joins.filter((j) => required.has(j.source.alias)),
|
|
1481
|
+
ctes: ctes.filter((c) => required.has(c.alias))
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Names and parses each `with` entry, in declaration order.
|
|
1486
|
+
*
|
|
1487
|
+
* Each entry is in scope before the next is parsed, so a CTE can read an *earlier* sibling by name,
|
|
1488
|
+
* PostgreSQL's rule for a non-recursive WITH. A forward reference, or a CTE reading the query's own
|
|
1489
|
+
* `from`, fails as "not in this query's from/join", the same error any out-of-scope source gets.
|
|
1490
|
+
*
|
|
1491
|
+
* I.e. `with: [totals, ranked]` parses `totals` first, so `ranked` can join it, but not the reverse.
|
|
1492
|
+
*/
|
|
1493
|
+
function registerCtes(q, ctx, assigner) {
|
|
1494
|
+
const handles = (q.with === void 0 ? [] : Array.isArray(q.with) ? q.with : [q.with]).filter(isDefined).map(withEntryHandle);
|
|
1495
|
+
const aliases = handles.map((handle) => assigner.getLiteralAlias(handle.name ?? "cte"));
|
|
1496
|
+
handles.forEach((handle, i) => ctx.declareCte(handle, aliases[i]));
|
|
1497
|
+
return handles.map((handle, i) => {
|
|
1498
|
+
if (handle.recursive) ctx.promoteCte(handle);
|
|
1499
|
+
const plan = parseQuery(handle.q, ctx, assigner, handle.recursive ? handle : void 0);
|
|
1500
|
+
if (!handle.recursive) ctx.promoteCte(handle);
|
|
1501
|
+
return {
|
|
1502
|
+
alias: aliases[i],
|
|
1503
|
+
plan,
|
|
1504
|
+
recursive: handle.recursive
|
|
1505
|
+
};
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
/** A CTE must be a table shape, so entity-mode and scalar values, which have no columns, are out. */
|
|
1509
|
+
function withEntryHandle(entry) {
|
|
1510
|
+
if (!isSubqueryValue(entry)) fail(entry instanceof SubqueryExpr || isEntityQueryValue(entry) ? "A `with` entry needs named columns; entity and scalar query(...) values have none" : "A `with` entry must be a query(...) value");
|
|
1511
|
+
return readValueHandle(entry);
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* Drops the CTEs that nothing reads, given the aliases the rest of the statement referenced.
|
|
1515
|
+
*
|
|
1516
|
+
* A CTE can only read earlier siblings, so going last to first means every CTE that could read this one
|
|
1517
|
+
* was already visited, and its own reads are already in `referenced`. That makes one pass enough; first
|
|
1518
|
+
* to last would have to repeat until the set stopped growing. `unshift` restores WITH order.
|
|
1519
|
+
*/
|
|
1520
|
+
function pruneCtes(ctes, referenced) {
|
|
1521
|
+
const kept = [];
|
|
1522
|
+
for (let i = ctes.length - 1; i >= 0; i--) {
|
|
1523
|
+
const cte = ctes[i];
|
|
1524
|
+
if (!referenced.has(cte.alias)) continue;
|
|
1525
|
+
for (const ref of cte.plan.outerRefs) referenced.add(ref);
|
|
1526
|
+
kept.unshift(cte);
|
|
1527
|
+
}
|
|
1528
|
+
return kept;
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* Renders `WITH a AS (...), b AS (...) `, whose bindings lead the statement, as their SQL does.
|
|
1532
|
+
*
|
|
1533
|
+
* One recursive CTE makes the whole clause `WITH RECURSIVE`, PostgreSQL's rule: the keyword is on the
|
|
1534
|
+
* clause, not on the entry that needs it, and it does not force the other entries to be recursive.
|
|
1535
|
+
*/
|
|
1536
|
+
function withFragment(ctes) {
|
|
1537
|
+
return {
|
|
1538
|
+
sql: `WITH${ctes.some((c) => c.recursive) ? " RECURSIVE" : ""} ${ctes.map((c) => `${safeKq(c.alias)} AS (${c.plan.sql})`).join(", ")} `,
|
|
1539
|
+
bindings: ctes.flatMap((c) => c.plan.bindings),
|
|
1540
|
+
refs: []
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
function asExpr(value, where) {
|
|
1544
|
+
if (value instanceof BaseExpr) return value;
|
|
1545
|
+
return fail(`${where} must be an expression, i.e. a table column, aggregate, sql\`...\`, or scalar query(...)`);
|
|
1546
|
+
}
|
|
1547
|
+
/** Builds inline select expressions while leaving existing expression instances intact. */
|
|
1548
|
+
function asSelectExpr(value, where) {
|
|
1549
|
+
if (value instanceof BaseExpr) return value;
|
|
1550
|
+
if (isPlainSelect(value)) return buildExpr(value);
|
|
1551
|
+
return fail(`${where} must be a column, an expression, or an expression literal`);
|
|
1552
|
+
}
|
|
1553
|
+
function joinFragmentParts(parts, sep) {
|
|
1554
|
+
return {
|
|
1555
|
+
sql: parts.map((p) => p.sql).join(sep),
|
|
1556
|
+
bindings: parts.flatMap((p) => p.bindings),
|
|
1557
|
+
refs: []
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
function isDefined(value) {
|
|
1561
|
+
return value !== void 0;
|
|
1562
|
+
}
|
|
1563
|
+
/** Lowers a relationship tree before SQL rendering or output nullability is calculated. */
|
|
1564
|
+
function normalizeQueryJoins(q) {
|
|
1565
|
+
if (q.join === void 0 || Array.isArray(q.join)) return q;
|
|
1566
|
+
const tree = compileJoinTree(q.from, q.join);
|
|
1567
|
+
return {
|
|
1568
|
+
...q,
|
|
1569
|
+
join: tree.joins,
|
|
1570
|
+
where: { and: [tree.condition, normalizeWhere(q.where)] }
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
/** Gives WHERE arrays the same pruning and validation as explicit AND groups. */
|
|
1574
|
+
function normalizeWhere(where) {
|
|
1575
|
+
return Array.isArray(where) ? { and: where } : where;
|
|
1576
|
+
}
|
|
1577
|
+
/** Creates the runtime query value after the public signature has checked its input. */
|
|
1578
|
+
function createQueryValue(q) {
|
|
1579
|
+
const handle = new SubqueryHandle(toQuery(q));
|
|
1580
|
+
const output = handle.output();
|
|
1581
|
+
if (output.kind === "entity") return { [entityQueryBrand]: handle };
|
|
1582
|
+
else if (output.kind === "scalar") return new SubqueryExpr(handle);
|
|
1583
|
+
else return newSubqueryProxy(handle);
|
|
1584
|
+
}
|
|
1585
|
+
/** Keeps shorthand declarations callable-only, without recursively copying sql's own shorthand properties. */
|
|
1586
|
+
function typedSql(strings, ...values) {
|
|
1587
|
+
return new TemplateExpr(strings, values);
|
|
1588
|
+
}
|
|
1589
|
+
//#endregion
|
|
1590
|
+
export { Ctx, SubqueryHandle, conditionToSql, entityQueryBrand, injectedConditions, isReadQueryValue, parseNestedQuery, parseUserQuery, projectionToSql, pruneCtes, query, queryMaybe, recursiveQuery, registerCtes, scalarQueryBrand, sql, subqueryBrand, withFragment };
|
|
1591
|
+
|
|
1592
|
+
//# sourceMappingURL=query.js.map
|