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
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { getInstanceData } from \"./BaseEntity.ts\";\nimport { getDefaultDependencies } from \"./defaults.ts\";\nimport { buildWhereClause } from \"./drivers/buildUtils.ts\";\nimport { type Entity } from \"./Entity.ts\";\nimport { type EntityConstructor, type MaybeAbstractEntityConstructor } from \"./EntityManager.ts\";\nimport { type EntityMetadata, getBaseMeta, getMetadata } from \"./EntityMetadata.ts\";\nimport { getField, setField } from \"./fields.ts\";\nimport { getProperties } from \"./getProperties.ts\";\nimport { type New } from \"./loadHints.ts\";\nimport { isAllSqlPaths } from \"./loadLens.ts\";\nimport { FactoryInitialValue } from \"./newTestInstance.ts\";\nimport { partitionHint } from \"./preloading/partitionHint.ts\";\nimport { AbstractRelationImpl } from \"./relations/AbstractRelationImpl.ts\";\nimport { AsyncReactiveFieldImpl } from \"./relations/AsyncReactiveField.ts\";\nimport {\n isAsyncProperty,\n isAsyncReactiveField,\n isLazyField,\n isProperty,\n isReactiveField,\n isReactiveGetter,\n} from \"./relations/index.ts\";\nimport { ReactiveFieldImpl } from \"./relations/ReactiveField.ts\";\nimport { type OptsOf } from \"./typeMap.ts\";\nimport { fail } from \"./utils.ts\";\n\nexport const testing = { isAllSqlPaths, getDefaultDependencies, partitionHint };\nexport const internals = { buildWhereClause };\nexport { newPgConnectionConfig } from \"joist-utils\";\nexport { AliasAssigner } from \"./AliasAssigner.ts\";\nexport {\n type AndCondition,\n type ConditionGroup,\n type DomainPredicate,\n type OrCondition,\n type PredicateBrand,\n type SqlCondition,\n type SqlPredicate,\n} from \"./conditions.ts\";\n// Domain aliases belong to em.find; physical table expressions belong to em.query/em.execute.\nexport {\n alias,\n aliases,\n getAliasMetadata,\n getAliasMgmt,\n getMaybeCtiAlias,\n isAlias,\n newAliasProxy,\n type Alias,\n type AliasBrand,\n type AliasMgmt,\n type AliasColumn,\n type EntityAlias,\n type PolyAlias,\n type PrimitiveAlias,\n} from \"./Aliases.ts\";\nexport {\n table,\n tables,\n tableMgmt,\n getTableMetadata,\n getTableMgmt,\n isTable,\n newTableProxy,\n type Table,\n type TableFilter,\n type TableBrand,\n type TableFor,\n type TableMgmt,\n type ReferenceJoin,\n type PrimitiveColumn,\n type EntityColumn,\n type ReferenceColumn,\n type CollectionJoin,\n type PolyReference,\n} from \"./Tables.ts\";\nexport { BaseEntity, getInstanceData } from \"./BaseEntity.ts\";\nexport { ConditionBuilder } from \"./ConditionBuilder.ts\";\nexport { type Entity, type IdType, isEntity } from \"./Entity.ts\";\nexport type * from \"./EntityFields.ts\";\nexport * from \"./EntityFilter.ts\";\nexport * from \"./EntityGraphQLFilter.ts\";\nexport * from \"./EntityManager.ts\";\nexport * from \"./EntityMetadata.ts\";\nexport type {\n DeleteStatement,\n ExecuteResult,\n InsertStatement,\n InsertValues,\n MutationReturning,\n MutationStatement,\n UpdateStatement,\n UpdateValues,\n} from \"./execute.ts\";\nexport type { EnumMetadata } from \"./EnumMetadata.ts\";\n// `em.query`'s expression surface. Only the user-facing types are re-exported: the runtime half\n// (BaseExpr, asNode, deferredCondition, the FnExpr/TemplateExpr node classes) stays internal to\n// joist-core, so `toSql`/`decode`/`encode` never show up as something a user could call.\nexport {\n type ArrayAggOptions,\n type Expr,\n type ExprBrand,\n exprBrand,\n type ExprLike,\n type InnerJoin,\n type LeftJoin,\n} from \"./Expr.ts\";\nexport { expr, type CaseElse, type CaseWhen, type ExprFromInput, type ExprInput } from \"./expressions/expression.ts\";\nexport { skipCondition } from \"./skipCondition.ts\";\nexport type { EntityOrId, HintNode } from \"./HintTree.ts\";\nexport { InstanceData } from \"./InstanceData.ts\";\nexport { type JoinColumnValue, type JoinRow, JoinRowOperation, type ManyToManyLike } from \"./JoinRows.ts\";\nexport type * from \"./PendingChanges.ts\";\nexport { Plugin } from \"./PluginManager.ts\";\nexport * from \"./QueryParser.ts\";\nexport * from \"./QueryParser.collectionJoins.ts\";\nexport { visitConditions } from \"./QueryVisitor.ts\";\nexport * from \"./RowData.ts\";\nexport { type JoinRowTodo, Todo } from \"./Todo.ts\";\nexport * from \"./changes.ts\";\nexport { ConfigApi, type EntityHook, resetBootFlag } from \"./config.ts\";\nexport {\n configureMetadata,\n getConstructorFromTaggedId,\n getMetadataForTable,\n getMetadataForType,\n maybeGetConstructorFromReference,\n} from \"./configure.ts\";\nexport { driverApi } from \"./driverApi.ts\";\nexport * from \"./drivers/index.ts\";\nexport { getField, isChangeableField, isFieldSet, setField } from \"./fields.ts\";\nexport * from \"./getProperties.ts\";\nexport * from \"./json.ts\";\nexport * from \"./keys.ts\";\nexport { kq, kqDot, kqStar } from \"./keywords.ts\";\nexport {\n assertLoaded,\n type DeepNew,\n ensureLoaded,\n isLoaded,\n isNew,\n type Loadable,\n type Loaded,\n type LoadHint,\n type MarkLoaded,\n maybePopulateThen,\n type NestedLoadHint,\n type New,\n type RelationsIn,\n unsafeLoaded,\n} from \"./loadHints.ts\";\nexport * from \"./loadLens.ts\";\nexport { setFactoryWriter } from \"./logging/FactoryLogger.ts\";\nexport * from \"./logging/FieldLogger.ts\";\nexport { ReactionLogger, setReactionLogging } from \"./logging/ReactionLogger.ts\";\nexport { lazyField } from \"./newEntity.ts\";\nexport {\n defaultValue,\n factories,\n type FactoryEntityOpt,\n type FactoryOpts,\n getTestIndex,\n isFactoryCreation,\n maybeBranchValue,\n maybeNew,\n maybeNewPoly,\n newTestInstance,\n noValue,\n setFactoryLogging,\n testIndex,\n} from \"./newTestInstance.ts\";\nexport { deepNormalizeHint, normalizeHint } from \"./normalizeHints.ts\";\nexport { ImmutableEntitiesPlugin } from \"./plugins/ImmutableEntitiesPlugin.ts\";\nexport type { JoinResult, PreloadHydrator, PreloadPlugin } from \"./plugins/PreloadPlugin.ts\";\nexport { JsonAggregatePreloader } from \"./preloading/JsonAggregatePreloader.ts\";\n// `em.query`'s query surface; the parse pipeline (SubqueryHandle, parseUserQuery, Plan) stays internal\nexport {\n type CheckScope,\n type Clauses,\n type EntityQuery,\n type ExpressionOrderBy,\n type ExistsQuery,\n entityQueryBrand,\n type MaybeNull,\n type NameOf,\n type NotWidened,\n type OrderByDirection,\n type OrderByKeys,\n type Query,\n type QueryArg,\n type QueryCondition,\n type QueryJoin,\n type QueryJoins,\n type QueryRow,\n type QuerySelect,\n type QuerySource,\n type QueryValue,\n recursiveQuery,\n type RecursiveOptions,\n type ScalarQuery,\n type SetQuery,\n query,\n sql,\n type Subquery,\n type SubqueryBrand,\n subqueryBrand,\n type WithInput,\n type WithSource,\n} from \"./query.ts\";\nexport {\n convertToLoadHint,\n isTypeOrSubType,\n type Reactable,\n type Reacted,\n type ReactiveHint,\n type ReactiveTarget,\n reverseReactiveHint,\n} from \"./reactiveHints.ts\";\nexport * from \"./relations/index.ts\";\nexport {\n cannotBeChanged,\n cannotBeUpdated,\n type GenericError,\n maxValueRule,\n minValueRule,\n mustBeSubType,\n newRequiredLazyFieldRule,\n newRequiredRule,\n rangeValueRule,\n ValidationCode,\n type ValidationError,\n ValidationErrors,\n type ValidationRule,\n type ValidationRuleInternal,\n type ValidationRuleResult,\n} from \"./rules.ts\";\nexport { getRuntimeConfig, setRuntimeConfig, type RuntimeConfig } from \"./runtimeConfig.ts\";\nexport { nowUTC } from \"./nowUTC.ts\";\nexport * from \"./serde.ts\";\nexport * from \"./columns.ts\";\nexport * from \"./fieldSerde.ts\";\nexport * from \"./scopes.ts\";\nexport { maybeRequireTemporal, requireTemporal, Temporal } from \"./temporal.ts\";\nexport * from \"./temporalMappers.ts\";\nexport { isInTrustedContext, runInTrustedContext } from \"./trusted.ts\";\nexport type * from \"./typeMap.ts\";\nexport { buildUnnestCte, ensureRectangularArraySizes } from \"./unnest.ts\";\nexport { type DeepPartialOrNull, updatePartial, upsert } from \"./upsert.ts\";\nexport {\n abbreviation,\n asNew,\n assertNever,\n cleanSql,\n cleanStringValue,\n fail,\n failIfAnyRejected,\n indexBy,\n partition,\n zeroTo,\n} from \"./utils.ts\";\nexport { ensureWithLoaded, StubbedRelation, type WithLoaded, withLoaded } from \"./withLoaded.ts\";\n\n// https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/\ninterface Flavoring<FlavorT> {\n _type?: FlavorT;\n}\n\nexport type Flavor<T, FlavorT> = T & Flavoring<FlavorT>;\n\n/**\n * Sets each value in `values` on the current entity.\n *\n * The default behavior is that passing a value as either `null` or `undefined` will set\n * the field as `undefined`, i.e. automatic `null` to `undefined` conversion.\n *\n * However, if you pass `ignoreUndefined: true`, then any opt that is `undefined` will be treated\n * as \"do not set\", and `null` will still mean \"set to `undefined`\". This is useful for implementing\n * APIs were an input of `undefined` means \"do not set / noop\" and `null` means \"unset\".\n *\n * Note that constructors _always_ call this method, but if the call is coming from `em.hydrate`, we\n * use `values` being a primary key to short-circuit and let hydration callers assign the values\n * returned by the serde `fromRow` methods.\n */\nexport function setOpts<T extends Entity>(\n entity: T,\n values: Partial<OptsOf<T>> | undefined,\n opts?: { partial?: boolean; calledFromConstructor?: boolean },\n): void {\n const { calledFromConstructor = false, partial } = opts || {};\n // If `values` is undefined, we're being called by `createPartial` that will do its\n // own opt handling, but we still want the sync defaults applied after this opts handling.\n if (values !== undefined) {\n const meta = getMetadata(entity);\n for (const [key, _value] of Object.entries(values as {})) {\n setOpt(meta, entity, key, _value, partial, calledFromConstructor);\n }\n }\n}\n\n/**\n * Applies some standard behavior & protections to `entity[key] = value`. I.e.\n *\n * - We don't set over AsyncProperties/relations/etc., and instead call current.set(value)\n * - We catch missing/invalid field names\n * - We handle FactoryInitialValues\n */\nexport function setOpt<T extends Entity>(\n meta: EntityMetadata<T>,\n entity: T,\n key: string,\n _value: any,\n partial = false,\n calledFromConstructor = false,\n): void {\n const field = meta.allFields[key];\n if (!field) {\n // Allow setting non-field properties like fullName setters\n const prop = getProperties(meta)[key];\n if (!prop) {\n throw new Error(`Unknown field ${key}`);\n }\n }\n\n // If partial is set, we treat undefined as a noop\n if (partial && _value === undefined) return;\n // Ignore the STI discriminator, em.register will set this accordingly\n if (meta.inheritanceType === \"sti\" && getBaseMeta(meta).stiDiscriminatorField === key) return;\n\n // We let optional opts fields be `| null` for convenience, and convert to undefined.\n const value = _value === null ? undefined : _value;\n\n // Use `getField` to side-step `id` blowing up on new entities that are setting an\n // explicit id; otherwise use `entity[key]` to get back the relation.\n const current = key === \"id\" ? getField(entity, key) : (entity as any)[key];\n\n if (current instanceof AbstractRelationImpl) {\n if (calledFromConstructor) {\n current.setFromOpts(value);\n } else {\n current.set(value);\n }\n } else if (isLazyField(current)) {\n current.set(value);\n } else if (isProperty(current) || isAsyncProperty(current) || isReactiveGetter(current)) {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n } else if (isReactiveField(current) || isAsyncReactiveField(current)) {\n if (value instanceof FactoryInitialValue) {\n if (current instanceof ReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else if (current instanceof AsyncReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else {\n throw new Error(`Unhandled case ${current.constructor.name}`);\n }\n } else {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n }\n } else {\n // If setting an explicit id, go through setField, otherwise use\n // `entity[key]` to set the value directly to that we go through setters.\n if (key === \"id\" && entity.isNewEntity) {\n setField(entity, key, value);\n } else {\n (entity as any)[key] = value;\n }\n }\n}\n\nexport function ensureNotDeleted(entity: Entity, ignore?: \"pending\"): void {\n if (entity.isDeletedEntity && (ignore === undefined || getInstanceData(entity).isDeletedAndFlushed)) {\n fail(`${entity} is marked as deleted`);\n }\n}\n\n/** Adds `null` to every key in `T` to accept partial-update-style input. */\nexport type PartialOrNull<T> = {\n [P in keyof T]?: T[P] | null;\n};\n\nexport function getRequiredKeys<T extends Entity>(entity: T): string[];\nexport function getRequiredKeys<T extends Entity>(type: EntityConstructor<T>): string[];\nexport function getRequiredKeys<T extends Entity>(entityOrType: T | EntityConstructor<T>): string[] {\n return Object.values(getMetadata(entityOrType as any).fields)\n .filter((f) => f.required)\n .map((f) => f.fieldName);\n}\n\nexport function getRelations(entity: Entity): AbstractRelationImpl<any, any>[] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => (entity as any)[name]);\n}\n\nexport function getRelationEntries(entity: Entity): [string, AbstractRelationImpl<any, any>][] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => [name, (entity as any)[name]]);\n}\n\n/** Casts a \"maybe abstract\" cstr to a concrete cstr when the calling code knows it's safe. */\nexport function asConcreteCstr<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): EntityConstructor<T> {\n return cstr as any;\n}\n\n/**\n * Thrown when `.id` is accessed on an entity that does not have an id yet.\n *\n * For Postgres, entities are actually allowed to have ids pre-INSERT, if you call\n * `em.assignNewIds()`. Other databases typically require INSERTs to trigger the auto\n * id assignment.\n */\nexport class NoIdError extends Error {}\n\n/** Throws a `NoIdError` for `entity`, i.e. because `id` was called before being saved. */\nexport function failNoIdYet(entity: string): never {\n throw new NoIdError(`${entity} has no id yet`);\n}\n\n/**\n * Add a static function since getters can't have type guards.\n *\n * See https://github.com/microsoft/TypeScript/issues/43368\n */\nexport function isNewEntity<T extends Entity>(entity: T): entity is New<T> {\n return entity.isNewEntity;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { getInstanceData } from \"./BaseEntity.ts\";\nimport { getDefaultDependencies } from \"./defaults.ts\";\nimport { type Entity } from \"./Entity.ts\";\nimport { type EntityConstructor, type MaybeAbstractEntityConstructor } from \"./EntityManager.ts\";\nimport { type EntityMetadata, getBaseMeta, getMetadata } from \"./EntityMetadata.ts\";\nimport { getField, setField } from \"./fields.ts\";\nimport { getProperties } from \"./getProperties.ts\";\nimport { type New } from \"./loadHints.ts\";\nimport { isAllSqlPaths } from \"./loadLens.ts\";\nimport { FactoryInitialValue } from \"./newTestInstance.ts\";\nimport { partitionHint } from \"./preloading/partitionHint.ts\";\nimport { buildWhereClause } from \"./queries/renderConditions.ts\";\nimport { AbstractRelationImpl } from \"./relations/AbstractRelationImpl.ts\";\nimport { AsyncReactiveFieldImpl } from \"./relations/AsyncReactiveField.ts\";\nimport {\n isAsyncProperty,\n isAsyncReactiveField,\n isLazyField,\n isProperty,\n isReactiveField,\n isReactiveGetter,\n} from \"./relations/index.ts\";\nimport { ReactiveFieldImpl } from \"./relations/ReactiveField.ts\";\nimport { type OptsOf } from \"./typeMap.ts\";\nimport { fail } from \"./utils.ts\";\n\nexport const testing = { isAllSqlPaths, getDefaultDependencies, partitionHint };\nexport const internals = { buildWhereClause };\nexport { newPgConnectionConfig } from \"joist-utils\";\nexport { AliasAssigner } from \"./queries/sql/AliasAssigner.ts\";\nexport {\n type AndCondition,\n type ConditionGroup,\n type DomainPredicate,\n type OrCondition,\n type PredicateBrand,\n type SqlCondition,\n type SqlPredicate,\n} from \"./queries/conditions.ts\";\n// Domain aliases belong to em.find; physical table expressions belong to em.query/em.execute.\nexport {\n alias,\n aliases,\n getAliasMetadata,\n getAliasMgmt,\n getMaybeCtiAlias,\n isAlias,\n newAliasProxy,\n type Alias,\n type AliasBrand,\n type AliasMgmt,\n type AliasColumn,\n type EntityAlias,\n type PolyAlias,\n type PrimitiveAlias,\n} from \"./queries/find/Aliases.ts\";\nexport {\n table,\n tables,\n tableMgmt,\n getTableMetadata,\n getTableMgmt,\n isTable,\n newTableProxy,\n type Table,\n type TableFilter,\n type TableBrand,\n type TableFor,\n type TableMgmt,\n type ReferenceJoin,\n type PrimitiveColumn,\n type EntityColumn,\n type ReferenceColumn,\n type CollectionJoin,\n type PolyReference,\n} from \"./queries/sql/Tables.ts\";\nexport { BaseEntity, getInstanceData } from \"./BaseEntity.ts\";\nexport { ConditionBuilder } from \"./queries/ConditionBuilder.ts\";\nexport { type Entity, type IdType, isEntity } from \"./Entity.ts\";\nexport type * from \"./EntityFields.ts\";\nexport * from \"./queries/find/EntityFilter.ts\";\nexport * from \"./queries/find/EntityGraphQLFilter.ts\";\nexport * from \"./EntityManager.ts\";\nexport * from \"./EntityMetadata.ts\";\nexport type {\n DeleteStatement,\n ExecuteResult,\n InsertStatement,\n InsertValues,\n MutationReturning,\n MutationStatement,\n UpdateStatement,\n UpdateValues,\n} from \"./queries/sql/execute.ts\";\nexport type { EnumMetadata } from \"./EnumMetadata.ts\";\n// `em.query`'s expression surface. Only the user-facing types are re-exported: the runtime half\n// (BaseExpr, asNode, deferredCondition, the FnExpr/TemplateExpr node classes) stays internal to\n// joist-core, so `toSql`/`decode`/`encode` never show up as something a user could call.\nexport {\n type ArrayAggOptions,\n type Expr,\n type ExprBrand,\n exprBrand,\n type ExprLike,\n type InnerJoin,\n type LeftJoin,\n} from \"./queries/sql/Expr.ts\";\nexport {\n expr,\n type CaseElse,\n type CaseWhen,\n type ExprFromInput,\n type ExprInput,\n} from \"./queries/sql/expressions/expression.ts\";\nexport { skipCondition } from \"./queries/skipCondition.ts\";\nexport type { EntityOrId, HintNode } from \"./HintTree.ts\";\nexport { InstanceData } from \"./InstanceData.ts\";\nexport { type JoinColumnValue, type JoinRow, JoinRowOperation, type ManyToManyLike } from \"./JoinRows.ts\";\nexport type * from \"./PendingChanges.ts\";\nexport { Plugin } from \"./PluginManager.ts\";\nexport * from \"./queries/find/QueryParser.ts\";\nexport * from \"./queries/find/buildFindQuery.ts\";\nexport * from \"./queries/renderConditions.ts\";\nexport type {\n ColumnCondition,\n ExistsCondition,\n ParsedExpressionCondition,\n ParsedExpressionFilter,\n ParsedValueFilter,\n RawCondition,\n} from \"./queries/parsedConditions.ts\";\nexport {\n type ParsedEntityFilter,\n makeLike,\n mapToDb,\n parseEntityFilter,\n parseValueFilter,\n} from \"./queries/valueFilters.ts\";\nexport {\n filterSoftDeletes,\n lazyExcludedSelects,\n maybeAddNotSoftDeleted,\n stiSubtypeFilter,\n} from \"./queries/entityQueryUtils.ts\";\nexport * from \"./queries/find/QueryParser.collectionJoins.ts\";\nexport { visitConditions } from \"./queries/find/QueryVisitor.ts\";\nexport * from \"./RowData.ts\";\nexport { type JoinRowTodo, Todo } from \"./Todo.ts\";\nexport * from \"./changes.ts\";\nexport { ConfigApi, type EntityHook, resetBootFlag } from \"./config.ts\";\nexport {\n configureMetadata,\n getConstructorFromTaggedId,\n getMetadataForTable,\n getMetadataForType,\n maybeGetConstructorFromReference,\n} from \"./configure.ts\";\nexport { driverApi } from \"./driverApi.ts\";\nexport * from \"./drivers/index.ts\";\nexport { getField, isChangeableField, isFieldSet, setField } from \"./fields.ts\";\nexport * from \"./getProperties.ts\";\nexport * from \"./json.ts\";\nexport * from \"./keys.ts\";\nexport { kq, kqDot, kqStar } from \"./queries/sql/keywords.ts\";\nexport {\n assertLoaded,\n type DeepNew,\n ensureLoaded,\n isLoaded,\n isNew,\n type Loadable,\n type Loaded,\n type LoadHint,\n type MarkLoaded,\n maybePopulateThen,\n type NestedLoadHint,\n type New,\n type RelationsIn,\n unsafeLoaded,\n} from \"./loadHints.ts\";\nexport * from \"./loadLens.ts\";\nexport { setFactoryWriter } from \"./logging/FactoryLogger.ts\";\nexport * from \"./logging/FieldLogger.ts\";\nexport { ReactionLogger, setReactionLogging } from \"./logging/ReactionLogger.ts\";\nexport { lazyField } from \"./newEntity.ts\";\nexport {\n defaultValue,\n factories,\n type FactoryEntityOpt,\n type FactoryOpts,\n getTestIndex,\n isFactoryCreation,\n maybeBranchValue,\n maybeNew,\n maybeNewPoly,\n newTestInstance,\n noValue,\n setFactoryLogging,\n testIndex,\n} from \"./newTestInstance.ts\";\nexport { deepNormalizeHint, normalizeHint } from \"./normalizeHints.ts\";\nexport { ImmutableEntitiesPlugin } from \"./plugins/ImmutableEntitiesPlugin.ts\";\nexport type { JoinResult, PreloadHydrator, PreloadPlugin } from \"./plugins/PreloadPlugin.ts\";\nexport { JsonAggregatePreloader } from \"./preloading/JsonAggregatePreloader.ts\";\n// `em.query`'s query surface; the parse pipeline (SubqueryHandle, parseUserQuery, Plan) stays internal\nexport {\n type CheckScope,\n type Clauses,\n type EntityQuery,\n type ExpressionOrderBy,\n type ExistsQuery,\n entityQueryBrand,\n type MaybeNull,\n type NameOf,\n type NotWidened,\n type OrderByDirection,\n type OrderByKeys,\n type Query,\n type QueryArg,\n type QueryCondition,\n type QueryJoin,\n type QueryJoins,\n type QueryRow,\n type QuerySelect,\n type QuerySource,\n type QueryValue,\n recursiveQuery,\n type RecursiveOptions,\n type ScalarQuery,\n type SetQuery,\n query,\n queryMaybe,\n sql,\n type Subquery,\n type SubqueryBrand,\n subqueryBrand,\n type WithInput,\n type WithSource,\n} from \"./queries/sql/query.ts\";\nexport {\n convertToLoadHint,\n isTypeOrSubType,\n type Reactable,\n type Reacted,\n type ReactiveHint,\n type ReactiveTarget,\n reverseReactiveHint,\n} from \"./reactiveHints.ts\";\nexport * from \"./relations/index.ts\";\nexport {\n cannotBeChanged,\n cannotBeUpdated,\n type GenericError,\n maxValueRule,\n minValueRule,\n mustBeSubType,\n newRequiredLazyFieldRule,\n newRequiredRule,\n rangeValueRule,\n ValidationCode,\n type ValidationError,\n ValidationErrors,\n type ValidationRule,\n type ValidationRuleInternal,\n type ValidationRuleResult,\n} from \"./rules.ts\";\nexport { getRuntimeConfig, setRuntimeConfig, type RuntimeConfig } from \"./runtimeConfig.ts\";\nexport { nowUTC } from \"./nowUTC.ts\";\nexport * from \"./serde.ts\";\nexport * from \"./columns.ts\";\nexport * from \"./fieldSerde.ts\";\nexport * from \"./queries/find/scopes.ts\";\nexport { maybeRequireTemporal, requireTemporal, Temporal } from \"./temporal.ts\";\nexport * from \"./temporalMappers.ts\";\nexport { isInTrustedContext, runInTrustedContext } from \"./trusted.ts\";\nexport type * from \"./typeMap.ts\";\nexport { buildUnnestCte, ensureRectangularArraySizes } from \"./unnest.ts\";\nexport { type DeepPartialOrNull, updatePartial, upsert } from \"./upsert.ts\";\nexport {\n abbreviation,\n asNew,\n assertNever,\n cleanSql,\n cleanStringValue,\n fail,\n failIfAnyRejected,\n indexBy,\n partition,\n zeroTo,\n} from \"./utils.ts\";\nexport { ensureWithLoaded, StubbedRelation, type WithLoaded, withLoaded } from \"./withLoaded.ts\";\n\n// https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/\ninterface Flavoring<FlavorT> {\n _type?: FlavorT;\n}\n\nexport type Flavor<T, FlavorT> = T & Flavoring<FlavorT>;\n\n/**\n * Sets each value in `values` on the current entity.\n *\n * The default behavior is that passing a value as either `null` or `undefined` will set\n * the field as `undefined`, i.e. automatic `null` to `undefined` conversion.\n *\n * However, if you pass `ignoreUndefined: true`, then any opt that is `undefined` will be treated\n * as \"do not set\", and `null` will still mean \"set to `undefined`\". This is useful for implementing\n * APIs were an input of `undefined` means \"do not set / noop\" and `null` means \"unset\".\n *\n * Note that constructors _always_ call this method, but if the call is coming from `em.hydrate`, we\n * use `values` being a primary key to short-circuit and let hydration callers assign the values\n * returned by the serde `fromRow` methods.\n */\nexport function setOpts<T extends Entity>(\n entity: T,\n values: Partial<OptsOf<T>> | undefined,\n opts?: { partial?: boolean; calledFromConstructor?: boolean },\n): void {\n const { calledFromConstructor = false, partial } = opts || {};\n // If `values` is undefined, we're being called by `createPartial` that will do its\n // own opt handling, but we still want the sync defaults applied after this opts handling.\n if (values !== undefined) {\n const meta = getMetadata(entity);\n for (const [key, _value] of Object.entries(values as {})) {\n setOpt(meta, entity, key, _value, partial, calledFromConstructor);\n }\n }\n}\n\n/**\n * Applies some standard behavior & protections to `entity[key] = value`. I.e.\n *\n * - We don't set over AsyncProperties/relations/etc., and instead call current.set(value)\n * - We catch missing/invalid field names\n * - We handle FactoryInitialValues\n */\nexport function setOpt<T extends Entity>(\n meta: EntityMetadata<T>,\n entity: T,\n key: string,\n _value: any,\n partial = false,\n calledFromConstructor = false,\n): void {\n const field = meta.allFields[key];\n if (!field) {\n // Allow setting non-field properties like fullName setters\n const prop = getProperties(meta)[key];\n if (!prop) {\n throw new Error(`Unknown field ${key}`);\n }\n }\n\n // If partial is set, we treat undefined as a noop\n if (partial && _value === undefined) return;\n // Ignore the STI discriminator, em.register will set this accordingly\n if (meta.inheritanceType === \"sti\" && getBaseMeta(meta).stiDiscriminatorField === key) return;\n\n // We let optional opts fields be `| null` for convenience, and convert to undefined.\n const value = _value === null ? undefined : _value;\n\n // Use `getField` to side-step `id` blowing up on new entities that are setting an\n // explicit id; otherwise use `entity[key]` to get back the relation.\n const current = key === \"id\" ? getField(entity, key) : (entity as any)[key];\n\n if (current instanceof AbstractRelationImpl) {\n if (calledFromConstructor) {\n current.setFromOpts(value);\n } else {\n current.set(value);\n }\n } else if (isLazyField(current)) {\n current.set(value);\n } else if (isProperty(current) || isAsyncProperty(current) || isReactiveGetter(current)) {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n } else if (isReactiveField(current) || isAsyncReactiveField(current)) {\n if (value instanceof FactoryInitialValue) {\n if (current instanceof ReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else if (current instanceof AsyncReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else {\n throw new Error(`Unhandled case ${current.constructor.name}`);\n }\n } else {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n }\n } else {\n // If setting an explicit id, go through setField, otherwise use\n // `entity[key]` to set the value directly to that we go through setters.\n if (key === \"id\" && entity.isNewEntity) {\n setField(entity, key, value);\n } else {\n (entity as any)[key] = value;\n }\n }\n}\n\nexport function ensureNotDeleted(entity: Entity, ignore?: \"pending\"): void {\n if (entity.isDeletedEntity && (ignore === undefined || getInstanceData(entity).isDeletedAndFlushed)) {\n fail(`${entity} is marked as deleted`);\n }\n}\n\n/** Adds `null` to every key in `T` to accept partial-update-style input. */\nexport type PartialOrNull<T> = {\n [P in keyof T]?: T[P] | null;\n};\n\nexport function getRequiredKeys<T extends Entity>(entity: T): string[];\nexport function getRequiredKeys<T extends Entity>(type: EntityConstructor<T>): string[];\nexport function getRequiredKeys<T extends Entity>(entityOrType: T | EntityConstructor<T>): string[] {\n return Object.values(getMetadata(entityOrType as any).fields)\n .filter((f) => f.required)\n .map((f) => f.fieldName);\n}\n\nexport function getRelations(entity: Entity): AbstractRelationImpl<any, any>[] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => (entity as any)[name]);\n}\n\nexport function getRelationEntries(entity: Entity): [string, AbstractRelationImpl<any, any>][] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => [name, (entity as any)[name]]);\n}\n\n/** Casts a \"maybe abstract\" cstr to a concrete cstr when the calling code knows it's safe. */\nexport function asConcreteCstr<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): EntityConstructor<T> {\n return cstr as any;\n}\n\n/**\n * Thrown when `.id` is accessed on an entity that does not have an id yet.\n *\n * For Postgres, entities are actually allowed to have ids pre-INSERT, if you call\n * `em.assignNewIds()`. Other databases typically require INSERTs to trigger the auto\n * id assignment.\n */\nexport class NoIdError extends Error {}\n\n/** Throws a `NoIdError` for `entity`, i.e. because `id` was called before being saved. */\nexport function failNoIdYet(entity: string): never {\n throw new NoIdError(`${entity} has no id yet`);\n}\n\n/**\n * Add a static function since getters can't have type guards.\n *\n * See https://github.com/microsoft/TypeScript/issues/43368\n */\nexport function isNewEntity<T extends Entity>(entity: T): entity is New<T> {\n return entity.isNewEntity;\n}\n"],"mappings":"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"}
|
package/build/json.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_relations_AbstractRelationImpl = require("./relations/AbstractRelationImpl.cjs");
|
|
3
3
|
const require_relations_hasProperty = require("./relations/hasProperty.cjs");
|
|
4
|
-
const require_relations_ReactiveField = require("./relations/ReactiveField.cjs");
|
|
5
4
|
const require_relations_ReactiveGetter = require("./relations/ReactiveGetter.cjs");
|
|
5
|
+
const require_reactiveHints = require("./reactiveHints.cjs");
|
|
6
|
+
const require_normalizeHints = require("./normalizeHints.cjs");
|
|
7
|
+
const require_relations_ReactiveField = require("./relations/ReactiveField.cjs");
|
|
6
8
|
const require_relations_AsyncReactiveField = require("./relations/AsyncReactiveField.cjs");
|
|
7
9
|
require("./relations/index.cjs");
|
|
8
10
|
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
9
|
-
const require_reactiveHints = require("./reactiveHints.cjs");
|
|
10
|
-
const require_normalizeHints = require("./normalizeHints.cjs");
|
|
11
11
|
require("./EntityManager.cjs");
|
|
12
12
|
const require_Entity = require("./Entity.cjs");
|
|
13
13
|
//#region src/json.ts
|
package/build/json.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AbstractRelationImpl } from "./relations/AbstractRelationImpl.js";
|
|
2
2
|
import { PropertyImpl } from "./relations/hasProperty.js";
|
|
3
|
-
import { ReactiveFieldImpl } from "./relations/ReactiveField.js";
|
|
4
3
|
import { ReactiveGetterImpl } from "./relations/ReactiveGetter.js";
|
|
4
|
+
import { convertToLoadHint } from "./reactiveHints.js";
|
|
5
|
+
import { normalizeHint } from "./normalizeHints.js";
|
|
6
|
+
import { ReactiveFieldImpl } from "./relations/ReactiveField.js";
|
|
5
7
|
import { AsyncReactiveFieldImpl } from "./relations/AsyncReactiveField.js";
|
|
6
8
|
import "./relations/index.js";
|
|
7
9
|
import { getMetadata } from "./EntityMetadata.js";
|
|
8
|
-
import { convertToLoadHint } from "./reactiveHints.js";
|
|
9
|
-
import { normalizeHint } from "./normalizeHints.js";
|
|
10
10
|
import "./EntityManager.js";
|
|
11
11
|
import { isEntity } from "./Entity.js";
|
|
12
12
|
//#region src/json.ts
|
package/build/keys.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils.cjs");
|
|
2
3
|
require("./relations/index.cjs");
|
|
3
4
|
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
4
|
-
const require_utils = require("./utils.cjs");
|
|
5
5
|
require("./EntityManager.cjs");
|
|
6
6
|
const require_Entity = require("./Entity.cjs");
|
|
7
7
|
const require_BaseEntity = require("./BaseEntity.cjs");
|
package/build/keys.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { assertNever, fail } from "./utils.js";
|
|
1
2
|
import "./relations/index.js";
|
|
2
3
|
import { getMetadata } from "./EntityMetadata.js";
|
|
3
|
-
import { assertNever, fail } from "./utils.js";
|
|
4
4
|
import "./EntityManager.js";
|
|
5
5
|
import { isEntity } from "./Entity.js";
|
|
6
6
|
import { BaseEntity } from "./BaseEntity.js";
|
package/build/loadHints.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./typeMap.cjs");
|
|
3
3
|
require("./relations/OneToOneReference.cjs");
|
|
4
|
-
require("./relations/index.cjs");
|
|
5
4
|
const require_reactiveHints = require("./reactiveHints.cjs");
|
|
6
5
|
require("./normalizeHints.cjs");
|
|
7
6
|
const require_utils = require("./utils.cjs");
|
|
7
|
+
require("./relations/index.cjs");
|
|
8
8
|
require("./Entity.cjs");
|
|
9
9
|
//#region src/loadHints.ts
|
|
10
10
|
/** Detects whether an entity is newly created, and so we can treat all the relations as loaded. */
|
package/build/loadHints.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./typeMap.js";
|
|
2
2
|
import "./relations/OneToOneReference.js";
|
|
3
|
-
import "./relations/index.js";
|
|
4
3
|
import { getRelationFromMaybePolyKey } from "./reactiveHints.js";
|
|
5
4
|
import "./normalizeHints.js";
|
|
6
5
|
import { fail } from "./utils.js";
|
|
6
|
+
import "./relations/index.js";
|
|
7
7
|
import "./Entity.js";
|
|
8
8
|
//#region src/loadHints.ts
|
|
9
9
|
/** Detects whether an entity is newly created, and so we can treat all the relations as loaded. */
|
package/build/loadLens.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_relations_AbstractRelationImpl = require("./relations/AbstractRelationImpl.cjs");
|
|
3
3
|
const require_relations_hasProperty = require("./relations/hasProperty.cjs");
|
|
4
|
+
require("./loadHints.cjs");
|
|
4
5
|
require("./relations/index.cjs");
|
|
5
6
|
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
6
|
-
require("./loadHints.cjs");
|
|
7
7
|
const require_dataloaders_lensDataLoader = require("./dataloaders/lensDataLoader.cjs");
|
|
8
8
|
const require_EntityManager = require("./EntityManager.cjs");
|
|
9
9
|
const require_Entity = require("./Entity.cjs");
|
package/build/loadLens.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AbstractRelationImpl } from "./relations/AbstractRelationImpl.js";
|
|
2
2
|
import { isProperty } from "./relations/hasProperty.js";
|
|
3
|
+
import "./loadHints.js";
|
|
3
4
|
import "./relations/index.js";
|
|
4
5
|
import { getMetadata } from "./EntityMetadata.js";
|
|
5
|
-
import "./loadHints.js";
|
|
6
6
|
import { lensDataLoader } from "./dataloaders/lensDataLoader.js";
|
|
7
7
|
import { appendStack } from "./EntityManager.js";
|
|
8
8
|
import { isEntity } from "./Entity.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_config = require("../config.cjs");
|
|
3
4
|
require("../EntityMetadata.cjs");
|
|
4
5
|
require("../newTestInstance.cjs");
|
|
5
6
|
require("../Entity.cjs");
|
|
6
|
-
const require_config = require("../config.cjs");
|
|
7
7
|
let ansis = require("ansis");
|
|
8
8
|
ansis = require_runtime.__toESM(ansis, 1);
|
|
9
9
|
//#region src/logging/FactoryLogger.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { getCallerName } from "../config.js";
|
|
1
2
|
import "../EntityMetadata.js";
|
|
2
3
|
import "../newTestInstance.js";
|
|
3
4
|
import "../Entity.js";
|
|
4
|
-
import { getCallerName } from "../config.js";
|
|
5
5
|
import ansis from "ansis";
|
|
6
6
|
//#region src/logging/FactoryLogger.ts
|
|
7
7
|
let writer = void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
-
const require_Entity = require("../Entity.cjs");
|
|
4
3
|
const require_config = require("../config.cjs");
|
|
4
|
+
const require_Entity = require("../Entity.cjs");
|
|
5
5
|
let ansis = require("ansis");
|
|
6
6
|
ansis = require_runtime.__toESM(ansis, 1);
|
|
7
7
|
//#region src/logging/FieldLogger.ts
|
|
@@ -3,9 +3,9 @@ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
|
3
3
|
require("../Todo.cjs");
|
|
4
4
|
require("../ReactionsManager.cjs");
|
|
5
5
|
const require_utils = require("../utils.cjs");
|
|
6
|
+
require("../config.cjs");
|
|
6
7
|
require("../EntityManager.cjs");
|
|
7
8
|
require("../Entity.cjs");
|
|
8
|
-
require("../config.cjs");
|
|
9
9
|
let ansis = require("ansis");
|
|
10
10
|
ansis = require_runtime.__toESM(ansis, 1);
|
|
11
11
|
//#region src/logging/ReactionLogger.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../Todo.js";
|
|
2
2
|
import "../ReactionsManager.js";
|
|
3
3
|
import { groupBy } from "../utils.js";
|
|
4
|
+
import "../config.js";
|
|
4
5
|
import "../EntityManager.js";
|
|
5
6
|
import "../Entity.js";
|
|
6
|
-
import "../config.js";
|
|
7
7
|
import ansis from "ansis";
|
|
8
8
|
//#region src/logging/ReactionLogger.ts
|
|
9
9
|
const { gray, green, yellow, white } = ansis;
|
package/build/newEntity.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils.cjs");
|
|
2
3
|
const require_getProperties = require("./getProperties.cjs");
|
|
3
4
|
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
4
|
-
const require_utils = require("./utils.cjs");
|
|
5
5
|
require("./EntityManager.cjs");
|
|
6
6
|
require("./Entity.cjs");
|
|
7
7
|
const require_BaseEntity = require("./BaseEntity.cjs");
|
package/build/newEntity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { fail, hasAnyKey } from "./utils.js";
|
|
1
2
|
import { getLazyFields } from "./getProperties.js";
|
|
2
3
|
import { getMetadata } from "./EntityMetadata.js";
|
|
3
|
-
import { fail, hasAnyKey } from "./utils.js";
|
|
4
4
|
import "./EntityManager.js";
|
|
5
5
|
import "./Entity.js";
|
|
6
6
|
import { baseEntityCstr } from "./BaseEntity.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./typeMap.cjs");
|
|
3
|
-
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
4
2
|
const require_temporal = require("./temporal.cjs");
|
|
3
|
+
require("./typeMap.cjs");
|
|
5
4
|
const require_utils = require("./utils.cjs");
|
|
5
|
+
const require_EntityMetadata = require("./EntityMetadata.cjs");
|
|
6
|
+
const require_defaults = require("./defaults.cjs");
|
|
6
7
|
const require_logging_FactoryLogger = require("./logging/FactoryLogger.cjs");
|
|
7
8
|
require("./index.cjs");
|
|
8
9
|
const require_EntityManager = require("./EntityManager.cjs");
|
|
9
10
|
const require_Entity = require("./Entity.cjs");
|
|
10
11
|
const require_BaseEntity = require("./BaseEntity.cjs");
|
|
11
|
-
const require_defaults = require("./defaults.cjs");
|
|
12
12
|
let joist_utils = require("joist-utils");
|
|
13
13
|
//#region src/newTestInstance.ts
|
|
14
14
|
let logger = void 0;
|
package/build/newTestInstance.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./typeMap.js";
|
|
2
|
-
import { getBaseAndSelfMetas, getBaseSelfAndSubMetas, getMetadata, isManyToOneField, isOneToOneField } from "./EntityMetadata.js";
|
|
3
1
|
import { maybeRequireTemporal } from "./temporal.js";
|
|
2
|
+
import "./typeMap.js";
|
|
4
3
|
import { assertNever } from "./utils.js";
|
|
4
|
+
import { getBaseAndSelfMetas, getBaseSelfAndSubMetas, getMetadata, isManyToOneField, isOneToOneField } from "./EntityMetadata.js";
|
|
5
|
+
import { hasDefaultValue, setAsyncDefaultsSynchronously } from "./defaults.js";
|
|
5
6
|
import { FactoryLogger } from "./logging/FactoryLogger.js";
|
|
6
7
|
import "./index.js";
|
|
7
8
|
import { isId } from "./EntityManager.js";
|
|
8
9
|
import { isEntity } from "./Entity.js";
|
|
9
10
|
import { getInstanceData } from "./BaseEntity.js";
|
|
10
|
-
import { hasDefaultValue, setAsyncDefaultsSynchronously } from "./defaults.js";
|
|
11
11
|
import { isPlainObject } from "joist-utils";
|
|
12
12
|
//#region src/newTestInstance.ts
|
|
13
13
|
let logger = void 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { LateralJoinTable, ParsedFindQuery } from "../queries/find/QueryParser.cjs";
|
|
1
2
|
import { LoadHint, NestedLoadHint } from "../loadHints.cjs";
|
|
2
3
|
import { RowData } from "../RowData.cjs";
|
|
3
4
|
import { EntityMetadata } from "../EntityMetadata.cjs";
|
|
4
5
|
import { EntityOrId, HintNode } from "../HintTree.cjs";
|
|
5
6
|
import { Entity } from "../Entity.cjs";
|
|
6
|
-
import { LateralJoinTable, ParsedFindQuery } from "../QueryParser.cjs";
|
|
7
7
|
//#region src/plugins/PreloadPlugin.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* This is a plugin API dedicated to preloading data for subtrees of entities.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { LateralJoinTable, ParsedFindQuery } from "../queries/find/QueryParser.mjs";
|
|
1
2
|
import { LoadHint, NestedLoadHint } from "../loadHints.mjs";
|
|
2
3
|
import { RowData } from "../RowData.mjs";
|
|
3
4
|
import { EntityMetadata } from "../EntityMetadata.mjs";
|
|
4
5
|
import { EntityOrId, HintNode } from "../HintTree.mjs";
|
|
5
6
|
import { Entity } from "../Entity.mjs";
|
|
6
|
-
import { LateralJoinTable, ParsedFindQuery } from "../QueryParser.mjs";
|
|
7
7
|
//#region src/plugins/PreloadPlugin.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* This is a plugin API dedicated to preloading data for subtrees of entities.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_keywords = require("../keywords.cjs");
|
|
3
2
|
require("../JoinRows.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
const require_queries_sql_keywords = require("../queries/sql/keywords.cjs");
|
|
4
|
+
const require_queries_ConditionBuilder = require("../queries/ConditionBuilder.cjs");
|
|
5
|
+
const require_queries_find_QueryParser = require("../queries/find/QueryParser.cjs");
|
|
6
6
|
require("../loadHints.cjs");
|
|
7
7
|
const require_utils = require("../utils.cjs");
|
|
8
|
+
const require_keys = require("../keys.cjs");
|
|
9
|
+
const require_EntityMetadata = require("../EntityMetadata.cjs");
|
|
8
10
|
const require_preloading_canPreload = require("./canPreload.cjs");
|
|
9
11
|
const require_preloading_partitionHint = require("./partitionHint.cjs");
|
|
10
|
-
const
|
|
12
|
+
const require_queries_sql_AliasAssigner = require("../queries/sql/AliasAssigner.cjs");
|
|
11
13
|
require("../HintTree.cjs");
|
|
12
14
|
require("../plugins/PreloadPlugin.cjs");
|
|
13
15
|
const require_EntityManager = require("../EntityManager.cjs");
|
|
14
16
|
require("../Entity.cjs");
|
|
15
|
-
const require_QueryParser = require("../QueryParser.cjs");
|
|
16
|
-
const require_AliasAssigner = require("../AliasAssigner.cjs");
|
|
17
17
|
//#region src/preloading/JsonAggregatePreloader.ts
|
|
18
18
|
/**
|
|
19
19
|
* A PreloadPlugin implementation that uses `CROSS LATERAL JOIN` and `json_aggregate`
|
|
@@ -24,8 +24,8 @@ var JsonAggregatePreloader = class {
|
|
|
24
24
|
return require_preloading_partitionHint.partitionHint(meta, hint);
|
|
25
25
|
}
|
|
26
26
|
addPreloading(meta, root, query) {
|
|
27
|
-
const assigner = new
|
|
28
|
-
const alias =
|
|
27
|
+
const assigner = new require_queries_sql_AliasAssigner.AliasAssigner(query);
|
|
28
|
+
const alias = require_queries_find_QueryParser.getTables(query)[0].alias;
|
|
29
29
|
const joins = calcLateralJoins(assigner, {
|
|
30
30
|
tree: root,
|
|
31
31
|
alias,
|
|
@@ -34,7 +34,7 @@ var JsonAggregatePreloader = class {
|
|
|
34
34
|
if (joins.length === 0) return void 0;
|
|
35
35
|
for (const { alias, relationAlias, join } of joins) {
|
|
36
36
|
query.selects.push({
|
|
37
|
-
sql: `${
|
|
37
|
+
sql: `${require_queries_sql_keywords.kqDot(alias, "_")} as ${require_queries_sql_keywords.kq(relationAlias)}`,
|
|
38
38
|
aliases: [alias],
|
|
39
39
|
bindings: []
|
|
40
40
|
});
|
|
@@ -48,8 +48,8 @@ var JsonAggregatePreloader = class {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
getPreloadJoins(meta, root, query) {
|
|
51
|
-
const assigner = new
|
|
52
|
-
const alias =
|
|
51
|
+
const assigner = new require_queries_sql_AliasAssigner.AliasAssigner(query);
|
|
52
|
+
const alias = require_queries_find_QueryParser.getTables(query)[0].alias;
|
|
53
53
|
return calcLateralJoins(assigner, {
|
|
54
54
|
tree: root,
|
|
55
55
|
alias,
|
|
@@ -57,7 +57,7 @@ var JsonAggregatePreloader = class {
|
|
|
57
57
|
}, root, alias, meta).map((join) => {
|
|
58
58
|
return {
|
|
59
59
|
selects: [{
|
|
60
|
-
value:
|
|
60
|
+
value: require_queries_sql_keywords.kqDot(join.alias, "_"),
|
|
61
61
|
as: join.relationAlias
|
|
62
62
|
}],
|
|
63
63
|
join: join.join,
|
|
@@ -101,56 +101,56 @@ function calcLateralJoins(assigner, root, tree, parentAlias, parentMeta, pathPre
|
|
|
101
101
|
const relationAlias = `_${assigner.getLiteralAlias(`${pathPrefix}${pathKey}`)}`;
|
|
102
102
|
const subJoins = calcLateralJoins(assigner, root, subTree, otherAlias, otherMeta, `${pathPrefix}${pathKey}_`);
|
|
103
103
|
const columns = Object.values(otherMeta.allFields).filter((f) => f.serde && !(f.kind === "primitive" && f.lazy)).flatMap((f) => f.serde.columns);
|
|
104
|
-
const selects = [...columns.map((c) =>
|
|
105
|
-
const aliasMaybeSuffix =
|
|
106
|
-
const cb = new
|
|
104
|
+
const selects = [...columns.map((c) => require_queries_sql_keywords.kqDot(otherAlias, c.columnName)), ...subJoins.map((sb) => require_queries_sql_keywords.kqDot(sb.alias, "_"))];
|
|
105
|
+
const aliasMaybeSuffix = require_queries_sql_keywords.kq(`${parentAlias}${field.aliasSuffix}`);
|
|
106
|
+
const cb = new require_queries_ConditionBuilder.ConditionBuilder();
|
|
107
107
|
let m2mTable;
|
|
108
108
|
let m2mAlias;
|
|
109
109
|
if (otherField.kind === "m2o") cb.addRawCondition({
|
|
110
110
|
aliases: [otherAlias, parentAlias],
|
|
111
|
-
condition: `${
|
|
111
|
+
condition: `${require_queries_sql_keywords.kqDot(otherAlias, otherField.serde.columns[0].columnName)} = ${require_queries_sql_keywords.kqDot(parentAlias, "id")}`,
|
|
112
112
|
pruneable: true
|
|
113
113
|
});
|
|
114
114
|
else if (otherField.kind === "poly") {
|
|
115
115
|
const comp = otherField.components.find((c) => parentMeta.cstr === c.otherMetadata().cstr) ?? require_utils.fail(`No component found for ${field.fieldName} -> ${otherField.fieldName}`);
|
|
116
116
|
cb.addRawCondition({
|
|
117
117
|
aliases: [otherAlias, parentAlias],
|
|
118
|
-
condition: `${
|
|
118
|
+
condition: `${require_queries_sql_keywords.kqDot(otherAlias, comp.columnName)} = ${require_queries_sql_keywords.kqDot(parentAlias, "id")}`,
|
|
119
119
|
pruneable: true
|
|
120
120
|
});
|
|
121
121
|
} else if (otherField.kind === "o2m" || otherField.kind === "lo2m") cb.addRawCondition({
|
|
122
122
|
aliases: [otherAlias, aliasMaybeSuffix],
|
|
123
|
-
condition: `${
|
|
123
|
+
condition: `${require_queries_sql_keywords.kqDot(otherAlias, "id")} = ${aliasMaybeSuffix}.${require_queries_sql_keywords.kq(field.serde.columns[0].columnName)}`,
|
|
124
124
|
pruneable: true
|
|
125
125
|
});
|
|
126
126
|
else if (otherField.kind === "o2o") cb.addRawCondition({
|
|
127
127
|
aliases: [otherAlias, aliasMaybeSuffix],
|
|
128
|
-
condition: `${
|
|
128
|
+
condition: `${require_queries_sql_keywords.kqDot(otherAlias, "id")} = ${aliasMaybeSuffix}.${require_queries_sql_keywords.kq(field.serde.columns[0].columnName)}`,
|
|
129
129
|
pruneable: true
|
|
130
130
|
});
|
|
131
131
|
else if (otherField.kind === "m2m") {
|
|
132
132
|
m2mAlias = assigner.getAlias(otherField.joinTableName);
|
|
133
|
-
if (otherField.hasJoinTableId) selects.unshift(
|
|
133
|
+
if (otherField.hasJoinTableId) selects.unshift(require_queries_sql_keywords.kqDot(m2mAlias, "id"));
|
|
134
134
|
m2mTable = {
|
|
135
135
|
join: "inner",
|
|
136
136
|
table: otherField.joinTableName,
|
|
137
137
|
alias: m2mAlias,
|
|
138
|
-
col1:
|
|
139
|
-
col2:
|
|
138
|
+
col1: require_queries_sql_keywords.kqDot(parentAlias, "id"),
|
|
139
|
+
col2: require_queries_sql_keywords.kqDot(m2mAlias, otherField.columnNames[1])
|
|
140
140
|
};
|
|
141
141
|
cb.addRawCondition({
|
|
142
142
|
aliases: [m2mAlias, otherAlias],
|
|
143
|
-
condition: `${
|
|
143
|
+
condition: `${require_queries_sql_keywords.kqDot(m2mAlias, otherField.columnNames[0])} = ${require_queries_sql_keywords.kqDot(otherAlias, "id")}`,
|
|
144
144
|
pruneable: true
|
|
145
145
|
});
|
|
146
146
|
} else throw new Error(`Unsupported otherField.kind ${otherField.kind}`);
|
|
147
147
|
if (subTree.entities.size !== root.tree.entities.size) cb.addRawCondition({
|
|
148
148
|
aliases: [root.alias],
|
|
149
|
-
condition: `${
|
|
149
|
+
condition: `${require_queries_sql_keywords.kqDot(root.alias, "id")} = ANY(?)`,
|
|
150
150
|
bindings: [[...subTree.entities].filter((e) => typeof e === "string" || !e.isNewEntity).map((e) => require_keys.keyToNumber(root.meta, typeof e === "string" ? e : e.id))],
|
|
151
151
|
pruneable: true
|
|
152
152
|
});
|
|
153
|
-
const orderBy = otherField.kind === "m2m" && !otherField.hasJoinTableId ? `${
|
|
153
|
+
const orderBy = otherField.kind === "m2m" && !otherField.hasJoinTableId ? `${require_queries_sql_keywords.kq(m2mAlias)}.${require_queries_sql_keywords.kq(otherField.columnNames[0])}` : `${require_queries_sql_keywords.kq(m2mAlias ?? otherAlias)}.id`;
|
|
154
154
|
const join = {
|
|
155
155
|
join: "lateral",
|
|
156
156
|
alias: otherAlias,
|
|
@@ -211,21 +211,21 @@ function calcEnumLateralJoin(assigner, root, subTree, parentAlias, field, key, p
|
|
|
211
211
|
const [entityColumn, enumColumn] = field.columnNames;
|
|
212
212
|
const jtAlias = `_${assigner.getAlias(field.joinTableName)}`;
|
|
213
213
|
const relationAlias = `_${assigner.getLiteralAlias(`${pathPrefix}${key.toLowerCase()}`)}`;
|
|
214
|
-
const parts = [
|
|
215
|
-
if (field.hasJoinTableId) parts.push(
|
|
216
|
-
const cb = new
|
|
214
|
+
const parts = [require_queries_sql_keywords.kqDot(jtAlias, enumColumn)];
|
|
215
|
+
if (field.hasJoinTableId) parts.push(require_queries_sql_keywords.kqDot(jtAlias, "id"));
|
|
216
|
+
const cb = new require_queries_ConditionBuilder.ConditionBuilder();
|
|
217
217
|
cb.addRawCondition({
|
|
218
218
|
aliases: [jtAlias, parentAlias],
|
|
219
|
-
condition: `${
|
|
219
|
+
condition: `${require_queries_sql_keywords.kqDot(jtAlias, entityColumn)} = ${require_queries_sql_keywords.kqDot(parentAlias, "id")}`,
|
|
220
220
|
pruneable: true
|
|
221
221
|
});
|
|
222
222
|
if (subTree.entities.size !== root.tree.entities.size) cb.addRawCondition({
|
|
223
223
|
aliases: [root.alias],
|
|
224
|
-
condition: `${
|
|
224
|
+
condition: `${require_queries_sql_keywords.kqDot(root.alias, "id")} = ANY(?)`,
|
|
225
225
|
bindings: [[...subTree.entities].filter((e) => typeof e === "string" || !e.isNewEntity).map((e) => require_keys.keyToNumber(root.meta, typeof e === "string" ? e : e.id))],
|
|
226
226
|
pruneable: true
|
|
227
227
|
});
|
|
228
|
-
const orderBy = `${
|
|
228
|
+
const orderBy = `${require_queries_sql_keywords.kq(jtAlias)}.${require_queries_sql_keywords.kq(field.hasJoinTableId ? "id" : enumColumn)}`;
|
|
229
229
|
const join = {
|
|
230
230
|
join: "lateral",
|
|
231
231
|
alias: jtAlias,
|