joist-core 2.3.0-next.95 → 2.3.0-next.97
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/EntityManager.cjs +36 -39
- package/build/EntityManager.cjs.map +1 -1
- package/build/EntityManager.d.cts +4 -4
- package/build/EntityManager.d.mts +4 -4
- package/build/EntityManager.js +29 -32
- package/build/EntityManager.js.map +1 -1
- package/build/EntityMetadata.cjs +3 -3
- package/build/EntityMetadata.js +3 -3
- package/build/IndexManager.cjs +1 -1
- package/build/IndexManager.js +1 -1
- package/build/InstanceData.cjs +1 -1
- package/build/InstanceData.js +1 -1
- package/build/JoinRows.cjs +1 -1
- package/build/JoinRows.js +1 -1
- package/build/PluginManager.cjs +0 -1
- package/build/PluginManager.cjs.map +1 -1
- package/build/PluginManager.d.cts +1 -1
- package/build/PluginManager.d.mts +1 -1
- package/build/PluginManager.js +0 -1
- package/build/PluginManager.js.map +1 -1
- package/build/ReactionsManager.cjs +2 -2
- package/build/ReactionsManager.js +2 -2
- package/build/Todo.cjs +1 -1
- package/build/Todo.js +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.cjs +1 -1
- package/build/batchloaders/enumCollectionBatchLoader.js +1 -1
- package/build/batchloaders/loadBatchLoader.cjs +6 -5
- package/build/batchloaders/loadBatchLoader.cjs.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.cts.map +1 -1
- package/build/batchloaders/loadBatchLoader.d.mts.map +1 -1
- package/build/batchloaders/loadBatchLoader.js +4 -3
- package/build/batchloaders/loadBatchLoader.js.map +1 -1
- package/build/batchloaders/manyToManyBatchLoader.cjs +1 -1
- package/build/batchloaders/manyToManyBatchLoader.js +1 -1
- package/build/batchloaders/oneToManyBatchLoader.cjs +3 -3
- package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToManyBatchLoader.js +2 -2
- package/build/batchloaders/oneToOneBatchLoader.cjs +4 -4
- package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -1
- package/build/batchloaders/oneToOneBatchLoader.js +3 -3
- package/build/batchloaders/populateBatchLoader.cjs +11 -11
- package/build/batchloaders/populateBatchLoader.cjs.map +1 -1
- package/build/batchloaders/populateBatchLoader.js +8 -8
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs +8 -8
- package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveChildrenBatchLoader.js +5 -5
- package/build/batchloaders/recursiveM2mBatchLoader.cjs +5 -5
- package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveM2mBatchLoader.js +2 -2
- package/build/batchloaders/recursiveParentsBatchLoader.cjs +8 -8
- package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -1
- package/build/batchloaders/recursiveParentsBatchLoader.js +5 -5
- package/build/changes.cjs +4 -4
- package/build/changes.js +4 -4
- package/build/config.cjs +3 -3
- package/build/config.js +3 -3
- package/build/configure.cjs +6 -6
- package/build/configure.js +6 -6
- package/build/dataloaders/fastWhereFilterHash.cjs +3 -3
- package/build/dataloaders/fastWhereFilterHash.cjs.map +1 -1
- package/build/dataloaders/fastWhereFilterHash.js +2 -2
- package/build/dataloaders/fastWhereFilterHash.js.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.cjs +5 -6
- package/build/dataloaders/findByUniqueDataLoader.cjs.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findByUniqueDataLoader.js +3 -4
- package/build/dataloaders/findByUniqueDataLoader.js.map +1 -1
- package/build/dataloaders/findCountDataLoader.cjs +10 -13
- package/build/dataloaders/findCountDataLoader.cjs.map +1 -1
- package/build/dataloaders/findCountDataLoader.d.cts +2 -2
- package/build/dataloaders/findCountDataLoader.d.mts +2 -2
- package/build/dataloaders/findCountDataLoader.js +4 -7
- package/build/dataloaders/findCountDataLoader.js.map +1 -1
- package/build/dataloaders/findDataLoader.cjs +15 -19
- package/build/dataloaders/findDataLoader.cjs.map +1 -1
- package/build/dataloaders/findDataLoader.d.cts +2 -2
- package/build/dataloaders/findDataLoader.d.cts.map +1 -1
- package/build/dataloaders/findDataLoader.d.mts +2 -2
- package/build/dataloaders/findDataLoader.d.mts.map +1 -1
- package/build/dataloaders/findDataLoader.js +5 -9
- package/build/dataloaders/findDataLoader.js.map +1 -1
- package/build/dataloaders/findIdsDataLoader.cjs +6 -9
- package/build/dataloaders/findIdsDataLoader.cjs.map +1 -1
- package/build/dataloaders/findIdsDataLoader.d.cts +1 -1
- package/build/dataloaders/findIdsDataLoader.d.mts +1 -1
- package/build/dataloaders/findIdsDataLoader.js +3 -6
- package/build/dataloaders/findIdsDataLoader.js.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.cjs +1 -2
- package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -1
- package/build/dataloaders/findOrCreateDataLoader.js +1 -2
- package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.cjs +3 -6
- package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.cts +1 -1
- package/build/dataloaders/findPaginatedDataLoader.d.mts +1 -1
- package/build/dataloaders/findPaginatedDataLoader.js +2 -5
- package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
- package/build/dataloaders/lensDataLoader.cjs +4 -4
- package/build/dataloaders/lensDataLoader.cjs.map +1 -1
- package/build/dataloaders/lensDataLoader.js +2 -2
- package/build/dataloaders/lensDataLoader.js.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.cjs +1 -4
- package/build/dataloaders/manyToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.cts +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts +0 -1
- package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/manyToManyFindDataLoader.js +1 -4
- package/build/dataloaders/manyToManyFindDataLoader.js.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.cjs +3 -6
- package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts +0 -1
- package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
- package/build/dataloaders/oneToManyFindDataLoader.js +2 -5
- package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
- package/build/defaults.cjs +4 -4
- package/build/defaults.js +4 -4
- package/build/driverApi.cjs +4 -5
- package/build/driverApi.cjs.map +1 -1
- package/build/driverApi.d.cts +1 -1
- package/build/driverApi.d.mts +1 -1
- package/build/driverApi.js +2 -2
- package/build/driverApi.js.map +1 -1
- package/build/drivers/Driver.cjs +0 -1
- package/build/drivers/Driver.d.cts +1 -1
- package/build/drivers/Driver.d.mts +1 -1
- package/build/drivers/Driver.js +0 -1
- package/build/drivers/EntityWriter.cjs +2 -2
- package/build/drivers/EntityWriter.js +2 -2
- package/build/drivers/index.cjs +0 -6
- package/build/drivers/index.d.cts +1 -3
- package/build/drivers/index.d.mts +1 -3
- package/build/drivers/index.js +1 -3
- package/build/fieldSerde.cjs +2 -2
- package/build/fieldSerde.js +2 -2
- package/build/fields.cjs +2 -2
- package/build/fields.js +2 -2
- package/build/getProperties.cjs +1 -1
- package/build/getProperties.js +1 -1
- package/build/index.cjs +109 -106
- package/build/index.cjs.map +1 -1
- package/build/index.d.cts +27 -24
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +27 -24
- package/build/index.d.mts.map +1 -1
- package/build/index.js +52 -50
- package/build/index.js.map +1 -1
- package/build/json.cjs +3 -3
- package/build/json.js +3 -3
- package/build/keys.cjs +1 -1
- package/build/keys.js +1 -1
- package/build/loadHints.cjs +1 -1
- package/build/loadHints.js +1 -1
- package/build/loadLens.cjs +1 -1
- package/build/loadLens.js +1 -1
- package/build/logging/FactoryLogger.cjs +1 -1
- package/build/logging/FactoryLogger.js +1 -1
- package/build/logging/FieldLogger.cjs +1 -1
- package/build/logging/FieldLogger.js +1 -1
- package/build/logging/ReactionLogger.cjs +1 -1
- package/build/logging/ReactionLogger.js +1 -1
- package/build/newEntity.cjs +1 -1
- package/build/newEntity.js +1 -1
- package/build/newTestInstance.cjs +3 -3
- package/build/newTestInstance.js +3 -3
- package/build/plugins/PreloadPlugin.cjs +1 -2
- package/build/plugins/PreloadPlugin.d.cts +1 -1
- package/build/plugins/PreloadPlugin.d.mts +1 -1
- package/build/plugins/PreloadPlugin.js +1 -2
- package/build/preloading/JsonAggregatePreloader.cjs +31 -31
- package/build/preloading/JsonAggregatePreloader.cjs.map +1 -1
- package/build/preloading/JsonAggregatePreloader.d.cts +1 -1
- package/build/preloading/JsonAggregatePreloader.d.mts +1 -1
- package/build/preloading/JsonAggregatePreloader.js +6 -6
- package/build/preloading/JsonAggregatePreloader.js.map +1 -1
- package/build/preloading/partitionHint.cjs +3 -3
- package/build/preloading/partitionHint.js +3 -3
- package/build/{ConditionBuilder.cjs → queries/ConditionBuilder.cjs} +7 -8
- package/build/queries/ConditionBuilder.cjs.map +1 -0
- package/build/{ConditionBuilder.d.cts → queries/ConditionBuilder.d.cts} +3 -3
- package/build/queries/ConditionBuilder.d.cts.map +1 -0
- package/build/{ConditionBuilder.d.mts → queries/ConditionBuilder.d.mts} +3 -3
- package/build/queries/ConditionBuilder.d.mts.map +1 -0
- package/build/{ConditionBuilder.js → queries/ConditionBuilder.js} +4 -5
- package/build/queries/ConditionBuilder.js.map +1 -0
- package/build/{conditions.cjs → queries/conditions.cjs} +1 -2
- package/build/queries/conditions.cjs.map +1 -0
- package/build/{conditions.d.cts → queries/conditions.d.cts} +2 -2
- package/build/queries/conditions.d.cts.map +1 -0
- package/build/{conditions.d.mts → queries/conditions.d.mts} +2 -2
- package/build/queries/conditions.d.mts.map +1 -0
- package/build/{conditions.js → queries/conditions.js} +1 -2
- 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/{Aliases.cjs → queries/find/Aliases.cjs} +23 -28
- package/build/queries/find/Aliases.cjs.map +1 -0
- package/build/{Aliases.d.cts → queries/find/Aliases.d.cts} +7 -7
- package/build/queries/find/Aliases.d.cts.map +1 -0
- package/build/{Aliases.d.mts → queries/find/Aliases.d.mts} +7 -7
- package/build/queries/find/Aliases.d.mts.map +1 -0
- package/build/{Aliases.js → queries/find/Aliases.js} +7 -12
- package/build/queries/find/Aliases.js.map +1 -0
- package/build/{DeferredAlias.cjs → queries/find/DeferredAlias.cjs} +3 -6
- package/build/queries/find/DeferredAlias.cjs.map +1 -0
- package/build/{DeferredAlias.d.cts → queries/find/DeferredAlias.d.cts} +4 -4
- package/build/queries/find/DeferredAlias.d.cts.map +1 -0
- package/build/{DeferredAlias.d.mts → queries/find/DeferredAlias.d.mts} +4 -4
- package/build/queries/find/DeferredAlias.d.mts.map +1 -0
- package/build/{DeferredAlias.js → queries/find/DeferredAlias.js} +2 -5
- package/build/queries/find/DeferredAlias.js.map +1 -0
- package/build/{EntityFilter.cjs → queries/find/EntityFilter.cjs} +4 -9
- package/build/queries/find/EntityFilter.cjs.map +1 -0
- package/build/{EntityFilter.d.cts → queries/find/EntityFilter.d.cts} +6 -6
- package/build/queries/find/EntityFilter.d.cts.map +1 -0
- package/build/{EntityFilter.d.mts → queries/find/EntityFilter.d.mts} +6 -6
- package/build/queries/find/EntityFilter.d.mts.map +1 -0
- package/build/{EntityFilter.js → queries/find/EntityFilter.js} +1 -6
- package/build/queries/find/EntityFilter.js.map +1 -0
- package/build/{EntityGraphQLFilter.cjs → queries/find/EntityGraphQLFilter.cjs} +1 -5
- package/build/queries/find/EntityGraphQLFilter.cjs.map +1 -0
- package/build/{EntityGraphQLFilter.d.cts → queries/find/EntityGraphQLFilter.d.cts} +3 -3
- package/build/queries/find/EntityGraphQLFilter.d.cts.map +1 -0
- package/build/{EntityGraphQLFilter.d.mts → queries/find/EntityGraphQLFilter.d.mts} +3 -3
- package/build/queries/find/EntityGraphQLFilter.d.mts.map +1 -0
- package/build/{EntityGraphQLFilter.js → queries/find/EntityGraphQLFilter.js} +1 -5
- package/build/queries/find/EntityGraphQLFilter.js.map +1 -0
- package/build/{QueryParser.cjs → queries/find/QueryParser.cjs} +68 -356
- package/build/queries/find/QueryParser.cjs.map +1 -0
- package/build/{QueryParser.collectionJoins.cjs → queries/find/QueryParser.collectionJoins.cjs} +8 -8
- package/build/queries/find/QueryParser.collectionJoins.cjs.map +1 -0
- package/build/{QueryParser.collectionJoins.d.cts → queries/find/QueryParser.collectionJoins.d.cts} +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.cts.map +1 -0
- package/build/{QueryParser.collectionJoins.d.mts → queries/find/QueryParser.collectionJoins.d.mts} +1 -1
- package/build/queries/find/QueryParser.collectionJoins.d.mts.map +1 -0
- package/build/{QueryParser.collectionJoins.js → queries/find/QueryParser.collectionJoins.js} +2 -2
- package/build/queries/find/QueryParser.collectionJoins.js.map +1 -0
- package/build/{QueryParser.d.cts → queries/find/QueryParser.d.cts} +5 -159
- package/build/queries/find/QueryParser.d.cts.map +1 -0
- package/build/{QueryParser.d.mts → queries/find/QueryParser.d.mts} +5 -159
- package/build/queries/find/QueryParser.d.mts.map +1 -0
- package/build/{QueryParser.js → queries/find/QueryParser.js} +15 -295
- package/build/queries/find/QueryParser.js.map +1 -0
- package/build/{QueryParser.pruning.cjs → queries/find/QueryParser.pruning.cjs} +6 -20
- 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/{QueryParser.pruning.js → queries/find/QueryParser.pruning.js} +4 -17
- package/build/queries/find/QueryParser.pruning.js.map +1 -0
- package/build/{QueryVisitor.cjs → queries/find/QueryVisitor.cjs} +2 -3
- package/build/queries/find/QueryVisitor.cjs.map +1 -0
- package/build/{QueryVisitor.d.cts → queries/find/QueryVisitor.d.cts} +3 -2
- package/build/queries/find/QueryVisitor.d.cts.map +1 -0
- package/build/{QueryVisitor.d.mts → queries/find/QueryVisitor.d.mts} +3 -2
- package/build/queries/find/QueryVisitor.d.mts.map +1 -0
- package/build/{QueryVisitor.js → queries/find/QueryVisitor.js} +2 -3
- package/build/queries/find/QueryVisitor.js.map +1 -0
- package/build/{drivers/buildRawQuery.cjs → queries/find/buildFindQuery.cjs} +14 -15
- package/build/queries/find/buildFindQuery.cjs.map +1 -0
- package/build/{drivers/buildRawQuery.d.cts → queries/find/buildFindQuery.d.cts} +3 -3
- package/build/queries/find/buildFindQuery.d.cts.map +1 -0
- package/build/{drivers/buildRawQuery.d.mts → queries/find/buildFindQuery.d.mts} +3 -3
- package/build/queries/find/buildFindQuery.d.mts.map +1 -0
- package/build/{drivers/buildRawQuery.js → queries/find/buildFindQuery.js} +5 -6
- package/build/queries/find/buildFindQuery.js.map +1 -0
- package/build/{scopes.cjs → queries/find/scopes.cjs} +2 -3
- package/build/queries/find/scopes.cjs.map +1 -0
- package/build/{scopes.d.cts → queries/find/scopes.d.cts} +6 -6
- package/build/queries/find/scopes.d.cts.map +1 -0
- package/build/{scopes.d.mts → queries/find/scopes.d.mts} +6 -6
- package/build/queries/find/scopes.d.mts.map +1 -0
- package/build/{scopes.js → queries/find/scopes.js} +2 -3
- 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/{drivers/buildUtils.cjs → queries/renderConditions.cjs} +7 -8
- package/build/queries/renderConditions.cjs.map +1 -0
- package/build/{drivers/buildUtils.d.mts → queries/renderConditions.d.cts} +5 -4
- package/build/queries/renderConditions.d.cts.map +1 -0
- package/build/{drivers/buildUtils.d.cts → queries/renderConditions.d.mts} +5 -4
- package/build/queries/renderConditions.d.mts.map +1 -0
- package/build/{drivers/buildUtils.js → queries/renderConditions.js} +4 -5
- package/build/queries/renderConditions.js.map +1 -0
- package/build/{skipCondition.cjs → queries/skipCondition.cjs} +1 -2
- package/build/queries/skipCondition.cjs.map +1 -0
- package/build/{skipCondition.d.cts → queries/skipCondition.d.cts} +2 -2
- package/build/{skipCondition.d.cts.map → queries/skipCondition.d.cts.map} +1 -1
- package/build/{skipCondition.d.mts → queries/skipCondition.d.mts} +2 -2
- package/build/{skipCondition.d.mts.map → queries/skipCondition.d.mts.map} +1 -1
- package/build/{skipCondition.js → queries/skipCondition.js} +1 -2
- package/build/queries/skipCondition.js.map +1 -0
- package/build/{AliasAssigner.cjs → queries/sql/AliasAssigner.cjs} +2 -3
- package/build/queries/sql/AliasAssigner.cjs.map +1 -0
- package/build/{AliasAssigner.d.cts → queries/sql/AliasAssigner.d.cts} +2 -2
- package/build/queries/sql/AliasAssigner.d.cts.map +1 -0
- package/build/{AliasAssigner.d.mts → queries/sql/AliasAssigner.d.mts} +2 -2
- package/build/queries/sql/AliasAssigner.d.mts.map +1 -0
- package/build/{AliasAssigner.js → queries/sql/AliasAssigner.js} +2 -3
- package/build/queries/sql/AliasAssigner.js.map +1 -0
- package/build/{Expr.cjs → queries/sql/Expr.cjs} +9 -9
- package/build/queries/sql/Expr.cjs.map +1 -0
- package/build/{Expr.d.cts → queries/sql/Expr.d.cts} +4 -4
- package/build/queries/sql/Expr.d.cts.map +1 -0
- package/build/{Expr.d.mts → queries/sql/Expr.d.mts} +4 -4
- package/build/queries/sql/Expr.d.mts.map +1 -0
- package/build/{Expr.js → queries/sql/Expr.js} +4 -4
- package/build/queries/sql/Expr.js.map +1 -0
- package/build/{Tables.cjs → queries/sql/Tables.cjs} +63 -67
- package/build/queries/sql/Tables.cjs.map +1 -0
- package/build/{Tables.d.cts → queries/sql/Tables.d.cts} +6 -7
- package/build/queries/sql/Tables.d.cts.map +1 -0
- package/build/{Tables.d.mts → queries/sql/Tables.d.mts} +6 -7
- package/build/queries/sql/Tables.d.mts.map +1 -0
- package/build/{Tables.js → queries/sql/Tables.js} +9 -13
- package/build/queries/sql/Tables.js.map +1 -0
- package/build/{execute.cjs → queries/sql/execute.cjs} +32 -37
- package/build/queries/sql/execute.cjs.map +1 -0
- package/build/{execute.d.cts → queries/sql/execute.d.cts} +6 -6
- package/build/queries/sql/execute.d.cts.map +1 -0
- package/build/{execute.d.mts → queries/sql/execute.d.mts} +6 -6
- package/build/queries/sql/execute.d.mts.map +1 -0
- package/build/{execute.js → queries/sql/execute.js} +5 -10
- package/build/queries/sql/execute.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.cjs +12 -12
- package/build/queries/sql/expressions/arrayAgg.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.d.cts +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.d.mts +1 -1
- package/build/queries/sql/expressions/arrayAgg.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/arrayAgg.js +1 -1
- package/build/queries/sql/expressions/arrayAgg.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.cjs +14 -14
- package/build/queries/sql/expressions/case.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.d.cts +1 -1
- package/build/queries/sql/expressions/case.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.d.mts +1 -1
- package/build/queries/sql/expressions/case.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/case.js +1 -1
- 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/{expressions → queries/sql/expressions}/coalesce.d.cts +1 -1
- package/build/queries/sql/expressions/coalesce.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/coalesce.d.mts +1 -1
- package/build/queries/sql/expressions/coalesce.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/coalesce.js +1 -1
- package/build/queries/sql/expressions/coalesce.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.cjs +5 -5
- package/build/queries/sql/expressions/codecs.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.d.cts +1 -1
- package/build/queries/sql/expressions/codecs.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.d.mts +1 -1
- package/build/queries/sql/expressions/codecs.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/codecs.js +3 -3
- 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/{expressions → queries/sql/expressions}/expression.d.cts +1 -1
- package/build/queries/sql/expressions/expression.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/expression.d.mts +1 -1
- package/build/queries/sql/expressions/expression.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/expression.js +2 -2
- 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/{expressions → queries/sql/expressions}/greatest.d.cts +1 -1
- package/build/queries/sql/expressions/greatest.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/greatest.d.mts +1 -1
- package/build/queries/sql/expressions/greatest.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/greatest.js +1 -1
- 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/{expressions → queries/sql/expressions}/least.d.cts +1 -1
- package/build/queries/sql/expressions/least.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/least.d.mts +1 -1
- package/build/queries/sql/expressions/least.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/least.js +1 -1
- package/build/queries/sql/expressions/least.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.cjs +6 -6
- package/build/queries/sql/expressions/nullIf.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.d.cts +1 -1
- package/build/queries/sql/expressions/nullIf.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.d.mts +1 -1
- package/build/queries/sql/expressions/nullIf.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/nullIf.js +1 -1
- package/build/queries/sql/expressions/nullIf.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.cjs +16 -16
- package/build/queries/sql/expressions/parseExpression.cjs.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.d.cts +1 -1
- package/build/queries/sql/expressions/parseExpression.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.d.mts +1 -1
- package/build/queries/sql/expressions/parseExpression.d.mts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/parseExpression.js +2 -2
- package/build/queries/sql/expressions/parseExpression.js.map +1 -0
- package/build/{expressions → queries/sql/expressions}/types.d.cts +1 -1
- package/build/queries/sql/expressions/types.d.cts.map +1 -0
- package/build/{expressions → queries/sql/expressions}/types.d.mts +1 -1
- package/build/queries/sql/expressions/types.d.mts.map +1 -0
- package/build/{keywords.cjs → queries/sql/keywords.cjs} +1 -1
- package/build/queries/sql/keywords.cjs.map +1 -0
- package/build/{keywords.d.cts → queries/sql/keywords.d.cts} +1 -1
- package/build/queries/sql/keywords.d.cts.map +1 -0
- package/build/{keywords.d.mts → queries/sql/keywords.d.mts} +1 -1
- package/build/queries/sql/keywords.d.mts.map +1 -0
- package/build/{keywords.js → queries/sql/keywords.js} +1 -1
- package/build/queries/sql/keywords.js.map +1 -0
- package/build/{query.cjs → queries/sql/query.cjs} +112 -83
- package/build/queries/sql/query.cjs.map +1 -0
- package/build/{query.d.cts → queries/sql/query.d.cts} +18 -8
- package/build/queries/sql/query.d.cts.map +1 -0
- package/build/{query.d.mts → queries/sql/query.d.mts} +18 -8
- package/build/queries/sql/query.d.mts.map +1 -0
- package/build/{query.js → queries/sql/query.js} +41 -13
- package/build/queries/sql/query.js.map +1 -0
- package/build/queries/valueFilters.cjs +248 -0
- package/build/queries/valueFilters.cjs.map +1 -0
- package/build/queries/valueFilters.d.cts +28 -0
- package/build/queries/valueFilters.d.cts.map +1 -0
- package/build/queries/valueFilters.d.mts +28 -0
- package/build/queries/valueFilters.d.mts.map +1 -0
- package/build/queries/valueFilters.js +243 -0
- package/build/queries/valueFilters.js.map +1 -0
- package/build/reactiveHints.cjs +5 -5
- package/build/reactiveHints.js +5 -5
- package/build/relations/AbstractRelationImpl.cjs +0 -5
- package/build/relations/AbstractRelationImpl.cjs.map +1 -1
- package/build/relations/AbstractRelationImpl.d.cts +1 -2
- package/build/relations/AbstractRelationImpl.d.cts.map +1 -1
- package/build/relations/AbstractRelationImpl.d.mts +1 -2
- package/build/relations/AbstractRelationImpl.d.mts.map +1 -1
- package/build/relations/AbstractRelationImpl.js +1 -5
- package/build/relations/AbstractRelationImpl.js.map +1 -1
- package/build/relations/AsyncProperty.cjs +1 -1
- package/build/relations/AsyncProperty.js +1 -1
- package/build/relations/AsyncReactiveField.cjs +3 -3
- package/build/relations/AsyncReactiveField.js +3 -3
- package/build/relations/Collection.cjs +1 -1
- package/build/relations/Collection.js +1 -1
- package/build/relations/CustomCollection.cjs +1 -1
- package/build/relations/CustomCollection.js +1 -1
- package/build/relations/CustomReference.cjs +3 -3
- package/build/relations/CustomReference.js +3 -3
- package/build/relations/EnumCollection.cjs +2 -2
- package/build/relations/EnumCollection.js +2 -2
- package/build/relations/LazyField.cjs +6 -7
- package/build/relations/LazyField.cjs.map +1 -1
- package/build/relations/LazyField.js +5 -6
- package/build/relations/LazyField.js.map +1 -1
- package/build/relations/ManyToManyCollection.cjs +4 -3
- package/build/relations/ManyToManyCollection.cjs.map +1 -1
- package/build/relations/ManyToManyCollection.d.cts.map +1 -1
- package/build/relations/ManyToManyCollection.d.mts.map +1 -1
- package/build/relations/ManyToManyCollection.js +4 -3
- package/build/relations/ManyToManyCollection.js.map +1 -1
- package/build/relations/ManyToManyLargeCollection.cjs +2 -2
- package/build/relations/ManyToManyLargeCollection.js +2 -2
- package/build/relations/ManyToOneReference.cjs +7 -6
- package/build/relations/ManyToOneReference.cjs.map +1 -1
- package/build/relations/ManyToOneReference.d.cts.map +1 -1
- package/build/relations/ManyToOneReference.d.mts.map +1 -1
- package/build/relations/ManyToOneReference.js +7 -6
- package/build/relations/ManyToOneReference.js.map +1 -1
- package/build/relations/OneToManyCollection.cjs +6 -5
- package/build/relations/OneToManyCollection.cjs.map +1 -1
- package/build/relations/OneToManyCollection.d.cts.map +1 -1
- package/build/relations/OneToManyCollection.d.mts.map +1 -1
- package/build/relations/OneToManyCollection.js +4 -3
- package/build/relations/OneToManyCollection.js.map +1 -1
- package/build/relations/OneToManyLargeCollection.cjs +3 -3
- package/build/relations/OneToManyLargeCollection.js +3 -3
- package/build/relations/OneToOneReference.cjs +6 -5
- package/build/relations/OneToOneReference.cjs.map +1 -1
- package/build/relations/OneToOneReference.d.cts.map +1 -1
- package/build/relations/OneToOneReference.d.mts.map +1 -1
- package/build/relations/OneToOneReference.js +6 -5
- package/build/relations/OneToOneReference.js.map +1 -1
- package/build/relations/PolymorphicReference.cjs +7 -6
- package/build/relations/PolymorphicReference.cjs.map +1 -1
- package/build/relations/PolymorphicReference.d.cts.map +1 -1
- package/build/relations/PolymorphicReference.d.mts.map +1 -1
- package/build/relations/PolymorphicReference.js +7 -6
- package/build/relations/PolymorphicReference.js.map +1 -1
- package/build/relations/ReactiveField.cjs +3 -3
- package/build/relations/ReactiveField.js +3 -3
- package/build/relations/ReactiveGetter.cjs +1 -1
- package/build/relations/ReactiveGetter.js +1 -1
- package/build/relations/ReactiveManyToMany.cjs +5 -4
- package/build/relations/ReactiveManyToMany.cjs.map +1 -1
- package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
- package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
- package/build/relations/ReactiveManyToMany.js +5 -4
- package/build/relations/ReactiveManyToMany.js.map +1 -1
- package/build/relations/ReactiveManyToManyOtherSide.cjs +3 -3
- package/build/relations/ReactiveManyToManyOtherSide.js +3 -3
- package/build/relations/ReactiveReference.cjs +8 -7
- package/build/relations/ReactiveReference.cjs.map +1 -1
- package/build/relations/ReactiveReference.d.cts.map +1 -1
- package/build/relations/ReactiveReference.d.mts.map +1 -1
- package/build/relations/ReactiveReference.js +8 -7
- package/build/relations/ReactiveReference.js.map +1 -1
- package/build/relations/RecursiveCollection.cjs +3 -3
- package/build/relations/RecursiveCollection.js +3 -3
- package/build/relations/Reference.cjs +1 -1
- package/build/relations/Reference.js +1 -1
- package/build/relations/hasAsyncMethod.cjs +1 -1
- package/build/relations/hasAsyncMethod.js +1 -1
- package/build/relations/hasManyDerived.cjs +1 -1
- package/build/relations/hasManyDerived.js +1 -1
- package/build/relations/hasOneDerived.cjs +2 -2
- package/build/relations/hasOneDerived.js +2 -2
- package/build/relations/hasProperty.cjs +2 -2
- package/build/relations/hasProperty.js +2 -2
- package/build/relations/index.cjs +13 -13
- package/build/relations/index.js +13 -13
- 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 +1 -1
- package/build/resurrection.js +1 -1
- package/build/rules.cjs +4 -4
- package/build/rules.js +4 -4
- package/build/serde.cjs +1 -1
- package/build/serde.js +1 -1
- package/build/unnest.cjs +0 -1
- package/build/unnest.cjs.map +1 -1
- package/build/unnest.d.cts +1 -1
- package/build/unnest.d.mts +1 -1
- package/build/unnest.js +0 -1
- package/build/unnest.js.map +1 -1
- package/build/upsert.cjs +3 -3
- package/build/upsert.js +3 -3
- package/build/utils.cjs +1 -2
- package/build/utils.cjs.map +1 -1
- package/build/utils.d.cts +1 -1
- package/build/utils.d.mts +1 -1
- package/build/utils.js +1 -2
- package/build/utils.js.map +1 -1
- package/build/withLoaded.cjs +3 -3
- package/build/withLoaded.js +3 -3
- package/package.json +2 -2
- package/build/AliasAssigner.cjs.map +0 -1
- package/build/AliasAssigner.d.cts.map +0 -1
- package/build/AliasAssigner.d.mts.map +0 -1
- package/build/AliasAssigner.js.map +0 -1
- package/build/Aliases.cjs.map +0 -1
- package/build/Aliases.d.cts.map +0 -1
- package/build/Aliases.d.mts.map +0 -1
- package/build/Aliases.js.map +0 -1
- package/build/ConditionBuilder.cjs.map +0 -1
- package/build/ConditionBuilder.d.cts.map +0 -1
- package/build/ConditionBuilder.d.mts.map +0 -1
- package/build/ConditionBuilder.js.map +0 -1
- package/build/DeferredAlias.cjs.map +0 -1
- package/build/DeferredAlias.d.cts.map +0 -1
- package/build/DeferredAlias.d.mts.map +0 -1
- package/build/DeferredAlias.js.map +0 -1
- package/build/EntityFilter.cjs.map +0 -1
- package/build/EntityFilter.d.cts.map +0 -1
- package/build/EntityFilter.d.mts.map +0 -1
- package/build/EntityFilter.js.map +0 -1
- package/build/EntityGraphQLFilter.cjs.map +0 -1
- package/build/EntityGraphQLFilter.d.cts.map +0 -1
- package/build/EntityGraphQLFilter.d.mts.map +0 -1
- package/build/EntityGraphQLFilter.js.map +0 -1
- package/build/Expr.cjs.map +0 -1
- package/build/Expr.d.cts.map +0 -1
- package/build/Expr.d.mts.map +0 -1
- package/build/Expr.js.map +0 -1
- package/build/QueryParser.cjs.map +0 -1
- package/build/QueryParser.collectionJoins.cjs.map +0 -1
- package/build/QueryParser.collectionJoins.d.cts.map +0 -1
- package/build/QueryParser.collectionJoins.d.mts.map +0 -1
- package/build/QueryParser.collectionJoins.js.map +0 -1
- package/build/QueryParser.d.cts.map +0 -1
- package/build/QueryParser.d.mts.map +0 -1
- package/build/QueryParser.js.map +0 -1
- package/build/QueryParser.pruning.cjs.map +0 -1
- package/build/QueryParser.pruning.d.cts +0 -10
- package/build/QueryParser.pruning.d.cts.map +0 -1
- package/build/QueryParser.pruning.d.mts +0 -10
- package/build/QueryParser.pruning.d.mts.map +0 -1
- package/build/QueryParser.pruning.js.map +0 -1
- package/build/QueryVisitor.cjs.map +0 -1
- package/build/QueryVisitor.d.cts.map +0 -1
- package/build/QueryVisitor.d.mts.map +0 -1
- package/build/QueryVisitor.js.map +0 -1
- package/build/Tables.cjs.map +0 -1
- package/build/Tables.d.cts.map +0 -1
- package/build/Tables.d.mts.map +0 -1
- package/build/Tables.js.map +0 -1
- package/build/conditions.cjs.map +0 -1
- package/build/conditions.d.cts.map +0 -1
- package/build/conditions.d.mts.map +0 -1
- package/build/conditions.js.map +0 -1
- package/build/drivers/buildRawQuery.cjs.map +0 -1
- package/build/drivers/buildRawQuery.d.cts.map +0 -1
- package/build/drivers/buildRawQuery.d.mts.map +0 -1
- package/build/drivers/buildRawQuery.js.map +0 -1
- package/build/drivers/buildUtils.cjs.map +0 -1
- package/build/drivers/buildUtils.d.cts.map +0 -1
- package/build/drivers/buildUtils.d.mts.map +0 -1
- package/build/drivers/buildUtils.js.map +0 -1
- package/build/execute.cjs.map +0 -1
- package/build/execute.d.cts.map +0 -1
- package/build/execute.d.mts.map +0 -1
- package/build/execute.js.map +0 -1
- package/build/expressions/arrayAgg.cjs.map +0 -1
- package/build/expressions/arrayAgg.d.cts.map +0 -1
- package/build/expressions/arrayAgg.d.mts.map +0 -1
- package/build/expressions/arrayAgg.js.map +0 -1
- package/build/expressions/case.cjs.map +0 -1
- package/build/expressions/case.d.cts.map +0 -1
- package/build/expressions/case.d.mts.map +0 -1
- package/build/expressions/case.js.map +0 -1
- package/build/expressions/coalesce.cjs +0 -25
- package/build/expressions/coalesce.cjs.map +0 -1
- package/build/expressions/coalesce.d.cts.map +0 -1
- package/build/expressions/coalesce.d.mts.map +0 -1
- package/build/expressions/coalesce.js.map +0 -1
- package/build/expressions/codecs.cjs.map +0 -1
- package/build/expressions/codecs.d.cts.map +0 -1
- package/build/expressions/codecs.d.mts.map +0 -1
- package/build/expressions/codecs.js.map +0 -1
- package/build/expressions/expression.cjs +0 -102
- package/build/expressions/expression.cjs.map +0 -1
- package/build/expressions/expression.d.cts.map +0 -1
- package/build/expressions/expression.d.mts.map +0 -1
- package/build/expressions/expression.js.map +0 -1
- package/build/expressions/greatest.cjs +0 -25
- package/build/expressions/greatest.cjs.map +0 -1
- package/build/expressions/greatest.d.cts.map +0 -1
- package/build/expressions/greatest.d.mts.map +0 -1
- package/build/expressions/greatest.js.map +0 -1
- package/build/expressions/least.cjs +0 -25
- package/build/expressions/least.cjs.map +0 -1
- package/build/expressions/least.d.cts.map +0 -1
- package/build/expressions/least.d.mts.map +0 -1
- package/build/expressions/least.js.map +0 -1
- package/build/expressions/nullIf.cjs.map +0 -1
- package/build/expressions/nullIf.d.cts.map +0 -1
- package/build/expressions/nullIf.d.mts.map +0 -1
- package/build/expressions/nullIf.js.map +0 -1
- package/build/expressions/parseExpression.cjs.map +0 -1
- package/build/expressions/parseExpression.d.cts.map +0 -1
- package/build/expressions/parseExpression.d.mts.map +0 -1
- package/build/expressions/parseExpression.js.map +0 -1
- package/build/expressions/types.d.cts.map +0 -1
- package/build/expressions/types.d.mts.map +0 -1
- package/build/keywords.cjs.map +0 -1
- package/build/keywords.d.cts.map +0 -1
- package/build/keywords.d.mts.map +0 -1
- package/build/keywords.js.map +0 -1
- package/build/query.cjs.map +0 -1
- package/build/query.d.cts.map +0 -1
- package/build/query.d.mts.map +0 -1
- package/build/query.js.map +0 -1
- package/build/scopes.cjs.map +0 -1
- package/build/scopes.d.cts.map +0 -1
- package/build/scopes.d.mts.map +0 -1
- package/build/scopes.js.map +0 -1
- package/build/skipCondition.cjs.map +0 -1
- package/build/skipCondition.js.map +0 -1
- /package/build/{expressions → queries/sql/expressions}/types.cjs +0 -0
- /package/build/{expressions → queries/sql/expressions}/types.js +0 -0
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./
|
|
3
|
-
require("
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
require("
|
|
12
|
-
require("./EntityManager.cjs");
|
|
13
|
-
const require_Entity = require("./Entity.cjs");
|
|
14
|
-
const require_configure = require("./configure.cjs");
|
|
15
|
-
const require_QueryParser = require("./QueryParser.cjs");
|
|
2
|
+
const require_queries_sql_keywords = require("./keywords.cjs");
|
|
3
|
+
const require_queries_skipCondition = require("../skipCondition.cjs");
|
|
4
|
+
const require_queries_valueFilters = require("../valueFilters.cjs");
|
|
5
|
+
const require_queries_sql_Expr = require("./Expr.cjs");
|
|
6
|
+
const require_utils = require("../../utils.cjs");
|
|
7
|
+
const require_keys = require("../../keys.cjs");
|
|
8
|
+
const require_configure = require("../../configure.cjs");
|
|
9
|
+
const require_EntityMetadata = require("../../EntityMetadata.cjs");
|
|
10
|
+
const require_queries_renderConditions = require("../renderConditions.cjs");
|
|
11
|
+
const require_Entity = require("../../Entity.cjs");
|
|
16
12
|
let joist_utils = require("joist-utils");
|
|
17
|
-
//#region src/Tables.ts
|
|
13
|
+
//#region src/queries/sql/Tables.ts
|
|
18
14
|
function table(cstr, _name) {
|
|
19
15
|
return newTableProxy(cstr);
|
|
20
16
|
}
|
|
@@ -81,7 +77,7 @@ function isTable(obj) {
|
|
|
81
77
|
* A physical table column implements `Expr`: it renders as `alias."column"`, decodes result
|
|
82
78
|
* values through the column's shared scalar codec, and inherits aggregate methods from `BaseExpr`.
|
|
83
79
|
*/
|
|
84
|
-
var TableColumn = class extends
|
|
80
|
+
var TableColumn = class extends require_queries_sql_Expr.BaseExpr {
|
|
85
81
|
meta;
|
|
86
82
|
column;
|
|
87
83
|
mgmt;
|
|
@@ -104,7 +100,7 @@ var TableColumn = class extends require_Expr.BaseExpr {
|
|
|
104
100
|
toSql(ctx) {
|
|
105
101
|
const alias = ctx.aliasFor(this.mgmt);
|
|
106
102
|
return {
|
|
107
|
-
sql:
|
|
103
|
+
sql: require_queries_sql_keywords.kqDot(alias, this.column.columnName),
|
|
108
104
|
bindings: [],
|
|
109
105
|
refs: [alias]
|
|
110
106
|
};
|
|
@@ -125,10 +121,10 @@ var TableColumn = class extends require_Expr.BaseExpr {
|
|
|
125
121
|
}
|
|
126
122
|
/** Encodes literals when the condition is created and renders with each query's aliases. */
|
|
127
123
|
addCondition(value) {
|
|
128
|
-
const encoded =
|
|
129
|
-
return
|
|
124
|
+
const encoded = require_queries_valueFilters.mapToDb(this.column, value);
|
|
125
|
+
return require_queries_sql_Expr.deferredCondition((ctx) => {
|
|
130
126
|
const left = this.toSql(ctx);
|
|
131
|
-
const [sql, bindings] =
|
|
127
|
+
const [sql, bindings] = require_queries_renderConditions.buildValueCondition(left.sql, encoded);
|
|
132
128
|
return {
|
|
133
129
|
sql,
|
|
134
130
|
bindings: [...left.bindings, ...bindings],
|
|
@@ -138,7 +134,7 @@ var TableColumn = class extends require_Expr.BaseExpr {
|
|
|
138
134
|
}
|
|
139
135
|
/** Renders raw operators against the same quoted column SQL as other expressions. */
|
|
140
136
|
addRawCondition(exp, bindings) {
|
|
141
|
-
return
|
|
137
|
+
return require_queries_sql_Expr.deferredCondition((ctx) => {
|
|
142
138
|
const left = this.toSql(ctx);
|
|
143
139
|
return {
|
|
144
140
|
sql: `${left.sql} ${exp}`,
|
|
@@ -149,7 +145,7 @@ var TableColumn = class extends require_Expr.BaseExpr {
|
|
|
149
145
|
}
|
|
150
146
|
/** Uses column filter conversions for literals and shared comparisons for expressions and null equality. */
|
|
151
147
|
compare(op, value) {
|
|
152
|
-
if (value === void 0 ||
|
|
148
|
+
if (value === void 0 || require_queries_sql_Expr.isExpr(value) || value === null && (op === "=" || op === "!=")) return super.compare(op, value);
|
|
153
149
|
const kind = {
|
|
154
150
|
"=": "eq",
|
|
155
151
|
"!=": "ne",
|
|
@@ -172,7 +168,7 @@ var TableColumn = class extends require_Expr.BaseExpr {
|
|
|
172
168
|
* Negated array operators wrap the complete comparison in NOT.
|
|
173
169
|
*/
|
|
174
170
|
compareToExpr(op, value, negate = false) {
|
|
175
|
-
if (negate) return
|
|
171
|
+
if (negate) return require_queries_sql_Expr.deferredCondition((ctx) => {
|
|
176
172
|
const comparison = ctx.conditionToSql(this.compareToExpr(op, value));
|
|
177
173
|
return {
|
|
178
174
|
...comparison,
|
|
@@ -184,36 +180,36 @@ var TableColumn = class extends require_Expr.BaseExpr {
|
|
|
184
180
|
};
|
|
185
181
|
var PrimitiveColumnImpl = class extends TableColumn {
|
|
186
182
|
between(v1, v2) {
|
|
187
|
-
if (v1 === void 0 || v2 === void 0) return
|
|
183
|
+
if (v1 === void 0 || v2 === void 0) return require_queries_skipCondition.skipCondition;
|
|
188
184
|
return this.addCondition({
|
|
189
185
|
kind: "between",
|
|
190
186
|
value: [v1, v2]
|
|
191
187
|
});
|
|
192
188
|
}
|
|
193
189
|
like(value) {
|
|
194
|
-
if (value === void 0) return
|
|
190
|
+
if (value === void 0) return require_queries_skipCondition.skipCondition;
|
|
195
191
|
return this.addCondition({
|
|
196
192
|
kind: "like",
|
|
197
193
|
value
|
|
198
194
|
});
|
|
199
195
|
}
|
|
200
196
|
ilike(value) {
|
|
201
|
-
if (value === void 0) return
|
|
197
|
+
if (value === void 0) return require_queries_skipCondition.skipCondition;
|
|
202
198
|
return this.addCondition({
|
|
203
199
|
kind: "ilike",
|
|
204
200
|
value
|
|
205
201
|
});
|
|
206
202
|
}
|
|
207
203
|
search(value) {
|
|
208
|
-
if (!value) return
|
|
204
|
+
if (!value) return require_queries_skipCondition.skipCondition;
|
|
209
205
|
return this.addCondition({
|
|
210
206
|
kind: "ilike",
|
|
211
|
-
value:
|
|
207
|
+
value: require_queries_valueFilters.makeLike(value)
|
|
212
208
|
});
|
|
213
209
|
}
|
|
214
210
|
in(values) {
|
|
215
|
-
if (values === void 0) return
|
|
216
|
-
if (
|
|
211
|
+
if (values === void 0) return require_queries_skipCondition.skipCondition;
|
|
212
|
+
if (require_queries_sql_Expr.isExpr(values)) return this.inList("IN", values);
|
|
217
213
|
if (values.includes(null)) return { or: [this.addCondition({ kind: "is-null" }), this.addCondition({
|
|
218
214
|
kind: "in",
|
|
219
215
|
value: values.filter((v) => v !== null)
|
|
@@ -225,72 +221,72 @@ var PrimitiveColumnImpl = class extends TableColumn {
|
|
|
225
221
|
}
|
|
226
222
|
/** Applies an IN condition unless the list is empty or undefined. */
|
|
227
223
|
inNonEmpty(values) {
|
|
228
|
-
return values === void 0 || values.length === 0 ?
|
|
224
|
+
return values === void 0 || values.length === 0 ? require_queries_skipCondition.skipCondition : this.in(values);
|
|
229
225
|
}
|
|
230
226
|
nin(values) {
|
|
231
|
-
if (values === void 0) return
|
|
232
|
-
if (
|
|
227
|
+
if (values === void 0) return require_queries_skipCondition.skipCondition;
|
|
228
|
+
if (require_queries_sql_Expr.isExpr(values)) return this.inList("NOT IN", values);
|
|
233
229
|
return this.addCondition({
|
|
234
230
|
kind: "nin",
|
|
235
231
|
value: values.filter((v) => v !== null)
|
|
236
232
|
});
|
|
237
233
|
}
|
|
238
234
|
contains(v1) {
|
|
239
|
-
if (v1 === void 0) return
|
|
240
|
-
if (
|
|
235
|
+
if (v1 === void 0) return require_queries_skipCondition.skipCondition;
|
|
236
|
+
if (require_queries_sql_Expr.isExpr(v1)) return this.compareToExpr("@>", v1);
|
|
241
237
|
return this.addCondition({
|
|
242
238
|
kind: "contains",
|
|
243
239
|
value: v1
|
|
244
240
|
});
|
|
245
241
|
}
|
|
246
242
|
ncontains(v1) {
|
|
247
|
-
if (v1 === void 0) return
|
|
248
|
-
if (
|
|
243
|
+
if (v1 === void 0) return require_queries_skipCondition.skipCondition;
|
|
244
|
+
if (require_queries_sql_Expr.isExpr(v1)) return this.compareToExpr("@>", v1, true);
|
|
249
245
|
return this.addCondition({
|
|
250
246
|
kind: "ncontains",
|
|
251
247
|
value: v1
|
|
252
248
|
});
|
|
253
249
|
}
|
|
254
250
|
overlaps(v1) {
|
|
255
|
-
if (v1 === void 0) return
|
|
256
|
-
if (
|
|
251
|
+
if (v1 === void 0) return require_queries_skipCondition.skipCondition;
|
|
252
|
+
if (require_queries_sql_Expr.isExpr(v1)) return this.compareToExpr("&&", v1);
|
|
257
253
|
return this.addCondition({
|
|
258
254
|
kind: "overlaps",
|
|
259
255
|
value: v1
|
|
260
256
|
});
|
|
261
257
|
}
|
|
262
258
|
noverlaps(v1) {
|
|
263
|
-
if (v1 === void 0) return
|
|
264
|
-
if (
|
|
259
|
+
if (v1 === void 0) return require_queries_skipCondition.skipCondition;
|
|
260
|
+
if (require_queries_sql_Expr.isExpr(v1)) return this.compareToExpr("&&", v1, true);
|
|
265
261
|
return this.addCondition({
|
|
266
262
|
kind: "noverlaps",
|
|
267
263
|
value: v1
|
|
268
264
|
});
|
|
269
265
|
}
|
|
270
266
|
pathExists(jsonPath) {
|
|
271
|
-
if (jsonPath === void 0) return
|
|
267
|
+
if (jsonPath === void 0) return require_queries_skipCondition.skipCondition;
|
|
272
268
|
return this.addCondition({
|
|
273
269
|
kind: "jsonPathExists",
|
|
274
270
|
value: jsonPath
|
|
275
271
|
});
|
|
276
272
|
}
|
|
277
273
|
pathIsTrue(jsonPath) {
|
|
278
|
-
if (jsonPath === void 0) return
|
|
274
|
+
if (jsonPath === void 0) return require_queries_skipCondition.skipCondition;
|
|
279
275
|
return this.addCondition({
|
|
280
276
|
kind: "jsonPathPredicate",
|
|
281
277
|
value: jsonPath
|
|
282
278
|
});
|
|
283
279
|
}
|
|
284
280
|
raw(exp, bindings) {
|
|
285
|
-
if (bindings === void 0) return
|
|
281
|
+
if (bindings === void 0) return require_queries_skipCondition.skipCondition;
|
|
286
282
|
return this.addRawCondition(exp, bindings);
|
|
287
283
|
}
|
|
288
284
|
};
|
|
289
285
|
var EntityColumnImpl = class extends TableColumn {
|
|
290
286
|
in(values) {
|
|
291
|
-
if (values === void 0) return
|
|
287
|
+
if (values === void 0) return require_queries_skipCondition.skipCondition;
|
|
292
288
|
else if (values === null) throw new Error("Unsupported");
|
|
293
|
-
else if (
|
|
289
|
+
else if (require_queries_sql_Expr.isExpr(values)) return this.inList("IN", values);
|
|
294
290
|
else if (values.includes(null)) return { or: [this.addCondition({ kind: "is-null" }), this.addCondition({
|
|
295
291
|
kind: "in",
|
|
296
292
|
value: values.filter((v) => v !== null)
|
|
@@ -302,12 +298,12 @@ var EntityColumnImpl = class extends TableColumn {
|
|
|
302
298
|
}
|
|
303
299
|
/** Applies an IN condition unless the list is empty, null, or undefined. */
|
|
304
300
|
inNonEmpty(values) {
|
|
305
|
-
return values === null || values === void 0 || values.length === 0 ?
|
|
301
|
+
return values === null || values === void 0 || values.length === 0 ? require_queries_skipCondition.skipCondition : this.in(values);
|
|
306
302
|
}
|
|
307
303
|
nin(values) {
|
|
308
|
-
if (values === void 0) return
|
|
304
|
+
if (values === void 0) return require_queries_skipCondition.skipCondition;
|
|
309
305
|
else if (values === null) throw new Error("Unsupported");
|
|
310
|
-
else if (
|
|
306
|
+
else if (require_queries_sql_Expr.isExpr(values)) return this.inList("NOT IN", values);
|
|
311
307
|
else return this.addCondition({
|
|
312
308
|
kind: "nin",
|
|
313
309
|
value: values.filter((v) => v !== null)
|
|
@@ -326,7 +322,7 @@ var EntityColumnImpl = class extends TableColumn {
|
|
|
326
322
|
return this.compareId("<=", "lte", value);
|
|
327
323
|
}
|
|
328
324
|
raw(exp, bindings) {
|
|
329
|
-
if (bindings === void 0) return
|
|
325
|
+
if (bindings === void 0) return require_queries_skipCondition.skipCondition;
|
|
330
326
|
return this.addRawCondition(exp, bindings);
|
|
331
327
|
}
|
|
332
328
|
/** Joins via this FK, inheriting the source's LEFT join for otherwise required references. */
|
|
@@ -349,9 +345,9 @@ var EntityColumnImpl = class extends TableColumn {
|
|
|
349
345
|
};
|
|
350
346
|
}
|
|
351
347
|
compareId(op, kind, value) {
|
|
352
|
-
if (value === void 0) return
|
|
348
|
+
if (value === void 0) return require_queries_skipCondition.skipCondition;
|
|
353
349
|
if (value === null) throw new Error("Unsupported");
|
|
354
|
-
if (
|
|
350
|
+
if (require_queries_sql_Expr.isExpr(value)) return this.compareToExpr(op, value);
|
|
355
351
|
return this.addCondition({
|
|
356
352
|
kind,
|
|
357
353
|
value
|
|
@@ -375,8 +371,8 @@ var PolyReferenceImpl = class {
|
|
|
375
371
|
return this.addEqOrNe("ne", value);
|
|
376
372
|
}
|
|
377
373
|
in(values) {
|
|
378
|
-
if (values === void 0) return
|
|
379
|
-
if (
|
|
374
|
+
if (values === void 0) return require_queries_skipCondition.skipCondition;
|
|
375
|
+
if (require_queries_sql_Expr.isExpr(values)) return this.inSubquery(values);
|
|
380
376
|
const idsByConstructor = (0, joist_utils.groupBy)(values, (id) => require_configure.getConstructorFromTaggedId(require_keys.maybeResolveReferenceToId(id)).name);
|
|
381
377
|
return { or: Object.entries(idsByConstructor).map(([cstrName, ids]) => {
|
|
382
378
|
const comp = this.field.components.find((p) => p.otherMetadata().cstr.name === cstrName) ?? require_utils.fail(`No component for ${cstrName}`);
|
|
@@ -388,7 +384,7 @@ var PolyReferenceImpl = class {
|
|
|
388
384
|
}
|
|
389
385
|
/** Applies an IN condition unless the list is empty or undefined. */
|
|
390
386
|
inNonEmpty(values) {
|
|
391
|
-
return values === void 0 || values.length === 0 ?
|
|
387
|
+
return values === void 0 || values.length === 0 ? require_queries_skipCondition.skipCondition : this.in(values);
|
|
392
388
|
}
|
|
393
389
|
/** Joins via this poly's component, inheriting the source's LEFT join when the poly is required. */
|
|
394
390
|
as(other) {
|
|
@@ -414,7 +410,7 @@ var PolyReferenceImpl = class {
|
|
|
414
410
|
* subquery's agreed ID domain picks the component, i.e. authors pick `parent_author_id`.
|
|
415
411
|
*/
|
|
416
412
|
inSubquery(values) {
|
|
417
|
-
const selected =
|
|
413
|
+
const selected = require_queries_sql_Expr.asNode(values).subquerySelect;
|
|
418
414
|
const outputType = selected?.outputType;
|
|
419
415
|
let otherMeta = outputType?.idMeta;
|
|
420
416
|
if (!otherMeta) {
|
|
@@ -425,12 +421,12 @@ var PolyReferenceImpl = class {
|
|
|
425
421
|
return this.componentColumn(comp).in(values);
|
|
426
422
|
}
|
|
427
423
|
addEqOrNe(kind, value) {
|
|
428
|
-
if (value === void 0) return
|
|
424
|
+
if (value === void 0) return require_queries_skipCondition.skipCondition;
|
|
429
425
|
else if (value instanceof TableColumn) {
|
|
430
426
|
const otherMeta = value.idMetadata ?? require_utils.fail(`${this.field.fieldName} needs an id or FK column`);
|
|
431
427
|
const comp = this.field.components.find((p) => require_EntityMetadata.getBaseAndSelfMetas(otherMeta).includes(p.otherMetadata())) ?? require_utils.fail(`${this.field.fieldName} has no component for ${otherMeta.type}`);
|
|
432
428
|
return this.componentColumn(comp)[kind](value);
|
|
433
|
-
} else if (
|
|
429
|
+
} else if (require_queries_sql_Expr.isExpr(value)) return require_utils.fail(`${this.field.fieldName} is polymorphic, so it can only be compared to tagged ids or entity table columns`);
|
|
434
430
|
else if (value === null) {
|
|
435
431
|
const value = kind === "eq" ? { kind: "is-null" } : { kind: "not-null" };
|
|
436
432
|
return { and: this.field.components.map((p) => this.componentColumn(p).addCondition(value)) };
|
|
@@ -495,10 +491,10 @@ var SubtypeJoinImpl = class extends CollectionJoinImpl {
|
|
|
495
491
|
};
|
|
496
492
|
const base = this.subtype.baseTypes.find((m) => m.stiDiscriminatorField !== void 0);
|
|
497
493
|
const columnName = base.fields[base.stiDiscriminatorField].serde.columns[0].columnName;
|
|
498
|
-
const discriminator =
|
|
494
|
+
const discriminator = require_queries_sql_Expr.deferredCondition((ctx) => {
|
|
499
495
|
const alias = ctx.aliasFor(other[tableMgmt]);
|
|
500
496
|
return {
|
|
501
|
-
sql: `${
|
|
497
|
+
sql: `${require_queries_sql_keywords.kqDot(alias, columnName)} = ?`,
|
|
502
498
|
bindings: [this.subtype.stiDiscriminatorValue],
|
|
503
499
|
refs: [alias]
|
|
504
500
|
};
|
|
@@ -554,20 +550,20 @@ var ManyToManyJoinImpl = class extends CollectionJoinImpl {
|
|
|
554
550
|
const jt = new JoinTableHandle(joinTableName);
|
|
555
551
|
const ourId = idColumnOf(this.proxy);
|
|
556
552
|
const otherId = idColumnOf(other);
|
|
557
|
-
const jtOn =
|
|
553
|
+
const jtOn = require_queries_sql_Expr.deferredCondition((ctx) => {
|
|
558
554
|
const jtAlias = ctx.aliasFor(jt);
|
|
559
555
|
const id = ourId.toSql(ctx);
|
|
560
556
|
return {
|
|
561
|
-
sql: `${
|
|
557
|
+
sql: `${require_queries_sql_keywords.kqDot(jtAlias, ourColumn)} = ${id.sql}`,
|
|
562
558
|
bindings: id.bindings,
|
|
563
559
|
refs: id.refs
|
|
564
560
|
};
|
|
565
561
|
});
|
|
566
|
-
const on =
|
|
562
|
+
const on = require_queries_sql_Expr.deferredCondition((ctx) => {
|
|
567
563
|
const jtAlias = ctx.aliasFor(jt);
|
|
568
564
|
const id = otherId.toSql(ctx);
|
|
569
565
|
return {
|
|
570
|
-
sql: `${id.sql} = ${
|
|
566
|
+
sql: `${id.sql} = ${require_queries_sql_keywords.kqDot(jtAlias, otherColumn)}`,
|
|
571
567
|
bindings: id.bindings,
|
|
572
568
|
refs: [...id.refs, jtAlias]
|
|
573
569
|
};
|
|
@@ -659,10 +655,10 @@ function tableWhere(mgmt, filter) {
|
|
|
659
655
|
let leaves;
|
|
660
656
|
if (field.kind === "m2o") {
|
|
661
657
|
if (!isTableReferenceFilter(value)) throw new Error(`Unsupported table reference filter ${meta.type}.${key}; use an entity or ID`);
|
|
662
|
-
const parsed =
|
|
658
|
+
const parsed = require_queries_valueFilters.parseEntityFilter(field.otherMetadata(), value);
|
|
663
659
|
if (parsed?.kind === "join") throw new Error(`Unsupported table reference filter ${meta.type}.${key}; use an entity or ID`);
|
|
664
660
|
leaves = parsed ? [parsed] : [];
|
|
665
|
-
} else leaves =
|
|
661
|
+
} else leaves = require_queries_valueFilters.parseValueFilter(value);
|
|
666
662
|
for (const leaf of leaves) if (leaf.kind === "between" && leaf.value.some((v) => v === void 0)) {
|
|
667
663
|
if (leaf.value[0] !== void 0) conditions.push(column.addCondition({
|
|
668
664
|
kind: "gte",
|
|
@@ -678,7 +674,7 @@ function tableWhere(mgmt, filter) {
|
|
|
678
674
|
})] });
|
|
679
675
|
else conditions.push(column.addCondition(leaf));
|
|
680
676
|
}
|
|
681
|
-
return conditions.length === 0 ?
|
|
677
|
+
return conditions.length === 0 ? require_queries_skipCondition.skipCondition : { and: conditions };
|
|
682
678
|
}
|
|
683
679
|
/** Rejects nested relations, scopes, and aliases before parsing owning-reference values. */
|
|
684
680
|
function isTableReferenceFilter(value) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tables.cjs","names":["getMetadata","fail","BaseExpr","kqDot","toIdOf","mapToDb","deferredCondition","buildValueCondition","isExpr","skipCondition","makeLike","groupBy","getConstructorFromTaggedId","maybeResolveReferenceToId","asNode","getBaseAndSelfMetas","getBaseSelfAndSubMetas","getBaseMeta","parseEntityFilter","parseValueFilter","isEntity"],"sources":["../../../src/queries/sql/Tables.ts"],"sourcesContent":["import { groupBy } from \"joist-utils\";\n\nimport type { Column } from \"../../columns.ts\";\n// Load configure first: otherwise the built cjs/esm module graph evaluates relations/* before their\n// base classes exist (\"Class extends value undefined\").\nimport { getConstructorFromTaggedId } from \"../../configure.ts\";\nimport { type Entity, isEntity } from \"../../Entity.ts\";\nimport type { IdOf, MaybeAbstractEntityConstructor, TaggedId } from \"../../EntityManager.ts\";\nimport {\n type EntityMetadata,\n type Field,\n type LargeOneToManyField,\n type ManyToManyField,\n type OneToManyField,\n type OneToOneField,\n type PolymorphicField,\n type PolymorphicFieldComponent,\n getBaseAndSelfMetas,\n getBaseMeta,\n getBaseSelfAndSubMetas,\n getMetadata,\n} from \"../../EntityMetadata.ts\";\nimport { maybeResolveReferenceToId, toIdOf } from \"../../keys.ts\";\nimport type { TypeInfo } from \"../../TypeInfo.ts\";\nimport type { ColumnsOf, FieldsOf, FilterOf, TypeMap, TypeNameOf } from \"../../typeMap.ts\";\nimport { fail } from \"../../utils.ts\";\nimport type { SqlCondition } from \"../conditions.ts\";\nimport type { ParsedValueFilter } from \"../parsedConditions.ts\";\nimport { buildValueCondition } from \"../renderConditions.ts\";\nimport { skipCondition } from \"../skipCondition.ts\";\nimport { makeLike, mapToDb, parseEntityFilter, parseValueFilter } from \"../valueFilters.ts\";\nimport {\n BaseExpr,\n type Expr,\n type ExprContext,\n type ExprLike,\n type InnerJoin,\n type LeftJoin,\n type SqlFragment,\n asNode,\n deferredCondition,\n isExpr,\n} from \"./Expr.ts\";\nimport { kqDot } from \"./keywords.ts\";\n\n/** Creates physical column expressions and relationship joins for `T`. */\nexport function table<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): Table<T>;\n/**\n * Creates a table with an explicit type-level name, i.e. `table(Author, \"m\")` for a self-join.\n *\n * The name is the table's source key in `em.query`: two bare `table(Author)`s share the key `\"Author\"`,\n * so a left-joined mentor would also mark the mentee's columns nullable; a named alias has its own key.\n */\nexport function table<T extends Entity, Name extends string>(\n cstr: MaybeAbstractEntityConstructor<T>,\n name: Name,\n): Table<T, Name>;\nexport function table<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>, _name?: string): unknown {\n // The name only exists at the type level; the SQL alias is still assigned by the query parser\n return newTableProxy(cstr);\n}\n\n/** Creates multiple physical table handles. */\nexport function tables<T extends readonly MaybeAbstractEntityConstructor<any>[]>(\n ...type: T\n): { [P in keyof T]: T[P] extends MaybeAbstractEntityConstructor<infer E extends Entity> ? Table<E> : never } {\n return type.map((t) => newTableProxy(t)) as any;\n}\n\n/**\n * The runtime management interface plus phantom type information for `em.query`.\n *\n * `__entity` lets `QueryRow` recover `T` for entity mode (you cannot `infer T` back out of a mapped\n * type), and `__name` is the table's source key (see `Expr`).\n */\nexport interface TableBrand<T, Name extends string> extends TableMgmt {\n readonly __entity: T;\n readonly __name: Name;\n}\n\n/**\n * A physical table for `T`: one expression per SQL column, with relationship names as join factories.\n * Selecting the table itself retains entity hydration; selecting columns returns decoded SQL values.\n *\n * Unlike an Alias, a Table is an explicit SQL source, not a place to bind in an em.find relationship\n * tree. I.e. with `a = table(Author)`, `{ from: a }` registers that handle in the query's scope.\n * Its columns already know their physical column and codec, but their SQL name still depends on the\n * query: the same Author handle might be `a` in one query and `a1` in a nested query.\n *\n * Each predicate occurrence renders through ExprContext.aliasFor using the current scope (or an\n * enclosing scope for a correlation). Rendering returns SQL, ordered bindings, and source references\n * together. A comparison records both sides' references; templates and subqueries carry their\n * references too. Join pruning follows these references and join dependencies, rather than guessing\n * which tables a SQL string mentions. It also accounts for select/order/group expressions and keep.\n *\n * I.e. if a joined Author is used only by `a.firstName.eq(name)`, supplying undefined removes that\n * predicate and lets the unused join prune. Both APIs share this undefined-condition pruning rule;\n * they differ in how they get the references: Alias resolves domain conditions against a relationship\n * tree, while Table renders SQL expressions against explicit sources. Neither caches SQL names on\n * the reusable handle or predicate, so one parse cannot overwrite another parse's bindings.\n *\n * `Name` is the table's type-level source key, defaulting to the entity's own type name, so a\n * LEFT-joined SmallPublisher does not make Publisher columns nullable. `table(Author, \"m\")`\n * gives a self-join table its own key.\n */\nexport type Table<T extends Entity, Name extends string = TableNameOf<T>> = TableShape<T, Name> &\n (\"where\" extends keyof TableShape<T, Name>\n ? {}\n : {\n /** Builds an AND condition from local domain fields, without implicit joins. */\n where(filter: TableFilter<T>): SqlCondition;\n });\n\n/** Domain filters for fields stored on this physical table, without relationship traversal. */\nexport type TableFilter<T extends Entity> = {\n [K in LocalFieldNames<T> & keyof FieldsOf<T>]?: FieldsOf<T>[K] extends {\n kind: \"m2o\";\n type: infer U extends Entity;\n nullable: infer N;\n }\n ? TableReferenceFilter<U, N extends undefined ? null : never>\n : FilterOf<T>[K];\n};\n\n/** Generated column ownership excludes CTI base fields and polymorphic components. */\ntype LocalFieldNames<T> = ColumnsOf<T>[keyof ColumnsOf<T>] extends { fieldName: infer F }\n ? Extract<F, keyof FilterOf<T>>\n : never;\n\n/** The owning-reference subset of find filters that only compares a foreign key. */\ntype TableReferenceFilter<T extends Entity, N> =\n | T\n | IdOf<T>\n | readonly (T | IdOf<T>)[]\n | boolean\n | N\n | undefined\n | { ne: T | IdOf<T> | N | undefined };\n\ntype TableShape<T extends Entity, Name extends string> = {\n readonly [tableMgmt]: TableBrand<T, Name>;\n} & {\n [P in keyof ColumnsOf<T>]: P extends \"id\"\n ? EntityColumn<T, never, Name>\n : ColumnsOf<T>[P] extends { entity: infer U extends Entity; nullable: infer N }\n ? ReferenceColumn<U, N extends true ? null : never, Name>\n : ColumnsOf<T>[P] extends { type: infer V; nullable: infer N }\n ? PrimitiveColumn<V, N extends true ? null : never, Name>\n : never;\n} & {\n [\n P in keyof FieldsOf<T> as P extends keyof ColumnsOf<T>\n ? never\n : FieldsOf<T>[P] extends { kind: \"m2o\" | \"poly\" | \"o2m\" | \"lo2m\" | \"m2m\" | \"o2o\" }\n ? P\n : never\n ]: FieldsOf<T>[P] extends { kind: \"m2o\"; type: infer U extends Entity; nullable: infer N }\n ? ReferenceJoin<U, N extends undefined ? null : never, Name>\n : FieldsOf<T>[P] extends { kind: \"poly\"; type: infer U extends Entity; nullable: infer N }\n ? PolyReference<U, N extends undefined ? null : never, Name>\n : FieldsOf<T>[P] extends { kind: \"o2m\" | \"lo2m\" | \"m2m\" | \"o2o\"; type: infer U extends Entity }\n ? CollectionJoin<U>\n : never;\n} & {\n [\n K in keyof TypeMap as TypeMap[K] extends {\n entityType: infer U extends Entity & { __type: { 0: TypeNameOf<T>; 1: string } };\n }\n ? Uncapitalize<TypeNameOf<U> & string>\n : never\n ]: TypeMap[K] extends { entityType: infer U extends Entity } ? SubtypeJoin<U> : never;\n};\n\n/** Keeps explicit base and subtype sources independent, with generic entities untracked. */\ntype TableNameOf<T> = T extends { __type: { 0: string } } ? TypeNameOf<T> & string : string;\n\n/** Provides fluent methods for creating joins through an owning reference relationship. */\nexport interface ReferenceJoin<U extends Entity, N extends null | never, Src extends string = string> {\n /**\n * Required reference joins like `b.author.as(a)` are INNER unless `b` is already a LEFT-joined alias.\n * Nullable references are always LEFT joined.\n */\n as<A extends TableFor<U>>(other: A): [N] extends [never] ? DefaultReferenceJoin<A, Src> : LeftJoin<A>;\n inner<A extends TableFor<U>>(other: A): InnerJoin<A>;\n left<A extends TableFor<U>>(other: A): LeftJoin<A>;\n}\n\n/** The source of a default reference join, used to inherit optional paths within each query. */\nexport const referenceJoinSource: unique symbol = Symbol(\"joist.referenceJoinSource\");\n\n/** A required reference defaults to INNER unless its source was LEFT joined. */\nexport type DefaultReferenceJoin<A, Src extends string> = InnerJoin<A> & {\n readonly [referenceJoinSource]: Src;\n};\n\n/** Any table whose entity is (a subtype of) `U`, i.e. what a relation join factory accepts. */\nexport type TableFor<U> = { readonly [tableMgmt]: TableBrand<U, string> };\n\n/**\n * A collection relation (o2m/o2o/m2m) as a join factory: `a.books.as(b)` returns the same\n * `{ left: b, on: ... }` entry the expanded form writes, with the FK condition built from metadata, so\n * join-list inference, nullability, scope checking, and pruning are unchanged and both forms mix freely.\n *\n * `as` binds the joined alias, the same way em.find's `{ books: { as: b } }` does. The default is LEFT\n * (a collection may be empty, and a LEFT join never filters rows, so pruning it is always safe);\n * `.inner(b)` opts into filtering. An m2m entry carries a hidden second join through the join table,\n * which the parser expands; the pair prunes together.\n */\nexport interface CollectionJoin<U extends Entity> {\n as<A extends TableFor<U>>(other: A): LeftJoin<A>;\n inner<A extends TableFor<U>>(other: A): InnerJoin<A>;\n left<A extends TableFor<U>>(other: A): LeftJoin<A>;\n}\n\n/** A named subtype join, defaulting to LEFT because a root row may belong to another subtype. */\ninterface SubtypeJoin<U extends Entity> extends CollectionJoin<U> {\n <A extends TableFor<U>>(other: A): LeftJoin<A>;\n}\n\n/**\n * A physical FK column expression (`b.authorId` selects/compares the `author_id` FK) plus a join factory\n * (`b.authorId.as(a)` joins). The default join kind follows physical column nullability:\n * a NOT NULL FK is INNER unless its source was LEFT joined, a nullable one is LEFT, and the row type reflects it.\n */\nexport interface ReferenceColumn<U extends Entity, N extends null | never, Src extends string>\n extends EntityColumn<U, N, Src>, ReferenceJoin<U, N, Src> {}\n\n/**\n * A polymorphic reference: condition methods (each resolving the component column from the value), plus\n * a join factory that picks the component from the argument's entity, i.e. `c.parent.as(a)` joins\n * through `parent_author_id`, like an explicit join with `on: c.parent.eq(a.id)`.\n */\nexport interface PolyReference<\n U extends Entity,\n N extends null | never,\n Src extends string = string,\n> extends ReferenceJoin<U, N, Src> {\n eq(value: U | TaggedId | ExprLike<IdOf<U> | null> | null | undefined): SqlCondition;\n ne(value: U | TaggedId | ExprLike<IdOf<U> | null> | null | undefined): SqlCondition;\n in(values: readonly (U | TaggedId)[] | ExprLike<IdOf<U> | null> | undefined): SqlCondition;\n /** Applies an IN condition unless the list is empty or undefined. */\n inNonEmpty(values: readonly (U | TaggedId)[] | undefined): SqlCondition;\n}\n\nexport interface PrimitiveColumn<V, N extends null | never, Src extends string = string> extends Expr<V | N, Src> {\n eq(value: V | ExprLike<V | N> | N | undefined): SqlCondition;\n ne(value: V | ExprLike<V | N> | N | undefined): SqlCondition;\n in(values: readonly (V | null)[] | ExprLike<V | null> | undefined): SqlCondition;\n /** Applies an IN condition unless the list is empty or undefined. */\n inNonEmpty(values: readonly (V | null)[] | undefined): SqlCondition;\n nin(values: readonly (V | null)[] | ExprLike<V | null> | undefined): SqlCondition;\n gt(value: V | ExprLike<V | N> | undefined): SqlCondition;\n gte(value: V | ExprLike<V | N> | undefined): SqlCondition;\n lt(value: V | ExprLike<V | N> | undefined): SqlCondition;\n lte(value: V | ExprLike<V | N> | undefined): SqlCondition;\n like(value: V | undefined): SqlCondition;\n ilike(value: V | undefined): SqlCondition;\n search(value: V | undefined): SqlCondition;\n between(v1: V | undefined, v2: V | undefined): SqlCondition;\n // need to move to ArrayColumn\n // ...added the `string` to support jsonb contains like `WHERE profile @> '{\"age\": 25}'`\n // Ideally this would go in a JsonbColumn\n contains(value: string | V | PrimitiveColumn<V, any> | N | undefined): SqlCondition;\n ncontains(value: string | V | PrimitiveColumn<V, any> | N | undefined): SqlCondition;\n overlaps(value: V | PrimitiveColumn<V, any> | N | undefined): SqlCondition;\n noverlaps(value: V | PrimitiveColumn<V, any> | N | undefined): SqlCondition;\n\n /**\n * Adds a JSON path existence condition, using the `@?` operator.\n *\n * Any values should be embedded directly within the `jsonPath`, because postgres does not\n * support parameterized JSON path expressions. The entire `jsonPath` is treated as a parameter,\n * so this is safe from SQL injection.\n */\n pathExists(jsonPath: string | undefined): SqlCondition;\n\n /**\n * Adds a JSON path predicate condition, using the `@@` operator.\n *\n * Any values should be embedded directly within the `jsonPath`, because postgres does not\n * support parameterized JSON path expressions. The entire `jsonPath` is treated as a parameter,\n * so this is safe from SQL injection.\n */\n pathIsTrue(jsonPath: string | undefined): SqlCondition;\n\n /**\n * Add `exp` to the query, which should include the operator & expression and any\n * bound parameters (but not include the column name).\n *\n * We use knex-style placeholders, i.e. `?` and `\\\\?` to escape question marks, i.e.\n *\n * ```ts\n * a.address.raw(\"@\\\\? ?\", ['$.street ? (@ == \"rr2\")'])`\n * ```\n */\n raw(exp: string, bindings: readonly any[] | undefined): SqlCondition;\n}\n\nexport interface EntityColumn<T, N extends null | never = never, Src extends string = string> extends Expr<\n IdOf<T> | N,\n Src\n> {\n eq(value: T | IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n ne(value: T | IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n // Adding `| null` for GraphQL support\n in(value: readonly (T | IdOf<T> | null)[] | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n /** Applies an IN condition unless the list is empty, null, or undefined. */\n inNonEmpty(value: readonly (T | IdOf<T> | null)[] | null | undefined): SqlCondition;\n nin(value: readonly (T | IdOf<T> | null)[] | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n gt(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n gte(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n lt(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n lte(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition;\n raw(exp: string, bindings: readonly any[] | undefined): SqlCondition;\n}\n\nexport const tableMgmt = Symbol(\"tableMgmt\");\n\nexport function getTableMgmt(table: TableFor<unknown>): TableMgmt {\n return table[tableMgmt];\n}\n\n/** The identity SQL queries bind a table by, plus its original entity metadata. */\nexport interface TableMgmt {\n tableName: string;\n /**\n * The metadata this table was created with, i.e. `table(TaskNew)` keeps `taskNewMeta`.\n *\n * It cannot be re-derived from `tableName`: STI subtypes share their base's table (`Task`, `TaskNew`,\n * and `TaskOld` are all `tasks`), so a `getMetadataForTable(\"tasks\")` lookup can only return the base\n * `Task`, and the alias would lose its subtype identity for explicit subtype joins and entity hydration.\n */\n meta: EntityMetadata;\n}\n\n/** Returns the metadata for the entity that `table` is bound to. */\nexport function getTableMetadata<T extends Entity>(table: TableFor<T>): EntityMetadata<T> {\n const mgmt = table[tableMgmt];\n return mgmt.meta as EntityMetadata<T>;\n}\n\nexport function newTableProxy<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): Table<T> {\n const meta = getMetadata(cstr);\n // The identity SQL queries bind to a source, retaining STI subtype metadata.\n const mgmt: TableMgmt = { tableName: meta.tableName, meta };\n const subtypes = new Map(meta.subTypes.map((m) => [m.type[0].toLowerCase() + m.type.slice(1), m]));\n const proxy: any = new Proxy(cstr, {\n /** Create a physical column expression or a relation join factory. */\n get(_, key: PropertyKey): any {\n if (key === tableMgmt) {\n return mgmt;\n }\n if (typeof key !== \"string\") return undefined;\n const descriptor = Object.hasOwn(meta.columns, key) ? meta.columns[key] : undefined;\n if (descriptor) {\n return descriptor.idMetadata && key !== \"id\"\n ? new EntityColumnImpl(meta, descriptor, mgmt)\n : new PrimitiveColumnImpl(meta, descriptor, mgmt);\n }\n const subtype = subtypes.get(key);\n if (subtype) {\n const join = new SubtypeJoinImpl(proxy, subtype);\n return Object.assign(join.as.bind(join), {\n as: join.as.bind(join),\n inner: join.inner.bind(join),\n left: join.left.bind(join),\n });\n }\n const relation = physicalRelation(meta, key);\n if (key === \"where\" && !isRelation(meta.allFields[key])) {\n return (filter: TableFilter<T>) => tableWhere(mgmt, filter);\n }\n const field = relation ?? fail(`No physical field ${key} on ${cstr.name}; join its base table explicitly`);\n switch (field.kind) {\n case \"m2o\":\n return new ReferenceJoinImpl(new EntityColumnImpl(meta, field.serde.columns[0].column, mgmt));\n case \"poly\":\n return new PolyReferenceImpl(meta, mgmt, field);\n case \"o2m\":\n case \"o2o\":\n case \"lo2m\":\n return new OneToManyJoinImpl(proxy, field);\n case \"m2m\":\n return new ManyToManyJoinImpl(proxy, field);\n default:\n throw new Error(`Unsupported table field kind ${field.kind}`);\n }\n },\n\n has(_, key) {\n return (\n key === tableMgmt ||\n (typeof key === \"string\" &&\n (key === \"where\" || Object.hasOwn(meta.columns, key) || !!physicalRelation(meta, key) || subtypes.has(key)))\n );\n },\n });\n return proxy;\n}\n\nexport function isTable(obj: unknown): obj is Table<any, any> {\n // Oddly enough `typeof` will be a function b/c we are proxying the constructors\n return typeof obj === \"function\" && tableMgmt in obj;\n}\n\n/**\n * A physical table column implements `Expr`: it renders as `alias.\"column\"`, decodes result\n * values through the column's shared scalar codec, and inherits aggregate methods from `BaseExpr`.\n */\nclass TableColumn extends BaseExpr {\n public constructor(\n readonly meta: EntityMetadata,\n readonly column: Column,\n readonly mgmt: TableMgmt,\n ) {\n super();\n }\n\n /** Author.id, Book.authorId, and Comment.parentAuthorId use the same Author ID domain. */\n get outputType(): TypeInfo | undefined {\n return this.column.outputType;\n }\n\n get sqlNullable(): boolean | undefined {\n return this.column.sqlNullable;\n }\n\n get sqlSource(): object {\n return this.mgmt;\n }\n\n toSql(ctx: ExprContext): SqlFragment {\n const alias = ctx.aliasFor(this.mgmt);\n return { sql: kqDot(alias, this.column.columnName), bindings: [], refs: [alias] };\n }\n\n /** Decodes result-set values with public PK/FK ids, while hydration keeps internal tagged ids. */\n decode(value: unknown): unknown {\n if (value === null || value === undefined) return value;\n const idMeta = this.idMetadata;\n if (idMeta) return toIdOf(idMeta, this.column.mapFromDb(value) as TaggedId | undefined);\n return this.column.mapFromDb(value);\n }\n\n encode(value: unknown): unknown {\n return this.column.mapToDb(value);\n }\n\n /** Identifies the ID domain of a primary key, FK, or physical polymorphic component. */\n get idMetadata(): EntityMetadata | undefined {\n return this.column.idMetadata?.();\n }\n\n /** Encodes literals when the condition is created and renders with each query's aliases. */\n addCondition(value: ParsedValueFilter<unknown>): SqlCondition {\n const encoded = mapToDb(this.column, value);\n return deferredCondition((ctx) => {\n const left = this.toSql(ctx);\n const [sql, bindings] = buildValueCondition(left.sql, encoded);\n return { sql, bindings: [...left.bindings, ...bindings], refs: left.refs };\n });\n }\n\n /** Renders raw operators against the same quoted column SQL as other expressions. */\n protected addRawCondition(exp: string, bindings: readonly any[]): SqlCondition {\n return deferredCondition((ctx) => {\n const left = this.toSql(ctx);\n return { sql: `${left.sql} ${exp}`, bindings: [...left.bindings, ...bindings], refs: left.refs };\n });\n }\n\n /** Uses column filter conversions for literals and shared comparisons for expressions and null equality. */\n protected compare(op: string, value: unknown): SqlCondition {\n if (value === undefined || isExpr(value) || (value === null && (op === \"=\" || op === \"!=\"))) {\n return super.compare(op, value);\n }\n // Primitive relational comparisons historically bind null through mapToDb.\n const kind = ({ \"=\": \"eq\", \"!=\": \"ne\", \">\": \"gt\", \">=\": \"gte\", \"<\": \"lt\", \"<=\": \"lte\" } as const)[op];\n if (!kind) return fail(`Invalid operator ${op}`);\n return this.addCondition({ kind, value });\n }\n\n /**\n * Compares this column to another expression.\n *\n * Table columns, aggregates, subquery columns, and `sql` templates use the expression context\n * to render their complete SQL.\n * Negated array operators wrap the complete comparison in NOT.\n */\n protected compareToExpr(op: string, value: ExprLike<any>, negate = false): SqlCondition {\n if (negate) {\n return deferredCondition((ctx) => {\n const comparison = ctx.conditionToSql(this.compareToExpr(op, value))!;\n return { ...comparison, sql: `NOT (${comparison.sql})` };\n });\n }\n return super.compare(op, value);\n }\n}\n\nclass PrimitiveColumnImpl<V, N extends null | never> extends TableColumn implements PrimitiveColumn<V, N> {\n between(v1: V | undefined, v2: V | undefined): SqlCondition {\n if (v1 === undefined || v2 === undefined) return skipCondition;\n return this.addCondition({ kind: \"between\", value: [v1, v2] });\n }\n\n like(value: V | undefined): SqlCondition {\n if (value === undefined) return skipCondition;\n return this.addCondition({ kind: \"like\", value });\n }\n\n ilike(value: V | undefined): SqlCondition {\n if (value === undefined) return skipCondition;\n return this.addCondition({ kind: \"ilike\", value });\n }\n\n search(value: V | undefined): SqlCondition {\n // Check !value so that empty strings are pruned\n if (!value) return skipCondition;\n return this.addCondition({ kind: \"ilike\", value: makeLike(value) });\n }\n\n in(values: readonly (V | null)[] | ExprLike<V | null> | undefined): SqlCondition {\n if (values === undefined) return skipCondition;\n if (isExpr(values)) return this.inList(\"IN\", values);\n if (values.includes(null)) {\n const isNull = this.addCondition({ kind: \"is-null\" });\n const hasValue = this.addCondition({ kind: \"in\", value: values.filter((v) => v !== null) });\n return { or: [isNull, hasValue] };\n } else {\n return this.addCondition({ kind: \"in\", value: values as V[] });\n }\n }\n\n /** Applies an IN condition unless the list is empty or undefined. */\n inNonEmpty(values: readonly (V | null)[] | undefined): SqlCondition {\n return values === undefined || values.length === 0 ? skipCondition : this.in(values);\n }\n\n nin(values: readonly (V | null)[] | ExprLike<V | null> | undefined): SqlCondition {\n if (values === undefined) return skipCondition;\n if (isExpr(values)) return this.inList(\"NOT IN\", values);\n return this.addCondition({ kind: \"nin\", value: values.filter((v) => v !== null) as V[] });\n }\n\n // V will already be an array\n contains(v1: string | V | PrimitiveColumn<V, any> | N | undefined): SqlCondition {\n if (v1 === undefined) return skipCondition;\n if (isExpr(v1)) return this.compareToExpr(\"@>\", v1);\n return this.addCondition({ kind: \"contains\", value: v1 as any });\n }\n\n // V will already be an array\n ncontains(v1: string | V | PrimitiveColumn<V, any> | N | undefined): SqlCondition {\n if (v1 === undefined) return skipCondition;\n if (isExpr(v1)) return this.compareToExpr(\"@>\", v1, true);\n return this.addCondition({ kind: \"ncontains\", value: v1 as any });\n }\n\n // V will already be an array\n overlaps(v1: V | PrimitiveColumn<V, any> | N | undefined): SqlCondition {\n if (v1 === undefined) return skipCondition;\n if (isExpr(v1)) return this.compareToExpr(\"&&\", v1);\n return this.addCondition({ kind: \"overlaps\", value: v1 as any });\n }\n\n noverlaps(v1: V | PrimitiveColumn<V, any> | N | undefined): SqlCondition {\n if (v1 === undefined) return skipCondition;\n if (isExpr(v1)) return this.compareToExpr(\"&&\", v1, true);\n return this.addCondition({ kind: \"noverlaps\", value: v1 as any });\n }\n\n pathExists(jsonPath: string | undefined): SqlCondition {\n if (jsonPath === undefined) return skipCondition;\n return this.addCondition({ kind: \"jsonPathExists\", value: jsonPath });\n }\n\n pathIsTrue(jsonPath: string | undefined): SqlCondition {\n if (jsonPath === undefined) return skipCondition;\n return this.addCondition({ kind: \"jsonPathPredicate\", value: jsonPath });\n }\n\n raw(exp: string, bindings: readonly any[] | undefined): SqlCondition {\n if (bindings === undefined) return skipCondition;\n return this.addRawCondition(exp, bindings);\n }\n}\n\nclass EntityColumnImpl<T> extends TableColumn implements EntityColumn<T> {\n in(values: readonly (T | IdOf<T> | null)[] | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n if (values === undefined) {\n return skipCondition;\n } else if (values === null) {\n throw new Error(\"Unsupported\");\n } else if (isExpr(values)) {\n return this.inList(\"IN\", values);\n } else if (values.includes(null)) {\n // Like `PrimitiveColumn.in`, split `[a1, null]` into `IS NULL OR IN (...)`\n const isNull = this.addCondition({ kind: \"is-null\" });\n const hasValue = this.addCondition({ kind: \"in\", value: values.filter((v) => v !== null) as any });\n return { or: [isNull, hasValue] };\n } else {\n return this.addCondition({ kind: \"in\", value: values as any });\n }\n }\n\n /** Applies an IN condition unless the list is empty, null, or undefined. */\n inNonEmpty(values: readonly (T | IdOf<T> | null)[] | null | undefined): SqlCondition {\n return values === null || values === undefined || values.length === 0 ? skipCondition : this.in(values);\n }\n\n nin(values: readonly (T | IdOf<T> | null)[] | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n if (values === undefined) {\n return skipCondition;\n } else if (values === null) {\n throw new Error(\"Unsupported\");\n } else if (isExpr(values)) {\n return this.inList(\"NOT IN\", values);\n } else {\n return this.addCondition({ kind: \"nin\", value: values.filter((v) => v !== null) as any });\n }\n }\n\n gt(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n return this.compareId(\">\", \"gt\", value);\n }\n\n gte(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n return this.compareId(\">=\", \"gte\", value);\n }\n\n lt(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n return this.compareId(\"<\", \"lt\", value);\n }\n\n lte(value: IdOf<T> | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n return this.compareId(\"<=\", \"lte\", value);\n }\n\n raw(exp: string, bindings: readonly any[] | undefined): SqlCondition {\n if (bindings === undefined) return skipCondition;\n return this.addRawCondition(exp, bindings);\n }\n\n /** Joins via this FK, inheriting the source's LEFT join for otherwise required references. */\n as(other: object): object {\n return {\n ...this.joinEntry(this.sqlNullable === false ? \"inner\" : \"left\", other),\n [referenceJoinSource]: this.mgmt,\n };\n }\n\n inner(other: object): object {\n return this.joinEntry(\"inner\", other);\n }\n\n left(other: object): object {\n return this.joinEntry(\"left\", other);\n }\n\n private joinEntry(kind: JoinKind, other: object): object {\n return { [kind]: requireTable(other), on: this.eq(idColumnOf(other)) };\n }\n\n private compareId(op: string, kind: \"gt\" | \"gte\" | \"lt\" | \"lte\", value: unknown): SqlCondition {\n if (value === undefined) return skipCondition;\n if (value === null) throw new Error(\"Unsupported\");\n if (isExpr(value)) return this.compareToExpr(op, value);\n return this.addCondition({ kind, value: value as any });\n }\n}\n\nclass PolyReferenceImpl<T extends Entity> {\n public constructor(\n private meta: EntityMetadata,\n private mgmt: TableMgmt,\n private field: PolymorphicField,\n ) {}\n\n /** Compares to a tagged id, an entity, or another table's id column, which picks the component (`c.parent.eq(a.id)`). */\n eq(value: T | TaggedId | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n return this.addEqOrNe(\"eq\", value);\n }\n\n ne(value: T | TaggedId | ExprLike<IdOf<T> | null> | null | undefined): SqlCondition {\n return this.addEqOrNe(\"ne\", value);\n }\n\n // We required tagged ids for polys\n in(values: readonly (T | TaggedId)[] | ExprLike<IdOf<T> | null> | undefined): SqlCondition {\n if (values === undefined) return skipCondition;\n if (isExpr(values)) return this.inSubquery(values);\n // Split up the ids by constructor\n const idsByConstructor = groupBy(values, (id) => getConstructorFromTaggedId(maybeResolveReferenceToId(id)!).name);\n // Or together `parent_book_id in (1,2,3) OR parent_author_id IN (4,5,6)`\n return {\n or: Object.entries(idsByConstructor).map(([cstrName, ids]) => {\n const comp =\n this.field.components.find((p) => p.otherMetadata().cstr.name === cstrName) ??\n fail(`No component for ${cstrName}`);\n return this.componentColumn(comp).addCondition({ kind: \"in\", value: ids });\n }),\n };\n }\n\n /** Applies an IN condition unless the list is empty or undefined. */\n inNonEmpty(values: readonly (T | TaggedId)[] | undefined): SqlCondition {\n return values === undefined || values.length === 0 ? skipCondition : this.in(values);\n }\n\n /** Joins via this poly's component, inheriting the source's LEFT join when the poly is required. */\n as(other: object): object {\n return { ...this.joinEntry(this.field.required ? \"inner\" : \"left\", other), [referenceJoinSource]: this.mgmt };\n }\n\n inner(other: object): object {\n return this.joinEntry(\"inner\", other);\n }\n\n left(other: object): object {\n return this.joinEntry(\"left\", other);\n }\n\n private joinEntry(kind: JoinKind, other: object): object {\n return { [kind]: requireTable(other), on: this.eq(idColumnOf(other) as any) };\n }\n\n /**\n * i.e. `c.parent.in(query({ from: a, ..., select: a.id }))`: like `eq` against a table column, the\n * subquery's agreed ID domain picks the component, i.e. authors pick `parent_author_id`.\n */\n private inSubquery(values: ExprLike<any>): SqlCondition {\n // Only actual subqueries expose this getter; importing query.ts would create a load-order cycle.\n const selected = asNode(values).subquerySelect;\n const outputType = selected?.outputType;\n let otherMeta = outputType?.idMeta;\n if (!otherMeta) {\n // Ordinary reads can select an unknown key serde. Compounds validate codecs before exposing a select.\n if (!outputType && selected instanceof TableColumn) {\n otherMeta = selected.idMetadata;\n }\n if (!otherMeta) {\n return fail(\n selected instanceof TableColumn\n ? `${this.field.fieldName} \\`in\\` needs an id or FK column, got ${selected.column.columnName}`\n : `${this.field.fieldName} is polymorphic, so \\`in\\` needs a subquery selecting an id or FK column`,\n );\n }\n }\n const comp =\n this.field.components.find((p) => getBaseAndSelfMetas(otherMeta).includes(p.otherMetadata())) ??\n fail(`${this.field.fieldName} has no component for ${otherMeta.type}`);\n return this.componentColumn(comp).in(values);\n }\n\n private addEqOrNe(\n kind: \"eq\" | \"ne\",\n value: T | TaggedId | ExprLike<IdOf<T> | null> | null | undefined,\n ): SqlCondition {\n if (value === undefined) {\n return skipCondition;\n } else if (value instanceof TableColumn) {\n // Joining through the poly, i.e. `c.parent.eq(a.id)`: the other table column's ID domain picks the component\n const otherMeta = value.idMetadata ?? fail(`${this.field.fieldName} needs an id or FK column`);\n const comp =\n this.field.components.find((p) => getBaseAndSelfMetas(otherMeta).includes(p.otherMetadata())) ??\n fail(`${this.field.fieldName} has no component for ${otherMeta.type}`);\n return this.componentColumn(comp)[kind](value);\n } else if (isExpr(value)) {\n return fail(\n `${this.field.fieldName} is polymorphic, so it can only be compared to tagged ids or entity table columns`,\n );\n } else if (value === null) {\n // We can AND each of the components as many conditions\n const value = kind === \"eq\" ? ({ kind: \"is-null\" } as const) : ({ kind: \"not-null\" } as const);\n return {\n and: this.field.components.map((p) => this.componentColumn(p).addCondition(value)),\n };\n } else {\n // If we have a value, we can find the component\n const comp =\n this.field.components.find(\n (p) => p.otherMetadata().cstr === getConstructorFromTaggedId(maybeResolveReferenceToId(value) as string),\n ) || fail(`Could not find component for ${value}`);\n return this.componentColumn(comp)[kind](value);\n }\n }\n\n /** Returns the physical FK expression for one polymorphic target. */\n private componentColumn(comp: PolymorphicFieldComponent): EntityColumnImpl<T> {\n const descriptor = comp.column;\n return new EntityColumnImpl<T>(this.meta, descriptor, this.mgmt);\n }\n}\n\n/**\n * Marks a sugar join entry whose target is a *collection* (o2m/m2m), which filter soft-deletes like\n * em.find's \"collections filter out soft-deletes, but m2o/o2o references still return them\"; see\n * `QueryParser.addSoftDeleteCondition`'s call site. Reference joins and explicit joins are unmarked.\n */\nexport const collectionJoin: unique symbol = Symbol(\"joist.collectionJoin\");\n\n/** Marks a sugar m2m join entry (`a.tags.as(t)`) with its hidden join-table join; `parseQuery` expands it. */\nexport const m2mJoinTable: unique symbol = Symbol(\"joist.m2mJoinTable\");\n\nexport interface M2mJoinTable {\n handle: JoinTableHandle;\n on: SqlCondition;\n}\n\n/** The runtime identity of an m2m join table in a query, i.e. `authors_to_tags`; it has no entity. */\nexport class JoinTableHandle {\n constructor(readonly joinTableName: string) {}\n}\n\ntype JoinKind = \"inner\" | \"left\";\n\n/**\n * The `as`/`inner`/`left` join factory for collection relations, i.e. `a.books.as(b)` joins with the\n * relation's default kind (LEFT: a collection may be empty) and `.inner`/`.left` override. m2o/poly\n * relations implement the same three methods on their join factories. Physical FKs such as\n * `b.author_id` are expressions that also expose a join factory.\n */\nabstract class CollectionJoinImpl {\n as(other: object): object {\n return this.joinEntry(\"left\", requireTable(other));\n }\n\n inner(other: object): object {\n return this.joinEntry(\"inner\", requireTable(other));\n }\n\n left(other: object): object {\n return this.joinEntry(\"left\", requireTable(other));\n }\n\n protected abstract joinEntry(kind: JoinKind, other: TableFor<Entity>): object;\n}\n\n/** Joins a named subtype explicitly; only STI subtype sugar adds a discriminator to its ON. */\nclass SubtypeJoinImpl extends CollectionJoinImpl {\n constructor(\n private proxy: TableFor<Entity>,\n private subtype: EntityMetadata,\n ) {\n super();\n }\n\n protected joinEntry(kind: JoinKind, other: TableFor<Entity>): object {\n if (getTableMetadata(other) !== this.subtype) {\n return fail(`Expected table(${this.subtype.type}) for the explicit subtype join`);\n }\n const on = idColumnOf(this.proxy).eq(idColumnOf(other));\n if (this.subtype.inheritanceType !== \"sti\" || this.subtype.stiDiscriminatorValue === undefined) {\n return { [kind]: other, on };\n }\n const base = this.subtype.baseTypes.find((m) => m.stiDiscriminatorField !== undefined)!;\n const columnName = base.fields[base.stiDiscriminatorField!].serde!.columns[0].columnName;\n // Discriminator values are database enum ids, not domain enum values to pass through the field codec.\n const discriminator = deferredCondition((ctx) => {\n const alias = ctx.aliasFor(other[tableMgmt]);\n return {\n sql: `${kqDot(alias, columnName)} = ?`,\n bindings: [this.subtype.stiDiscriminatorValue],\n refs: [alias],\n };\n });\n return { [kind]: other, on: { and: [on, discriminator] } };\n }\n}\n\n/** An o2m/lo2m/o2o relation: the ON is the other side's FK (an m2o or a poly component) back to our id. */\nclass OneToManyJoinImpl extends CollectionJoinImpl {\n constructor(\n private proxy: any,\n private field: OneToManyField | LargeOneToManyField | OneToOneField,\n ) {\n super();\n }\n\n protected joinEntry(kind: JoinKind, other: TableFor<Entity>): object {\n const { field } = this;\n const otherMeta = getTableMetadata(other);\n const descriptor = Object.values(otherMeta.columns).find((column) => column.columnName === field.otherColumnName);\n if (!descriptor) {\n return fail(\n `Cannot join ${getTableMetadata(this.proxy).type}.${field.fieldName} to ${otherMeta.type}: ` +\n `${field.otherColumnName} is not physically present on ${otherMeta.tableName}; join the base table explicitly`,\n );\n }\n const column = new EntityColumnImpl(otherMeta, descriptor, other[tableMgmt]);\n const on = column.eq(this.proxy.id);\n // Collections (o2m/lo2m) filter soft-deletes like em.find; o2o references resolve them\n const filtered = field.kind === \"o2m\" ? field.softDeletes !== \"include\" : field.kind === \"lo2m\";\n return { [kind]: other, on, [collectionJoin]: filtered };\n }\n}\n\n/**\n * An m2m relation, i.e. `a.tags.as(t)`.\n *\n * The entry's own ON is `t.id = att.tag_id`, and the hidden `[m2mJoinTable]` half is\n * `att.author_id = a.id`; only the target's ON references the join table, so reference pruning keeps\n * or drops the pair together. Both are deferred conditions: the join table has no entity metadata, so\n * its alias only exists once the parser registers it.\n */\nclass ManyToManyJoinImpl extends CollectionJoinImpl {\n constructor(\n private proxy: any,\n private field: ManyToManyField,\n ) {\n super();\n }\n\n protected joinEntry(kind: JoinKind, other: TableFor<Entity>): object {\n const { joinTableName, columnNames } = this.field;\n const [ourColumn, otherColumn] = columnNames;\n const jt = new JoinTableHandle(joinTableName);\n const ourId = idColumnOf(this.proxy);\n const otherId = idColumnOf(other);\n const jtOn = deferredCondition((ctx) => {\n const jtAlias = ctx.aliasFor(jt);\n const id = ourId.toSql(ctx);\n return { sql: `${kqDot(jtAlias, ourColumn)} = ${id.sql}`, bindings: id.bindings, refs: id.refs };\n });\n const on = deferredCondition((ctx) => {\n const jtAlias = ctx.aliasFor(jt);\n const id = otherId.toSql(ctx);\n return { sql: `${id.sql} = ${kqDot(jtAlias, otherColumn)}`, bindings: id.bindings, refs: [...id.refs, jtAlias] };\n });\n const filtered = this.field.softDeletes !== \"include\";\n return {\n [kind]: other,\n on,\n [collectionJoin]: filtered,\n [m2mJoinTable]: { handle: jt, on: jtOn } satisfies M2mJoinTable,\n };\n }\n}\n\n/** Fails fast when a join factory is passed something other than a table. */\nfunction requireTable(other: object): TableFor<Entity> {\n if (!isTable(other)) return fail(`Expected a table to join, got ${other}`);\n return other;\n}\n\n/** The id column of a joined table, for building sugar ON conditions. */\nfunction idColumnOf(other: object): TableColumn {\n return (other as any).id;\n}\n\n/** Keeps relation names join-only; physical FK columns retain expression methods. */\nclass ReferenceJoinImpl {\n constructor(private column: EntityColumnImpl<unknown>) {}\n\n as(other: object): object {\n return this.column.as(other);\n }\n\n inner(other: object): object {\n return this.column.inner(other);\n }\n\n left(other: object): object {\n return this.column.left(other);\n }\n}\n\n/** Identifies domain relationship keys exposed alongside physical columns. */\nfunction isRelation(field: Field | undefined): boolean {\n return field !== undefined && [\"m2o\", \"poly\", \"o2m\", \"lo2m\", \"m2m\", \"o2o\"].includes(field.kind);\n}\n\n/** Resolves relationship sugar only from domain fields owned by this physical table. */\nfunction physicalRelation(meta: EntityMetadata, key: string): Field | undefined {\n const owners = [meta, ...getBaseSelfAndSubMetas(getBaseMeta(meta))];\n const owner = owners.find((owner) => owner.tableName === meta.tableName && Object.hasOwn(owner.fields, key));\n const field = owner?.fields[key];\n if (!isRelation(field)) return undefined;\n // I.e. TaskNew.copiedFrom uses Task's original FK domain, not its specialized TaskNew target.\n if (field?.kind === \"m2o\" || field?.kind === \"poly\") {\n if (!field.serde.columns.every((binding) => Object.values(meta.columns).includes(binding.column))) return undefined;\n return field.kind === \"poly\"\n ? {\n ...field,\n components: field.components.map((component) => ({\n column: component.column,\n columnName: component.columnName,\n otherFieldName: component.otherFieldName,\n otherMetadata: component.column.idMetadata!,\n })),\n }\n : field;\n }\n return field;\n}\n\n/**\n * Maps local domain fields to table-bound conditions, encoding each leaf once.\n * I.e. Author.firstName uses the first_name column but resolves its alias in each query scope.\n * Collections, polymorphic references, and inherited nonlocal fields require explicit expressions.\n */\nfunction tableWhere(mgmt: TableMgmt, filter: object): SqlCondition {\n const { meta } = mgmt;\n const conditions: SqlCondition[] = [];\n if (!filter || typeof filter !== \"object\" || Array.isArray(filter)) {\n throw new Error(`Expected a domain field filter for ${meta.type}`);\n }\n for (const [key, value] of Object.entries(filter)) {\n // CTI allFields.id points at the base key; the subtype has its own physical key.\n const field = key === \"id\" ? meta.fields.id : Object.hasOwn(meta.allFields, key) ? meta.allFields[key] : undefined;\n if (\n !field ||\n ![\"primaryKey\", \"primitive\", \"enum\", \"m2o\"].includes(field.kind) ||\n !field.serde ||\n field.serde.columns.length !== 1 ||\n !field.serde.columns.every((binding) => Object.values(meta.columns).includes(binding.column))\n ) {\n throw new Error(`Unsupported table filter field ${meta.type}.${key}; use an explicit join`);\n }\n const column = new TableColumn(meta, field.serde.columns[0].column, mgmt);\n let leaves: ParsedValueFilter<unknown>[];\n if (field.kind === \"m2o\") {\n if (!isTableReferenceFilter(value)) {\n throw new Error(`Unsupported table reference filter ${meta.type}.${key}; use an entity or ID`);\n }\n const parsed = parseEntityFilter(field.otherMetadata(), value);\n if (parsed?.kind === \"join\") {\n throw new Error(`Unsupported table reference filter ${meta.type}.${key}; use an entity or ID`);\n }\n leaves = parsed ? [parsed] : [];\n } else {\n leaves = parseValueFilter(value);\n }\n for (const leaf of leaves) {\n if (leaf.kind === \"between\" && leaf.value.some((v) => v === undefined)) {\n if (leaf.value[0] !== undefined) conditions.push(column.addCondition({ kind: \"gte\", value: leaf.value[0] }));\n if (leaf.value[1] !== undefined) conditions.push(column.addCondition({ kind: \"lte\", value: leaf.value[1] }));\n } else if (leaf.kind === \"in\" && !column.column.isArray && leaf.value.includes(null)) {\n conditions.push({\n or: [\n column.addCondition({ kind: \"is-null\" }),\n column.addCondition({ kind: \"in\", value: leaf.value.filter((v) => v !== null) }),\n ],\n });\n } else {\n conditions.push(column.addCondition(leaf));\n }\n }\n }\n return conditions.length === 0 ? skipCondition : { and: conditions };\n}\n\n/** Rejects nested relations, scopes, and aliases before parsing owning-reference values. */\nfunction isTableReferenceFilter(value: unknown): boolean {\n if (value == null || typeof value === \"boolean\" || isTableReferenceValue(value)) return true;\n if (Array.isArray(value)) return value.every(isTableReferenceValue);\n if (typeof value === \"object\" && Object.keys(value).length === 1 && Object.hasOwn(value, \"ne\")) {\n const excluded = (value as { ne: unknown }).ne;\n return excluded == null || isTableReferenceValue(excluded);\n }\n return false;\n}\n\n/** Recognizes an entity or public ID without accepting another filter object. */\nfunction isTableReferenceValue(value: unknown): boolean {\n return typeof value === \"string\" || typeof value === \"number\" || isEntity(value);\n}\n"],"mappings":";;;;;;;;;;;;;AAyDA,SAAgB,MAAwB,MAAyC,OAAyB;CAExG,OAAO,cAAc,IAAI;AAC3B;;AAGA,SAAgB,OACd,GAAG,MACyG;CAC5G,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC,CAAC;AACzC;;AAyHA,MAAa,sBAAqC,OAAO,2BAA2B;AAgIpF,MAAa,YAAY,OAAO,WAAW;AAE3C,SAAgB,aAAa,OAAqC;CAChE,OAAO,MAAM;AACf;;AAgBA,SAAgB,iBAAmC,OAAuC;CAExF,OADa,MAAM,UACR,CAAC;AACd;AAEA,SAAgB,cAAgC,MAAmD;CACjG,MAAM,OAAOA,uBAAAA,YAAY,IAAI;CAE7B,MAAM,OAAkB;EAAE,WAAW,KAAK;EAAW;CAAK;CAC1D,MAAM,WAAW,IAAI,IAAI,KAAK,SAAS,KAAK,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,YAAY,IAAI,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;CACjG,MAAM,QAAa,IAAI,MAAM,MAAM;;EAEjC,IAAI,GAAG,KAAuB;GAC5B,IAAI,QAAQ,WACV,OAAO;GAET,IAAI,OAAO,QAAQ,UAAU,OAAO,KAAA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0B;EAC5C,OAAO,YAAY,QAAQ,sBAAsB,QAAQ;CAC3D;CACA,OAAO;AACT;;AAGA,SAAS,sBAAsB,OAAyB;CACtD,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,YAAYW,eAAAA,SAAS,KAAK;AACjF"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { EntityMetadata } from "
|
|
4
|
-
import "./configure.cjs";
|
|
1
|
+
import { ColumnsOf, FieldsOf, FilterOf, TypeMap, TypeNameOf } from "../../typeMap.cjs";
|
|
2
|
+
import { SqlCondition } from "../conditions.cjs";
|
|
3
|
+
import { EntityMetadata } from "../../EntityMetadata.cjs";
|
|
5
4
|
import { Expr, ExprLike, InnerJoin, LeftJoin } from "./Expr.cjs";
|
|
6
|
-
import { IdOf, MaybeAbstractEntityConstructor, TaggedId } from "
|
|
7
|
-
import { Entity } from "
|
|
8
|
-
//#region src/Tables.d.ts
|
|
5
|
+
import { IdOf, MaybeAbstractEntityConstructor, TaggedId } from "../../EntityManager.cjs";
|
|
6
|
+
import { Entity } from "../../Entity.cjs";
|
|
7
|
+
//#region src/queries/sql/Tables.d.ts
|
|
9
8
|
/** Creates physical column expressions and relationship joins for `T`. */
|
|
10
9
|
declare function table<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): Table<T>;
|
|
11
10
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tables.d.cts","names":[],"sources":["../../../src/queries/sql/Tables.ts"],"mappings":";;;;;;;;iBA8CgB,MAAM,UAAU,QAAQ,MAAM,+BAA+B,KAAK,MAAM;;;;;;;iBAOxE,MAAM,UAAU,QAAQ,qBACtC,MAAM,+BAA+B,IACrC,MAAM,OACL,MAAM,GAAG;;iBAOI,OAAO,mBAAmB,0CACrC,MAAM,OACL,WAAW,IAAI,EAAE,WAAW,qCAAqC,UAAU,UAAU,MAAM;;;;;;;UAUhF,WAAW,GAAG,6BAA6B;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,OAAO,SAAS,KAAK,eAAe;iBAKvE,cAAc,UAAU,QAAQ,MAAM,+BAA+B,KAAK,MAAM;iBA2DhF,QAAQ,eAAe,OAAO;;;;;;cAgZjC;;cAGA;UAEI;EACf,QAAQ;EACR,IAAI;;;cAIO;WACU;EAArB,YAAqB"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { EntityMetadata } from "
|
|
4
|
-
import "./configure.mjs";
|
|
1
|
+
import { ColumnsOf, FieldsOf, FilterOf, TypeMap, TypeNameOf } from "../../typeMap.mjs";
|
|
2
|
+
import { SqlCondition } from "../conditions.mjs";
|
|
3
|
+
import { EntityMetadata } from "../../EntityMetadata.mjs";
|
|
5
4
|
import { Expr, ExprLike, InnerJoin, LeftJoin } from "./Expr.mjs";
|
|
6
|
-
import { IdOf, MaybeAbstractEntityConstructor, TaggedId } from "
|
|
7
|
-
import { Entity } from "
|
|
8
|
-
//#region src/Tables.d.ts
|
|
5
|
+
import { IdOf, MaybeAbstractEntityConstructor, TaggedId } from "../../EntityManager.mjs";
|
|
6
|
+
import { Entity } from "../../Entity.mjs";
|
|
7
|
+
//#region src/queries/sql/Tables.d.ts
|
|
9
8
|
/** Creates physical column expressions and relationship joins for `T`. */
|
|
10
9
|
declare function table<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): Table<T>;
|
|
11
10
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tables.d.mts","names":[],"sources":["../../../src/queries/sql/Tables.ts"],"mappings":";;;;;;;;iBA8CgB,MAAM,UAAU,QAAQ,MAAM,+BAA+B,KAAK,MAAM;;;;;;;iBAOxE,MAAM,UAAU,QAAQ,qBACtC,MAAM,+BAA+B,IACrC,MAAM,OACL,MAAM,GAAG;;iBAOI,OAAO,mBAAmB,0CACrC,MAAM,OACL,WAAW,IAAI,EAAE,WAAW,qCAAqC,UAAU,UAAU,MAAM;;;;;;;UAUhF,WAAW,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iB,UAAU,QAAQ,OAAO,SAAS,KAAK,eAAe;iBAKvE,cAAc,UAAU,QAAQ,MAAM,+BAA+B,KAAK,MAAM;iBA2DhF,QAAQ,eAAe,OAAO;;;;;;cAgZjC;;cAGA;UAEI;EACf,QAAQ;EACR,IAAI;;;cAIO;WACU;EAArB,YAAqB"}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import "./conditions.js";
|
|
2
|
-
import "./typeMap.js";
|
|
3
1
|
import { kqDot } from "./keywords.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { fail } from "./utils.js";
|
|
7
|
-
import { buildValueCondition } from "./drivers/buildUtils.js";
|
|
8
|
-
import { skipCondition } from "./skipCondition.js";
|
|
2
|
+
import { skipCondition } from "../skipCondition.js";
|
|
3
|
+
import { makeLike, mapToDb, parseEntityFilter, parseValueFilter } from "../valueFilters.js";
|
|
9
4
|
import { BaseExpr, asNode, deferredCondition, isExpr } from "./Expr.js";
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { fail } from "../../utils.js";
|
|
6
|
+
import { maybeResolveReferenceToId, toIdOf } from "../../keys.js";
|
|
7
|
+
import { getConstructorFromTaggedId } from "../../configure.js";
|
|
8
|
+
import { getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getMetadata } from "../../EntityMetadata.js";
|
|
9
|
+
import { buildValueCondition } from "../renderConditions.js";
|
|
10
|
+
import { isEntity } from "../../Entity.js";
|
|
15
11
|
import { groupBy } from "joist-utils";
|
|
16
|
-
//#region src/Tables.ts
|
|
12
|
+
//#region src/queries/sql/Tables.ts
|
|
17
13
|
function table(cstr, _name) {
|
|
18
14
|
return newTableProxy(cstr);
|
|
19
15
|
}
|