@warlock.js/cascade 4.0.171 → 4.1.1
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/README.md +6 -5
- package/bin/cascadejs +3 -0
- package/esm/cli/commands/migrate-export-sql.mjs +48 -0
- package/esm/cli/commands/migrate-export-sql.mjs.map +1 -0
- package/esm/cli/commands/migrate-list.mjs +26 -0
- package/esm/cli/commands/migrate-list.mjs.map +1 -0
- package/esm/cli/commands/migrate-rollback.mjs +50 -0
- package/esm/cli/commands/migrate-rollback.mjs.map +1 -0
- package/esm/cli/commands/migrate.mjs +65 -0
- package/esm/cli/commands/migrate.mjs.map +1 -0
- package/esm/cli/connection-from-env.mjs +181 -0
- package/esm/cli/connection-from-env.mjs.map +1 -0
- package/esm/cli/index.mjs +31 -0
- package/esm/cli/index.mjs.map +1 -0
- package/esm/cli/load-migrations.mjs +78 -0
- package/esm/cli/load-migrations.mjs.map +1 -0
- package/esm/cli/printers.mjs +57 -0
- package/esm/cli/printers.mjs.map +1 -0
- package/esm/cli/setup-logger.mjs +30 -0
- package/esm/cli/setup-logger.mjs.map +1 -0
- package/esm/cli/with-cli-connection.mjs +39 -0
- package/esm/cli/with-cli-connection.mjs.map +1 -0
- package/esm/cli.d.mts +1 -0
- package/esm/cli.mjs +26 -0
- package/esm/cli.mjs.map +1 -0
- package/esm/context/database-data-source-context.d.mts +32 -0
- package/esm/context/database-data-source-context.d.mts.map +1 -0
- package/esm/context/database-data-source-context.mjs +35 -0
- package/esm/context/database-data-source-context.mjs.map +1 -0
- package/esm/context/database-transaction-context.d.mts +38 -0
- package/esm/context/database-transaction-context.d.mts.map +1 -0
- package/esm/context/database-transaction-context.mjs +47 -0
- package/esm/context/database-transaction-context.mjs.map +1 -0
- package/esm/contracts/database-driver.contract.d.mts +443 -0
- package/esm/contracts/database-driver.contract.d.mts.map +1 -0
- package/esm/contracts/database-id-generator.contract.d.mts +109 -0
- package/esm/contracts/database-id-generator.contract.d.mts.map +1 -0
- package/esm/contracts/database-remover.contract.d.mts +108 -0
- package/esm/contracts/database-remover.contract.d.mts.map +1 -0
- package/esm/contracts/database-restorer.contract.d.mts +145 -0
- package/esm/contracts/database-restorer.contract.d.mts.map +1 -0
- package/esm/contracts/database-writer.contract.d.mts +123 -0
- package/esm/contracts/database-writer.contract.d.mts.map +1 -0
- package/esm/contracts/driver-blueprint.contract.d.mts +52 -0
- package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -0
- package/esm/contracts/index.d.mts +9 -0
- package/esm/contracts/migration-driver.contract.d.mts +476 -0
- package/esm/contracts/migration-driver.contract.d.mts.map +1 -0
- package/esm/contracts/query-builder.contract.d.mts +1663 -0
- package/esm/contracts/query-builder.contract.d.mts.map +1 -0
- package/esm/contracts/sync-adapter.contract.d.mts +49 -0
- package/esm/contracts/sync-adapter.contract.d.mts.map +1 -0
- package/esm/data-source/data-source-registry.d.mts +111 -0
- package/esm/data-source/data-source-registry.d.mts.map +1 -0
- package/esm/data-source/data-source-registry.mjs +142 -0
- package/esm/data-source/data-source-registry.mjs.map +1 -0
- package/esm/data-source/data-source.d.mts +160 -0
- package/esm/data-source/data-source.d.mts.map +1 -0
- package/esm/data-source/data-source.mjs +87 -0
- package/esm/data-source/data-source.mjs.map +1 -0
- package/esm/database-dirty-tracker.d.mts +254 -0
- package/esm/database-dirty-tracker.d.mts.map +1 -0
- package/esm/database-dirty-tracker.mjs +356 -0
- package/esm/database-dirty-tracker.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-blueprint.mjs +54 -0
- package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-driver.d.mts +334 -0
- package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-driver.mjs +716 -0
- package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts +120 -0
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-id-generator.mjs +141 -0
- package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +322 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs +531 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1117 -0
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-builder.mjs +1828 -0
- package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts +230 -0
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-operations.mjs +275 -0
- package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts +263 -0
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-parser.mjs +965 -0
- package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +78 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +118 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -0
- package/esm/drivers/mongodb/types.d.mts +43 -0
- package/esm/drivers/mongodb/types.d.mts.map +1 -0
- package/esm/drivers/postgres/index.d.mts +8 -0
- package/esm/drivers/postgres/index.mjs +9 -0
- package/esm/drivers/postgres/postgres-blueprint.d.mts +60 -0
- package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-blueprint.mjs +105 -0
- package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-dialect.d.mts +144 -0
- package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-dialect.mjs +227 -0
- package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-driver.d.mts +424 -0
- package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-driver.mjs +845 -0
- package/esm/drivers/postgres/postgres-driver.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-migration-driver.d.mts +393 -0
- package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-migration-driver.mjs +760 -0
- package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-query-builder.d.mts +399 -0
- package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-query-builder.mjs +1105 -0
- package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-query-parser.d.mts +351 -0
- package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-query-parser.mjs +796 -0
- package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-sql-serializer.mjs +260 -0
- package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-sync-adapter.d.mts +79 -0
- package/esm/drivers/postgres/postgres-sync-adapter.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-sync-adapter.mjs +162 -0
- package/esm/drivers/postgres/postgres-sync-adapter.mjs.map +1 -0
- package/esm/drivers/postgres/types.d.mts +105 -0
- package/esm/drivers/postgres/types.d.mts.map +1 -0
- package/esm/drivers/sql/sql-dialect.contract.d.mts +221 -0
- package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -0
- package/esm/drivers/sql/sql-types.d.mts +150 -0
- package/esm/drivers/sql/sql-types.d.mts.map +1 -0
- package/esm/errors/missing-data-source.error.d.mts +25 -0
- package/esm/errors/missing-data-source.error.d.mts.map +1 -0
- package/esm/errors/missing-data-source.error.mjs +31 -0
- package/esm/errors/missing-data-source.error.mjs.map +1 -0
- package/esm/errors/transaction-rollback.error.d.mts +23 -0
- package/esm/errors/transaction-rollback.error.d.mts.map +1 -0
- package/esm/errors/transaction-rollback.error.mjs +29 -0
- package/esm/errors/transaction-rollback.error.mjs.map +1 -0
- package/esm/events/model-events.d.mts +234 -0
- package/esm/events/model-events.d.mts.map +1 -0
- package/esm/events/model-events.mjs +254 -0
- package/esm/events/model-events.mjs.map +1 -0
- package/esm/expressions/aggregate-expressions.d.mts +224 -0
- package/esm/expressions/aggregate-expressions.d.mts.map +1 -0
- package/esm/expressions/aggregate-expressions.mjs +232 -0
- package/esm/expressions/aggregate-expressions.mjs.map +1 -0
- package/esm/index.d.mts +67 -0
- package/esm/index.mjs +53 -0
- package/esm/migration/column-builder.d.mts +420 -0
- package/esm/migration/column-builder.d.mts.map +1 -0
- package/esm/migration/column-builder.mjs +532 -0
- package/esm/migration/column-builder.mjs.map +1 -0
- package/esm/migration/column-helpers.d.mts +280 -0
- package/esm/migration/column-helpers.d.mts.map +1 -0
- package/esm/migration/column-helpers.mjs +376 -0
- package/esm/migration/column-helpers.mjs.map +1 -0
- package/esm/migration/foreign-key-builder.d.mts +106 -0
- package/esm/migration/foreign-key-builder.d.mts.map +1 -0
- package/esm/migration/foreign-key-builder.mjs +126 -0
- package/esm/migration/foreign-key-builder.mjs.map +1 -0
- package/esm/migration/index.d.mts +6 -0
- package/esm/migration/index.mjs +7 -0
- package/esm/migration/migration-runner.d.mts +279 -0
- package/esm/migration/migration-runner.d.mts.map +1 -0
- package/esm/migration/migration-runner.mjs +662 -0
- package/esm/migration/migration-runner.mjs.map +1 -0
- package/esm/migration/migration.d.mts +2035 -0
- package/esm/migration/migration.d.mts.map +1 -0
- package/esm/migration/migration.mjs +2083 -0
- package/esm/migration/migration.mjs.map +1 -0
- package/esm/migration/sql-grammar.mjs +115 -0
- package/esm/migration/sql-grammar.mjs.map +1 -0
- package/esm/migration/sql-serializer.d.mts +26 -0
- package/esm/migration/sql-serializer.d.mts.map +1 -0
- package/esm/migration/sql-serializer.mjs +26 -0
- package/esm/migration/sql-serializer.mjs.map +1 -0
- package/esm/migration/types.d.mts +136 -0
- package/esm/migration/types.d.mts.map +1 -0
- package/esm/model/methods/accessor-methods.mjs +54 -0
- package/esm/model/methods/accessor-methods.mjs.map +1 -0
- package/esm/model/methods/delete-methods.mjs +16 -0
- package/esm/model/methods/delete-methods.mjs.map +1 -0
- package/esm/model/methods/dirty-methods.mjs +20 -0
- package/esm/model/methods/dirty-methods.mjs.map +1 -0
- package/esm/model/methods/hydration-methods.mjs +51 -0
- package/esm/model/methods/hydration-methods.mjs.map +1 -0
- package/esm/model/methods/instance-event-methods.mjs +22 -0
- package/esm/model/methods/instance-event-methods.mjs.map +1 -0
- package/esm/model/methods/meta-methods.mjs +36 -0
- package/esm/model/methods/meta-methods.mjs.map +1 -0
- package/esm/model/methods/pivot-methods.mjs +48 -0
- package/esm/model/methods/pivot-methods.mjs.map +1 -0
- package/esm/model/methods/query-methods.mjs +121 -0
- package/esm/model/methods/query-methods.mjs.map +1 -0
- package/esm/model/methods/restore-methods.mjs +16 -0
- package/esm/model/methods/restore-methods.mjs.map +1 -0
- package/esm/model/methods/scope-methods.mjs +20 -0
- package/esm/model/methods/scope-methods.mjs.map +1 -0
- package/esm/model/methods/serialization-methods.mjs +20 -0
- package/esm/model/methods/serialization-methods.mjs.map +1 -0
- package/esm/model/methods/static-event-methods.mjs +37 -0
- package/esm/model/methods/static-event-methods.mjs.map +1 -0
- package/esm/model/methods/write-methods.mjs +69 -0
- package/esm/model/methods/write-methods.mjs.map +1 -0
- package/esm/model/model.d.mts +1778 -0
- package/esm/model/model.d.mts.map +1 -0
- package/esm/model/model.mjs +1762 -0
- package/esm/model/model.mjs.map +1 -0
- package/esm/model/model.types.d.mts +47 -0
- package/esm/model/model.types.d.mts.map +1 -0
- package/esm/model/register-model.d.mts +140 -0
- package/esm/model/register-model.d.mts.map +1 -0
- package/esm/model/register-model.mjs +175 -0
- package/esm/model/register-model.mjs.map +1 -0
- package/esm/model/relation-decorators.d.mts +88 -0
- package/esm/model/relation-decorators.d.mts.map +1 -0
- package/esm/model/relation-decorators.mjs +191 -0
- package/esm/model/relation-decorators.mjs.map +1 -0
- package/esm/operations/database.d.mts +46 -0
- package/esm/operations/database.d.mts.map +1 -0
- package/esm/operations/database.mjs +40 -0
- package/esm/operations/database.mjs.map +1 -0
- package/esm/operations/index.d.mts +2 -0
- package/esm/operations/index.mjs +4 -0
- package/esm/operations/migrations.d.mts +71 -0
- package/esm/operations/migrations.d.mts.map +1 -0
- package/esm/operations/migrations.mjs +70 -0
- package/esm/operations/migrations.mjs.map +1 -0
- package/esm/query-builder/query-builder.d.mts +564 -0
- package/esm/query-builder/query-builder.d.mts.map +1 -0
- package/esm/query-builder/query-builder.mjs +1097 -0
- package/esm/query-builder/query-builder.mjs.map +1 -0
- package/esm/relations/index.d.mts +4 -0
- package/esm/relations/index.mjs +5 -0
- package/esm/relations/key-conventions.mjs +119 -0
- package/esm/relations/key-conventions.mjs.map +1 -0
- package/esm/relations/pivot-operations.d.mts +155 -0
- package/esm/relations/pivot-operations.d.mts.map +1 -0
- package/esm/relations/pivot-operations.mjs +232 -0
- package/esm/relations/pivot-operations.mjs.map +1 -0
- package/esm/relations/relation-hydrator.d.mts +55 -0
- package/esm/relations/relation-hydrator.d.mts.map +1 -0
- package/esm/relations/relation-hydrator.mjs +52 -0
- package/esm/relations/relation-hydrator.mjs.map +1 -0
- package/esm/relations/relation-loader.d.mts +190 -0
- package/esm/relations/relation-loader.d.mts.map +1 -0
- package/esm/relations/relation-loader.mjs +416 -0
- package/esm/relations/relation-loader.mjs.map +1 -0
- package/esm/relations/types.d.mts +317 -0
- package/esm/relations/types.d.mts.map +1 -0
- package/esm/remover/database-remover.d.mts +104 -0
- package/esm/remover/database-remover.d.mts.map +1 -0
- package/esm/remover/database-remover.mjs +174 -0
- package/esm/remover/database-remover.mjs.map +1 -0
- package/esm/restorer/database-restorer.d.mts +135 -0
- package/esm/restorer/database-restorer.d.mts.map +1 -0
- package/esm/restorer/database-restorer.mjs +316 -0
- package/esm/restorer/database-restorer.mjs.map +1 -0
- package/esm/sql-database-dirty-tracker.d.mts +17 -0
- package/esm/sql-database-dirty-tracker.d.mts.map +1 -0
- package/esm/sql-database-dirty-tracker.mjs +20 -0
- package/esm/sql-database-dirty-tracker.mjs.map +1 -0
- package/esm/sync/model-events.mjs +46 -0
- package/esm/sync/model-events.mjs.map +1 -0
- package/esm/sync/model-sync-operation.d.mts +159 -0
- package/esm/sync/model-sync-operation.d.mts.map +1 -0
- package/esm/sync/model-sync-operation.mjs +257 -0
- package/esm/sync/model-sync-operation.mjs.map +1 -0
- package/esm/sync/model-sync.d.mts +126 -0
- package/esm/sync/model-sync.d.mts.map +1 -0
- package/esm/sync/model-sync.mjs +157 -0
- package/esm/sync/model-sync.mjs.map +1 -0
- package/esm/sync/sync-context.d.mts +69 -0
- package/esm/sync/sync-context.d.mts.map +1 -0
- package/esm/sync/sync-context.mjs +95 -0
- package/esm/sync/sync-context.mjs.map +1 -0
- package/esm/sync/sync-manager.d.mts +213 -0
- package/esm/sync/sync-manager.d.mts.map +1 -0
- package/esm/sync/sync-manager.mjs +597 -0
- package/esm/sync/sync-manager.mjs.map +1 -0
- package/esm/sync/types.d.mts +215 -0
- package/esm/sync/types.d.mts.map +1 -0
- package/esm/types.d.mts +423 -0
- package/esm/types.d.mts.map +1 -0
- package/esm/utils/connect-to-database.d.mts +328 -0
- package/esm/utils/connect-to-database.d.mts.map +1 -0
- package/esm/utils/connect-to-database.mjs +130 -0
- package/esm/utils/connect-to-database.mjs.map +1 -0
- package/esm/utils/database-writer.utils.d.mts +18 -0
- package/esm/utils/database-writer.utils.d.mts.map +1 -0
- package/esm/utils/database-writer.utils.mjs +25 -0
- package/esm/utils/database-writer.utils.mjs.map +1 -0
- package/esm/utils/define-model.d.mts +185 -0
- package/esm/utils/define-model.d.mts.map +1 -0
- package/esm/utils/define-model.mjs +105 -0
- package/esm/utils/define-model.mjs.map +1 -0
- package/esm/utils/is-valid-date-value.mjs +22 -0
- package/esm/utils/is-valid-date-value.mjs.map +1 -0
- package/esm/utils/once-connected.d.mts +150 -0
- package/esm/utils/once-connected.d.mts.map +1 -0
- package/esm/utils/once-connected.mjs +203 -0
- package/esm/utils/once-connected.mjs.map +1 -0
- package/esm/validation/database-seal-plugins.d.mts +1 -0
- package/esm/validation/database-seal-plugins.mjs +11 -0
- package/esm/validation/database-seal-plugins.mjs.map +1 -0
- package/esm/validation/database-writer-validation-error.d.mts +101 -0
- package/esm/validation/database-writer-validation-error.d.mts.map +1 -0
- package/esm/validation/database-writer-validation-error.mjs +153 -0
- package/esm/validation/database-writer-validation-error.mjs.map +1 -0
- package/esm/validation/index.d.mts +2 -0
- package/esm/validation/index.mjs +4 -0
- package/esm/validation/mutators/embed-mutator.mjs +26 -0
- package/esm/validation/mutators/embed-mutator.mjs.map +1 -0
- package/esm/validation/plugins/database-rules-plugin.d.mts +28 -0
- package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -0
- package/esm/validation/plugins/database-rules-plugin.mjs +43 -0
- package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.d.mts +17 -0
- package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.mjs +20 -0
- package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -0
- package/esm/validation/rules/database-model-rule.mjs +32 -0
- package/esm/validation/rules/database-model-rule.mjs.map +1 -0
- package/esm/validation/rules/exists-rule.mjs +29 -0
- package/esm/validation/rules/exists-rule.mjs.map +1 -0
- package/esm/validation/rules/unique-rule.mjs +43 -0
- package/esm/validation/rules/unique-rule.mjs.map +1 -0
- package/esm/validation/transformers/embed-model-transformer.mjs +17 -0
- package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -0
- package/esm/validation/types.d.mts +43 -0
- package/esm/validation/types.d.mts.map +1 -0
- package/esm/validation/validators/embed-validator.d.mts +25 -0
- package/esm/validation/validators/embed-validator.d.mts.map +1 -0
- package/esm/validation/validators/embed-validator.mjs +42 -0
- package/esm/validation/validators/embed-validator.mjs.map +1 -0
- package/esm/writer/database-writer.d.mts +178 -0
- package/esm/writer/database-writer.d.mts.map +1 -0
- package/esm/writer/database-writer.mjs +317 -0
- package/esm/writer/database-writer.mjs.map +1 -0
- package/llms-full.txt +2027 -0
- package/llms.txt +23 -0
- package/package.json +60 -51
- package/skills/README.md +65 -0
- package/skills/aggregate-data/SKILL.md +102 -0
- package/skills/cascade-basics/SKILL.md +93 -0
- package/skills/configure-delete-strategy/SKILL.md +126 -0
- package/skills/define-model/SKILL.md +170 -0
- package/skills/define-relations/SKILL.md +171 -0
- package/skills/manage-data-sources/SKILL.md +140 -0
- package/skills/manage-transactions/SKILL.md +118 -0
- package/skills/paginate-results/SKILL.md +122 -0
- package/skills/perform-atomic-ops/SKILL.md +98 -0
- package/skills/query-data/SKILL.md +168 -0
- package/skills/run-cascade-cli/SKILL.md +125 -0
- package/skills/search-by-vector/SKILL.md +127 -0
- package/skills/subscribe-to-model-events/SKILL.md +148 -0
- package/skills/track-changes/SKILL.md +109 -0
- package/skills/write-migration/SKILL.md +144 -0
- package/cjs/context/database-data-source-context.d.ts +0 -29
- package/cjs/context/database-data-source-context.d.ts.map +0 -1
- package/cjs/context/database-data-source-context.js +0 -28
- package/cjs/context/database-data-source-context.js.map +0 -1
- package/cjs/context/database-transaction-context.d.ts +0 -35
- package/cjs/context/database-transaction-context.d.ts.map +0 -1
- package/cjs/context/database-transaction-context.js +0 -40
- package/cjs/context/database-transaction-context.js.map +0 -1
- package/cjs/contracts/database-driver.contract.d.ts +0 -450
- package/cjs/contracts/database-driver.contract.d.ts.map +0 -1
- package/cjs/contracts/database-id-generator.contract.d.ts +0 -109
- package/cjs/contracts/database-id-generator.contract.d.ts.map +0 -1
- package/cjs/contracts/database-remover.contract.d.ts +0 -104
- package/cjs/contracts/database-remover.contract.d.ts.map +0 -1
- package/cjs/contracts/database-restorer.contract.d.ts +0 -143
- package/cjs/contracts/database-restorer.contract.d.ts.map +0 -1
- package/cjs/contracts/database-writer.contract.d.ts +0 -119
- package/cjs/contracts/database-writer.contract.d.ts.map +0 -1
- package/cjs/contracts/driver-blueprint.contract.d.ts +0 -49
- package/cjs/contracts/driver-blueprint.contract.d.ts.map +0 -1
- package/cjs/contracts/index.d.ts +0 -10
- package/cjs/contracts/index.d.ts.map +0 -1
- package/cjs/contracts/migration-driver.contract.d.ts +0 -522
- package/cjs/contracts/migration-driver.contract.d.ts.map +0 -1
- package/cjs/contracts/query-builder.contract.d.ts +0 -1609
- package/cjs/contracts/query-builder.contract.d.ts.map +0 -1
- package/cjs/contracts/sync-adapter.contract.d.ts +0 -58
- package/cjs/contracts/sync-adapter.contract.d.ts.map +0 -1
- package/cjs/data-source/data-source-registry.d.ts +0 -108
- package/cjs/data-source/data-source-registry.d.ts.map +0 -1
- package/cjs/data-source/data-source-registry.js +0 -145
- package/cjs/data-source/data-source-registry.js.map +0 -1
- package/cjs/data-source/data-source.d.ts +0 -147
- package/cjs/data-source/data-source.d.ts.map +0 -1
- package/cjs/data-source/data-source.js +0 -83
- package/cjs/data-source/data-source.js.map +0 -1
- package/cjs/database-dirty-tracker.d.ts +0 -252
- package/cjs/database-dirty-tracker.d.ts.map +0 -1
- package/cjs/database-dirty-tracker.js +0 -386
- package/cjs/database-dirty-tracker.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
- package/cjs/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-blueprint.js +0 -51
- package/cjs/drivers/mongodb/mongodb-blueprint.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-driver.d.ts +0 -325
- package/cjs/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-driver.js +0 -845
- package/cjs/drivers/mongodb/mongodb-driver.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
- package/cjs/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-id-generator.js +0 -149
- package/cjs/drivers/mongodb/mongodb-id-generator.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
- package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-migration-driver.js +0 -666
- package/cjs/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
- package/cjs/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-builder.js +0 -1988
- package/cjs/drivers/mongodb/mongodb-query-builder.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
- package/cjs/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-operations.js +0 -270
- package/cjs/drivers/mongodb/mongodb-query-operations.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
- package/cjs/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-parser.js +0 -1351
- package/cjs/drivers/mongodb/mongodb-query-parser.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
- package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-sync-adapter.js +0 -146
- package/cjs/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
- package/cjs/drivers/mongodb/types.d.ts +0 -43
- package/cjs/drivers/mongodb/types.d.ts.map +0 -1
- package/cjs/drivers/postgres/index.d.ts +0 -16
- package/cjs/drivers/postgres/index.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-blueprint.d.ts +0 -64
- package/cjs/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-blueprint.js +0 -121
- package/cjs/drivers/postgres/postgres-blueprint.js.map +0 -1
- package/cjs/drivers/postgres/postgres-dialect.d.ts +0 -136
- package/cjs/drivers/postgres/postgres-dialect.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-dialect.js +0 -268
- package/cjs/drivers/postgres/postgres-dialect.js.map +0 -1
- package/cjs/drivers/postgres/postgres-driver.d.ts +0 -432
- package/cjs/drivers/postgres/postgres-driver.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-driver.js +0 -1008
- package/cjs/drivers/postgres/postgres-driver.js.map +0 -1
- package/cjs/drivers/postgres/postgres-migration-driver.d.ts +0 -397
- package/cjs/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-migration-driver.js +0 -900
- package/cjs/drivers/postgres/postgres-migration-driver.js.map +0 -1
- package/cjs/drivers/postgres/postgres-query-builder.d.ts +0 -254
- package/cjs/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-query-builder.js +0 -933
- package/cjs/drivers/postgres/postgres-query-builder.js.map +0 -1
- package/cjs/drivers/postgres/postgres-query-parser.d.ts +0 -328
- package/cjs/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-query-parser.js +0 -868
- package/cjs/drivers/postgres/postgres-query-parser.js.map +0 -1
- package/cjs/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
- package/cjs/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-sql-serializer.js +0 -400
- package/cjs/drivers/postgres/postgres-sql-serializer.js.map +0 -1
- package/cjs/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
- package/cjs/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-sync-adapter.js +0 -204
- package/cjs/drivers/postgres/postgres-sync-adapter.js.map +0 -1
- package/cjs/drivers/postgres/types.d.ts +0 -144
- package/cjs/drivers/postgres/types.d.ts.map +0 -1
- package/cjs/drivers/sql/index.d.ts +0 -10
- package/cjs/drivers/sql/index.d.ts.map +0 -1
- package/cjs/drivers/sql/sql-dialect.contract.d.ts +0 -204
- package/cjs/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
- package/cjs/drivers/sql/sql-types.d.ts +0 -202
- package/cjs/drivers/sql/sql-types.d.ts.map +0 -1
- package/cjs/errors/missing-data-source.error.d.ts +0 -22
- package/cjs/errors/missing-data-source.error.d.ts.map +0 -1
- package/cjs/errors/missing-data-source.error.js +0 -29
- package/cjs/errors/missing-data-source.error.js.map +0 -1
- package/cjs/errors/transaction-rollback.error.d.ts +0 -20
- package/cjs/errors/transaction-rollback.error.d.ts.map +0 -1
- package/cjs/errors/transaction-rollback.error.js +0 -27
- package/cjs/errors/transaction-rollback.error.js.map +0 -1
- package/cjs/events/model-events.d.ts +0 -231
- package/cjs/events/model-events.d.ts.map +0 -1
- package/cjs/events/model-events.js +0 -259
- package/cjs/events/model-events.js.map +0 -1
- package/cjs/expressions/aggregate-expressions.d.ts +0 -215
- package/cjs/expressions/aggregate-expressions.d.ts.map +0 -1
- package/cjs/expressions/aggregate-expressions.js +0 -221
- package/cjs/expressions/aggregate-expressions.js.map +0 -1
- package/cjs/expressions/index.d.ts +0 -2
- package/cjs/expressions/index.d.ts.map +0 -1
- package/cjs/index.d.ts +0 -45
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/migration/column-builder.d.ts +0 -417
- package/cjs/migration/column-builder.d.ts.map +0 -1
- package/cjs/migration/column-builder.js +0 -586
- package/cjs/migration/column-builder.js.map +0 -1
- package/cjs/migration/column-helpers.d.ts +0 -275
- package/cjs/migration/column-helpers.d.ts.map +0 -1
- package/cjs/migration/column-helpers.js +0 -389
- package/cjs/migration/column-helpers.js.map +0 -1
- package/cjs/migration/foreign-key-builder.d.ts +0 -103
- package/cjs/migration/foreign-key-builder.d.ts.map +0 -1
- package/cjs/migration/foreign-key-builder.js +0 -121
- package/cjs/migration/foreign-key-builder.js.map +0 -1
- package/cjs/migration/index.d.ts +0 -7
- package/cjs/migration/index.d.ts.map +0 -1
- package/cjs/migration/migration-runner.d.ts +0 -278
- package/cjs/migration/migration-runner.d.ts.map +0 -1
- package/cjs/migration/migration-runner.js +0 -815
- package/cjs/migration/migration-runner.js.map +0 -1
- package/cjs/migration/migration.d.ts +0 -1988
- package/cjs/migration/migration.d.ts.map +0 -1
- package/cjs/migration/migration.js +0 -2162
- package/cjs/migration/migration.js.map +0 -1
- package/cjs/migration/sql-grammar.d.ts +0 -61
- package/cjs/migration/sql-grammar.d.ts.map +0 -1
- package/cjs/migration/sql-grammar.js +0 -164
- package/cjs/migration/sql-grammar.js.map +0 -1
- package/cjs/migration/sql-serializer.d.ts +0 -22
- package/cjs/migration/sql-serializer.d.ts.map +0 -1
- package/cjs/migration/sql-serializer.js +0 -26
- package/cjs/migration/sql-serializer.js.map +0 -1
- package/cjs/migration/types.d.ts +0 -155
- package/cjs/migration/types.d.ts.map +0 -1
- package/cjs/model/methods/accessor-methods.d.ts +0 -13
- package/cjs/model/methods/accessor-methods.d.ts.map +0 -1
- package/cjs/model/methods/accessor-methods.js +0 -51
- package/cjs/model/methods/accessor-methods.js.map +0 -1
- package/cjs/model/methods/delete-methods.d.ts +0 -10
- package/cjs/model/methods/delete-methods.d.ts.map +0 -1
- package/cjs/model/methods/delete-methods.js +0 -10
- package/cjs/model/methods/delete-methods.js.map +0 -1
- package/cjs/model/methods/dirty-methods.d.ts +0 -10
- package/cjs/model/methods/dirty-methods.d.ts.map +0 -1
- package/cjs/model/methods/dirty-methods.js +0 -15
- package/cjs/model/methods/dirty-methods.js.map +0 -1
- package/cjs/model/methods/hydration-methods.d.ts +0 -10
- package/cjs/model/methods/hydration-methods.d.ts.map +0 -1
- package/cjs/model/methods/hydration-methods.js +0 -57
- package/cjs/model/methods/hydration-methods.js.map +0 -1
- package/cjs/model/methods/instance-event-methods.d.ts +0 -7
- package/cjs/model/methods/instance-event-methods.d.ts.map +0 -1
- package/cjs/model/methods/instance-event-methods.js +0 -15
- package/cjs/model/methods/instance-event-methods.js.map +0 -1
- package/cjs/model/methods/meta-methods.d.ts +0 -7
- package/cjs/model/methods/meta-methods.d.ts.map +0 -1
- package/cjs/model/methods/meta-methods.js +0 -78
- package/cjs/model/methods/meta-methods.js.map +0 -1
- package/cjs/model/methods/query-methods.d.ts +0 -24
- package/cjs/model/methods/query-methods.d.ts.map +0 -1
- package/cjs/model/methods/query-methods.js +0 -164
- package/cjs/model/methods/query-methods.js.map +0 -1
- package/cjs/model/methods/restore-methods.d.ts +0 -10
- package/cjs/model/methods/restore-methods.d.ts.map +0 -1
- package/cjs/model/methods/restore-methods.js +0 -13
- package/cjs/model/methods/restore-methods.js.map +0 -1
- package/cjs/model/methods/scope-methods.d.ts +0 -7
- package/cjs/model/methods/scope-methods.d.ts.map +0 -1
- package/cjs/model/methods/scope-methods.js +0 -15
- package/cjs/model/methods/scope-methods.js.map +0 -1
- package/cjs/model/methods/serialization-methods.d.ts +0 -3
- package/cjs/model/methods/serialization-methods.d.ts.map +0 -1
- package/cjs/model/methods/serialization-methods.js +0 -27
- package/cjs/model/methods/serialization-methods.js.map +0 -1
- package/cjs/model/methods/static-event-methods.d.ts +0 -9
- package/cjs/model/methods/static-event-methods.d.ts.map +0 -1
- package/cjs/model/methods/static-event-methods.js +0 -29
- package/cjs/model/methods/static-event-methods.js.map +0 -1
- package/cjs/model/methods/write-methods.d.ts +0 -10
- package/cjs/model/methods/write-methods.d.ts.map +0 -1
- package/cjs/model/methods/write-methods.js +0 -52
- package/cjs/model/methods/write-methods.js.map +0 -1
- package/cjs/model/model.d.ts +0 -1647
- package/cjs/model/model.d.ts.map +0 -1
- package/cjs/model/model.js +0 -1657
- package/cjs/model/model.js.map +0 -1
- package/cjs/model/model.types.d.ts +0 -44
- package/cjs/model/model.types.d.ts.map +0 -1
- package/cjs/model/register-model.d.ts +0 -81
- package/cjs/model/register-model.d.ts.map +0 -1
- package/cjs/model/register-model.js +0 -94
- package/cjs/model/register-model.js.map +0 -1
- package/cjs/query-builder/query-builder.d.ts +0 -556
- package/cjs/query-builder/query-builder.d.ts.map +0 -1
- package/cjs/query-builder/query-builder.js +0 -1070
- package/cjs/query-builder/query-builder.js.map +0 -1
- package/cjs/relations/helpers.d.ts +0 -156
- package/cjs/relations/helpers.d.ts.map +0 -1
- package/cjs/relations/helpers.js +0 -202
- package/cjs/relations/helpers.js.map +0 -1
- package/cjs/relations/index.d.ts +0 -35
- package/cjs/relations/index.d.ts.map +0 -1
- package/cjs/relations/pivot-operations.d.ts +0 -160
- package/cjs/relations/pivot-operations.d.ts.map +0 -1
- package/cjs/relations/pivot-operations.js +0 -293
- package/cjs/relations/pivot-operations.js.map +0 -1
- package/cjs/relations/relation-hydrator.d.ts +0 -68
- package/cjs/relations/relation-hydrator.d.ts.map +0 -1
- package/cjs/relations/relation-hydrator.js +0 -81
- package/cjs/relations/relation-hydrator.js.map +0 -1
- package/cjs/relations/relation-loader.d.ts +0 -194
- package/cjs/relations/relation-loader.d.ts.map +0 -1
- package/cjs/relations/relation-loader.js +0 -466
- package/cjs/relations/relation-loader.js.map +0 -1
- package/cjs/relations/types.d.ts +0 -306
- package/cjs/relations/types.d.ts.map +0 -1
- package/cjs/remover/database-remover.d.ts +0 -100
- package/cjs/remover/database-remover.d.ts.map +0 -1
- package/cjs/remover/database-remover.js +0 -214
- package/cjs/remover/database-remover.js.map +0 -1
- package/cjs/restorer/database-restorer.d.ts +0 -131
- package/cjs/restorer/database-restorer.d.ts.map +0 -1
- package/cjs/restorer/database-restorer.js +0 -434
- package/cjs/restorer/database-restorer.js.map +0 -1
- package/cjs/sql-database-dirty-tracker.d.ts +0 -13
- package/cjs/sql-database-dirty-tracker.d.ts.map +0 -1
- package/cjs/sql-database-dirty-tracker.js +0 -14
- package/cjs/sql-database-dirty-tracker.js.map +0 -1
- package/cjs/sync/index.d.ts +0 -12
- package/cjs/sync/index.d.ts.map +0 -1
- package/cjs/sync/model-events.d.ts +0 -62
- package/cjs/sync/model-events.d.ts.map +0 -1
- package/cjs/sync/model-events.js +0 -49
- package/cjs/sync/model-events.js.map +0 -1
- package/cjs/sync/model-sync-operation.d.ts +0 -163
- package/cjs/sync/model-sync-operation.d.ts.map +0 -1
- package/cjs/sync/model-sync-operation.js +0 -292
- package/cjs/sync/model-sync-operation.js.map +0 -1
- package/cjs/sync/model-sync.d.ts +0 -130
- package/cjs/sync/model-sync.d.ts.map +0 -1
- package/cjs/sync/model-sync.js +0 -178
- package/cjs/sync/model-sync.js.map +0 -1
- package/cjs/sync/sync-context.d.ts +0 -70
- package/cjs/sync/sync-context.d.ts.map +0 -1
- package/cjs/sync/sync-context.js +0 -101
- package/cjs/sync/sync-context.js.map +0 -1
- package/cjs/sync/sync-manager.d.ts +0 -213
- package/cjs/sync/sync-manager.d.ts.map +0 -1
- package/cjs/sync/sync-manager.js +0 -689
- package/cjs/sync/sync-manager.js.map +0 -1
- package/cjs/sync/types.d.ts +0 -289
- package/cjs/sync/types.d.ts.map +0 -1
- package/cjs/test-migrations/test-enhanced-features.migration.d.ts +0 -15
- package/cjs/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
- package/cjs/types.d.ts +0 -371
- package/cjs/types.d.ts.map +0 -1
- package/cjs/utils/connect-to-database.d.ts +0 -307
- package/cjs/utils/connect-to-database.d.ts.map +0 -1
- package/cjs/utils/connect-to-database.js +0 -130
- package/cjs/utils/connect-to-database.js.map +0 -1
- package/cjs/utils/database-writer.utils.d.ts +0 -15
- package/cjs/utils/database-writer.utils.d.ts.map +0 -1
- package/cjs/utils/database-writer.utils.js +0 -14
- package/cjs/utils/database-writer.utils.js.map +0 -1
- package/cjs/utils/define-model.js +0 -100
- package/cjs/utils/define-model.js.map +0 -1
- package/cjs/utils/is-valid-date-value.d.ts +0 -5
- package/cjs/utils/is-valid-date-value.d.ts.map +0 -1
- package/cjs/utils/is-valid-date-value.js +0 -25
- package/cjs/utils/is-valid-date-value.js.map +0 -1
- package/cjs/utils/once-connected.d.ts +0 -146
- package/cjs/utils/once-connected.d.ts.map +0 -1
- package/cjs/utils/once-connected.js +0 -251
- package/cjs/utils/once-connected.js.map +0 -1
- package/cjs/validation/database-seal-plugins.d.ts +0 -12
- package/cjs/validation/database-seal-plugins.d.ts.map +0 -1
- package/cjs/validation/database-seal-plugins.js +0 -1
- package/cjs/validation/database-seal-plugins.js.map +0 -1
- package/cjs/validation/database-writer-validation-error.d.ts +0 -97
- package/cjs/validation/database-writer-validation-error.d.ts.map +0 -1
- package/cjs/validation/database-writer-validation-error.js +0 -160
- package/cjs/validation/database-writer-validation-error.js.map +0 -1
- package/cjs/validation/index.d.ts +0 -3
- package/cjs/validation/index.d.ts.map +0 -1
- package/cjs/validation/mutators/embed-mutator.d.ts +0 -9
- package/cjs/validation/mutators/embed-mutator.d.ts.map +0 -1
- package/cjs/validation/mutators/embed-mutator.js +0 -33
- package/cjs/validation/mutators/embed-mutator.js.map +0 -1
- package/cjs/validation/plugins/embed-validator-plugin.d.ts +0 -24
- package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
- package/cjs/validation/plugins/embed-validator-plugin.js +0 -18
- package/cjs/validation/plugins/embed-validator-plugin.js.map +0 -1
- package/cjs/validation/rules/database-model-rule.d.ts +0 -7
- package/cjs/validation/rules/database-model-rule.d.ts.map +0 -1
- package/cjs/validation/rules/database-model-rule.js +0 -27
- package/cjs/validation/rules/database-model-rule.js.map +0 -1
- package/cjs/validation/transformers/embed-model-transformer.d.ts +0 -3
- package/cjs/validation/transformers/embed-model-transformer.d.ts.map +0 -1
- package/cjs/validation/transformers/embed-model-transformer.js +0 -18
- package/cjs/validation/transformers/embed-model-transformer.js.map +0 -1
- package/cjs/validation/validators/embed-validator.d.ts +0 -21
- package/cjs/validation/validators/embed-validator.d.ts.map +0 -1
- package/cjs/validation/validators/embed-validator.js +0 -43
- package/cjs/validation/validators/embed-validator.js.map +0 -1
- package/cjs/writer/database-writer.d.ts +0 -174
- package/cjs/writer/database-writer.d.ts.map +0 -1
- package/cjs/writer/database-writer.js +0 -400
- package/cjs/writer/database-writer.js.map +0 -1
- package/esm/context/database-data-source-context.d.ts +0 -29
- package/esm/context/database-data-source-context.d.ts.map +0 -1
- package/esm/context/database-data-source-context.js +0 -28
- package/esm/context/database-data-source-context.js.map +0 -1
- package/esm/context/database-transaction-context.d.ts +0 -35
- package/esm/context/database-transaction-context.d.ts.map +0 -1
- package/esm/context/database-transaction-context.js +0 -40
- package/esm/context/database-transaction-context.js.map +0 -1
- package/esm/contracts/database-driver.contract.d.ts +0 -450
- package/esm/contracts/database-driver.contract.d.ts.map +0 -1
- package/esm/contracts/database-id-generator.contract.d.ts +0 -109
- package/esm/contracts/database-id-generator.contract.d.ts.map +0 -1
- package/esm/contracts/database-remover.contract.d.ts +0 -104
- package/esm/contracts/database-remover.contract.d.ts.map +0 -1
- package/esm/contracts/database-restorer.contract.d.ts +0 -143
- package/esm/contracts/database-restorer.contract.d.ts.map +0 -1
- package/esm/contracts/database-writer.contract.d.ts +0 -119
- package/esm/contracts/database-writer.contract.d.ts.map +0 -1
- package/esm/contracts/driver-blueprint.contract.d.ts +0 -49
- package/esm/contracts/driver-blueprint.contract.d.ts.map +0 -1
- package/esm/contracts/index.d.ts +0 -10
- package/esm/contracts/index.d.ts.map +0 -1
- package/esm/contracts/migration-driver.contract.d.ts +0 -522
- package/esm/contracts/migration-driver.contract.d.ts.map +0 -1
- package/esm/contracts/query-builder.contract.d.ts +0 -1609
- package/esm/contracts/query-builder.contract.d.ts.map +0 -1
- package/esm/contracts/sync-adapter.contract.d.ts +0 -58
- package/esm/contracts/sync-adapter.contract.d.ts.map +0 -1
- package/esm/data-source/data-source-registry.d.ts +0 -108
- package/esm/data-source/data-source-registry.d.ts.map +0 -1
- package/esm/data-source/data-source-registry.js +0 -145
- package/esm/data-source/data-source-registry.js.map +0 -1
- package/esm/data-source/data-source.d.ts +0 -147
- package/esm/data-source/data-source.d.ts.map +0 -1
- package/esm/data-source/data-source.js +0 -83
- package/esm/data-source/data-source.js.map +0 -1
- package/esm/database-dirty-tracker.d.ts +0 -252
- package/esm/database-dirty-tracker.d.ts.map +0 -1
- package/esm/database-dirty-tracker.js +0 -386
- package/esm/database-dirty-tracker.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
- package/esm/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-blueprint.js +0 -51
- package/esm/drivers/mongodb/mongodb-blueprint.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-driver.d.ts +0 -325
- package/esm/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-driver.js +0 -845
- package/esm/drivers/mongodb/mongodb-driver.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
- package/esm/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-id-generator.js +0 -149
- package/esm/drivers/mongodb/mongodb-id-generator.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
- package/esm/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.js +0 -666
- package/esm/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
- package/esm/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-builder.js +0 -1988
- package/esm/drivers/mongodb/mongodb-query-builder.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
- package/esm/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-operations.js +0 -270
- package/esm/drivers/mongodb/mongodb-query-operations.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
- package/esm/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-parser.js +0 -1351
- package/esm/drivers/mongodb/mongodb-query-parser.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.js +0 -146
- package/esm/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
- package/esm/drivers/mongodb/types.d.ts +0 -43
- package/esm/drivers/mongodb/types.d.ts.map +0 -1
- package/esm/drivers/postgres/index.d.ts +0 -16
- package/esm/drivers/postgres/index.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-blueprint.d.ts +0 -64
- package/esm/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-blueprint.js +0 -121
- package/esm/drivers/postgres/postgres-blueprint.js.map +0 -1
- package/esm/drivers/postgres/postgres-dialect.d.ts +0 -136
- package/esm/drivers/postgres/postgres-dialect.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-dialect.js +0 -268
- package/esm/drivers/postgres/postgres-dialect.js.map +0 -1
- package/esm/drivers/postgres/postgres-driver.d.ts +0 -432
- package/esm/drivers/postgres/postgres-driver.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-driver.js +0 -1008
- package/esm/drivers/postgres/postgres-driver.js.map +0 -1
- package/esm/drivers/postgres/postgres-migration-driver.d.ts +0 -397
- package/esm/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-migration-driver.js +0 -900
- package/esm/drivers/postgres/postgres-migration-driver.js.map +0 -1
- package/esm/drivers/postgres/postgres-query-builder.d.ts +0 -254
- package/esm/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-query-builder.js +0 -933
- package/esm/drivers/postgres/postgres-query-builder.js.map +0 -1
- package/esm/drivers/postgres/postgres-query-parser.d.ts +0 -328
- package/esm/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-query-parser.js +0 -868
- package/esm/drivers/postgres/postgres-query-parser.js.map +0 -1
- package/esm/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
- package/esm/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-sql-serializer.js +0 -400
- package/esm/drivers/postgres/postgres-sql-serializer.js.map +0 -1
- package/esm/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
- package/esm/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-sync-adapter.js +0 -204
- package/esm/drivers/postgres/postgres-sync-adapter.js.map +0 -1
- package/esm/drivers/postgres/types.d.ts +0 -144
- package/esm/drivers/postgres/types.d.ts.map +0 -1
- package/esm/drivers/sql/index.d.ts +0 -10
- package/esm/drivers/sql/index.d.ts.map +0 -1
- package/esm/drivers/sql/sql-dialect.contract.d.ts +0 -204
- package/esm/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
- package/esm/drivers/sql/sql-types.d.ts +0 -202
- package/esm/drivers/sql/sql-types.d.ts.map +0 -1
- package/esm/errors/missing-data-source.error.d.ts +0 -22
- package/esm/errors/missing-data-source.error.d.ts.map +0 -1
- package/esm/errors/missing-data-source.error.js +0 -29
- package/esm/errors/missing-data-source.error.js.map +0 -1
- package/esm/errors/transaction-rollback.error.d.ts +0 -20
- package/esm/errors/transaction-rollback.error.d.ts.map +0 -1
- package/esm/errors/transaction-rollback.error.js +0 -27
- package/esm/errors/transaction-rollback.error.js.map +0 -1
- package/esm/events/model-events.d.ts +0 -231
- package/esm/events/model-events.d.ts.map +0 -1
- package/esm/events/model-events.js +0 -259
- package/esm/events/model-events.js.map +0 -1
- package/esm/expressions/aggregate-expressions.d.ts +0 -215
- package/esm/expressions/aggregate-expressions.d.ts.map +0 -1
- package/esm/expressions/aggregate-expressions.js +0 -221
- package/esm/expressions/aggregate-expressions.js.map +0 -1
- package/esm/expressions/index.d.ts +0 -2
- package/esm/expressions/index.d.ts.map +0 -1
- package/esm/index.d.ts +0 -45
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -1
- package/esm/index.js.map +0 -1
- package/esm/migration/column-builder.d.ts +0 -417
- package/esm/migration/column-builder.d.ts.map +0 -1
- package/esm/migration/column-builder.js +0 -586
- package/esm/migration/column-builder.js.map +0 -1
- package/esm/migration/column-helpers.d.ts +0 -275
- package/esm/migration/column-helpers.d.ts.map +0 -1
- package/esm/migration/column-helpers.js +0 -389
- package/esm/migration/column-helpers.js.map +0 -1
- package/esm/migration/foreign-key-builder.d.ts +0 -103
- package/esm/migration/foreign-key-builder.d.ts.map +0 -1
- package/esm/migration/foreign-key-builder.js +0 -121
- package/esm/migration/foreign-key-builder.js.map +0 -1
- package/esm/migration/index.d.ts +0 -7
- package/esm/migration/index.d.ts.map +0 -1
- package/esm/migration/migration-runner.d.ts +0 -278
- package/esm/migration/migration-runner.d.ts.map +0 -1
- package/esm/migration/migration-runner.js +0 -815
- package/esm/migration/migration-runner.js.map +0 -1
- package/esm/migration/migration.d.ts +0 -1988
- package/esm/migration/migration.d.ts.map +0 -1
- package/esm/migration/migration.js +0 -2162
- package/esm/migration/migration.js.map +0 -1
- package/esm/migration/sql-grammar.d.ts +0 -61
- package/esm/migration/sql-grammar.d.ts.map +0 -1
- package/esm/migration/sql-grammar.js +0 -164
- package/esm/migration/sql-grammar.js.map +0 -1
- package/esm/migration/sql-serializer.d.ts +0 -22
- package/esm/migration/sql-serializer.d.ts.map +0 -1
- package/esm/migration/sql-serializer.js +0 -26
- package/esm/migration/sql-serializer.js.map +0 -1
- package/esm/migration/types.d.ts +0 -155
- package/esm/migration/types.d.ts.map +0 -1
- package/esm/model/methods/accessor-methods.d.ts +0 -13
- package/esm/model/methods/accessor-methods.d.ts.map +0 -1
- package/esm/model/methods/accessor-methods.js +0 -51
- package/esm/model/methods/accessor-methods.js.map +0 -1
- package/esm/model/methods/delete-methods.d.ts +0 -10
- package/esm/model/methods/delete-methods.d.ts.map +0 -1
- package/esm/model/methods/delete-methods.js +0 -10
- package/esm/model/methods/delete-methods.js.map +0 -1
- package/esm/model/methods/dirty-methods.d.ts +0 -10
- package/esm/model/methods/dirty-methods.d.ts.map +0 -1
- package/esm/model/methods/dirty-methods.js +0 -15
- package/esm/model/methods/dirty-methods.js.map +0 -1
- package/esm/model/methods/hydration-methods.d.ts +0 -10
- package/esm/model/methods/hydration-methods.d.ts.map +0 -1
- package/esm/model/methods/hydration-methods.js +0 -57
- package/esm/model/methods/hydration-methods.js.map +0 -1
- package/esm/model/methods/instance-event-methods.d.ts +0 -7
- package/esm/model/methods/instance-event-methods.d.ts.map +0 -1
- package/esm/model/methods/instance-event-methods.js +0 -15
- package/esm/model/methods/instance-event-methods.js.map +0 -1
- package/esm/model/methods/meta-methods.d.ts +0 -7
- package/esm/model/methods/meta-methods.d.ts.map +0 -1
- package/esm/model/methods/meta-methods.js +0 -78
- package/esm/model/methods/meta-methods.js.map +0 -1
- package/esm/model/methods/query-methods.d.ts +0 -24
- package/esm/model/methods/query-methods.d.ts.map +0 -1
- package/esm/model/methods/query-methods.js +0 -164
- package/esm/model/methods/query-methods.js.map +0 -1
- package/esm/model/methods/restore-methods.d.ts +0 -10
- package/esm/model/methods/restore-methods.d.ts.map +0 -1
- package/esm/model/methods/restore-methods.js +0 -13
- package/esm/model/methods/restore-methods.js.map +0 -1
- package/esm/model/methods/scope-methods.d.ts +0 -7
- package/esm/model/methods/scope-methods.d.ts.map +0 -1
- package/esm/model/methods/scope-methods.js +0 -15
- package/esm/model/methods/scope-methods.js.map +0 -1
- package/esm/model/methods/serialization-methods.d.ts +0 -3
- package/esm/model/methods/serialization-methods.d.ts.map +0 -1
- package/esm/model/methods/serialization-methods.js +0 -27
- package/esm/model/methods/serialization-methods.js.map +0 -1
- package/esm/model/methods/static-event-methods.d.ts +0 -9
- package/esm/model/methods/static-event-methods.d.ts.map +0 -1
- package/esm/model/methods/static-event-methods.js +0 -29
- package/esm/model/methods/static-event-methods.js.map +0 -1
- package/esm/model/methods/write-methods.d.ts +0 -10
- package/esm/model/methods/write-methods.d.ts.map +0 -1
- package/esm/model/methods/write-methods.js +0 -52
- package/esm/model/methods/write-methods.js.map +0 -1
- package/esm/model/model.d.ts +0 -1647
- package/esm/model/model.d.ts.map +0 -1
- package/esm/model/model.js +0 -1657
- package/esm/model/model.js.map +0 -1
- package/esm/model/model.types.d.ts +0 -44
- package/esm/model/model.types.d.ts.map +0 -1
- package/esm/model/register-model.d.ts +0 -81
- package/esm/model/register-model.d.ts.map +0 -1
- package/esm/model/register-model.js +0 -94
- package/esm/model/register-model.js.map +0 -1
- package/esm/query-builder/query-builder.d.ts +0 -556
- package/esm/query-builder/query-builder.d.ts.map +0 -1
- package/esm/query-builder/query-builder.js +0 -1070
- package/esm/query-builder/query-builder.js.map +0 -1
- package/esm/relations/helpers.d.ts +0 -156
- package/esm/relations/helpers.d.ts.map +0 -1
- package/esm/relations/helpers.js +0 -202
- package/esm/relations/helpers.js.map +0 -1
- package/esm/relations/index.d.ts +0 -35
- package/esm/relations/index.d.ts.map +0 -1
- package/esm/relations/pivot-operations.d.ts +0 -160
- package/esm/relations/pivot-operations.d.ts.map +0 -1
- package/esm/relations/pivot-operations.js +0 -293
- package/esm/relations/pivot-operations.js.map +0 -1
- package/esm/relations/relation-hydrator.d.ts +0 -68
- package/esm/relations/relation-hydrator.d.ts.map +0 -1
- package/esm/relations/relation-hydrator.js +0 -81
- package/esm/relations/relation-hydrator.js.map +0 -1
- package/esm/relations/relation-loader.d.ts +0 -194
- package/esm/relations/relation-loader.d.ts.map +0 -1
- package/esm/relations/relation-loader.js +0 -466
- package/esm/relations/relation-loader.js.map +0 -1
- package/esm/relations/types.d.ts +0 -306
- package/esm/relations/types.d.ts.map +0 -1
- package/esm/remover/database-remover.d.ts +0 -100
- package/esm/remover/database-remover.d.ts.map +0 -1
- package/esm/remover/database-remover.js +0 -214
- package/esm/remover/database-remover.js.map +0 -1
- package/esm/restorer/database-restorer.d.ts +0 -131
- package/esm/restorer/database-restorer.d.ts.map +0 -1
- package/esm/restorer/database-restorer.js +0 -434
- package/esm/restorer/database-restorer.js.map +0 -1
- package/esm/sql-database-dirty-tracker.d.ts +0 -13
- package/esm/sql-database-dirty-tracker.d.ts.map +0 -1
- package/esm/sql-database-dirty-tracker.js +0 -14
- package/esm/sql-database-dirty-tracker.js.map +0 -1
- package/esm/sync/index.d.ts +0 -12
- package/esm/sync/index.d.ts.map +0 -1
- package/esm/sync/model-events.d.ts +0 -62
- package/esm/sync/model-events.d.ts.map +0 -1
- package/esm/sync/model-events.js +0 -49
- package/esm/sync/model-events.js.map +0 -1
- package/esm/sync/model-sync-operation.d.ts +0 -163
- package/esm/sync/model-sync-operation.d.ts.map +0 -1
- package/esm/sync/model-sync-operation.js +0 -292
- package/esm/sync/model-sync-operation.js.map +0 -1
- package/esm/sync/model-sync.d.ts +0 -130
- package/esm/sync/model-sync.d.ts.map +0 -1
- package/esm/sync/model-sync.js +0 -178
- package/esm/sync/model-sync.js.map +0 -1
- package/esm/sync/sync-context.d.ts +0 -70
- package/esm/sync/sync-context.d.ts.map +0 -1
- package/esm/sync/sync-context.js +0 -101
- package/esm/sync/sync-context.js.map +0 -1
- package/esm/sync/sync-manager.d.ts +0 -213
- package/esm/sync/sync-manager.d.ts.map +0 -1
- package/esm/sync/sync-manager.js +0 -689
- package/esm/sync/sync-manager.js.map +0 -1
- package/esm/sync/types.d.ts +0 -289
- package/esm/sync/types.d.ts.map +0 -1
- package/esm/test-migrations/test-enhanced-features.migration.d.ts +0 -15
- package/esm/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
- package/esm/types.d.ts +0 -371
- package/esm/types.d.ts.map +0 -1
- package/esm/utils/connect-to-database.d.ts +0 -307
- package/esm/utils/connect-to-database.d.ts.map +0 -1
- package/esm/utils/connect-to-database.js +0 -130
- package/esm/utils/connect-to-database.js.map +0 -1
- package/esm/utils/database-writer.utils.d.ts +0 -15
- package/esm/utils/database-writer.utils.d.ts.map +0 -1
- package/esm/utils/database-writer.utils.js +0 -14
- package/esm/utils/database-writer.utils.js.map +0 -1
- package/esm/utils/define-model.js +0 -100
- package/esm/utils/define-model.js.map +0 -1
- package/esm/utils/is-valid-date-value.d.ts +0 -5
- package/esm/utils/is-valid-date-value.d.ts.map +0 -1
- package/esm/utils/is-valid-date-value.js +0 -25
- package/esm/utils/is-valid-date-value.js.map +0 -1
- package/esm/utils/once-connected.d.ts +0 -146
- package/esm/utils/once-connected.d.ts.map +0 -1
- package/esm/utils/once-connected.js +0 -251
- package/esm/utils/once-connected.js.map +0 -1
- package/esm/validation/database-seal-plugins.d.ts +0 -12
- package/esm/validation/database-seal-plugins.d.ts.map +0 -1
- package/esm/validation/database-seal-plugins.js +0 -1
- package/esm/validation/database-seal-plugins.js.map +0 -1
- package/esm/validation/database-writer-validation-error.d.ts +0 -97
- package/esm/validation/database-writer-validation-error.d.ts.map +0 -1
- package/esm/validation/database-writer-validation-error.js +0 -160
- package/esm/validation/database-writer-validation-error.js.map +0 -1
- package/esm/validation/index.d.ts +0 -3
- package/esm/validation/index.d.ts.map +0 -1
- package/esm/validation/mutators/embed-mutator.d.ts +0 -9
- package/esm/validation/mutators/embed-mutator.d.ts.map +0 -1
- package/esm/validation/mutators/embed-mutator.js +0 -33
- package/esm/validation/mutators/embed-mutator.js.map +0 -1
- package/esm/validation/plugins/embed-validator-plugin.d.ts +0 -24
- package/esm/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
- package/esm/validation/plugins/embed-validator-plugin.js +0 -18
- package/esm/validation/plugins/embed-validator-plugin.js.map +0 -1
- package/esm/validation/rules/database-model-rule.d.ts +0 -7
- package/esm/validation/rules/database-model-rule.d.ts.map +0 -1
- package/esm/validation/rules/database-model-rule.js +0 -27
- package/esm/validation/rules/database-model-rule.js.map +0 -1
- package/esm/validation/transformers/embed-model-transformer.d.ts +0 -3
- package/esm/validation/transformers/embed-model-transformer.d.ts.map +0 -1
- package/esm/validation/transformers/embed-model-transformer.js +0 -18
- package/esm/validation/transformers/embed-model-transformer.js.map +0 -1
- package/esm/validation/validators/embed-validator.d.ts +0 -21
- package/esm/validation/validators/embed-validator.d.ts.map +0 -1
- package/esm/validation/validators/embed-validator.js +0 -43
- package/esm/validation/validators/embed-validator.js.map +0 -1
- package/esm/writer/database-writer.d.ts +0 -174
- package/esm/writer/database-writer.d.ts.map +0 -1
- package/esm/writer/database-writer.js +0 -400
- package/esm/writer/database-writer.js.map +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
//#region ../../@warlock.js/cascade/src/expressions/aggregate-expressions.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Database-agnostic aggregation expressions.
|
|
4
|
+
*
|
|
5
|
+
* `count` / `sum` / `avg` / `min` / `max` are **cross-driver** — the same
|
|
6
|
+
* call compiles to the native shape on every supported database (MongoDB
|
|
7
|
+
* `{ $sum: "$field" }`, SQL `SUM(field)`, ...).
|
|
8
|
+
*
|
|
9
|
+
* `distinct` / `floor` / `first` / `last` are **MongoDB-only**. They have no
|
|
10
|
+
* single-scalar `GROUP BY` equivalent in SQL, so on Postgres they throw a
|
|
11
|
+
* fail-fast error at the `.groupBy()` call (naming the `selectRaw` /
|
|
12
|
+
* `havingRaw` escape hatch) rather than emit a silently-different query.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { $agg } from '@warlock.js/cascade';
|
|
17
|
+
*
|
|
18
|
+
* // Works for both MongoDB and SQL
|
|
19
|
+
* Lesson.query()
|
|
20
|
+
* .groupBy("type", {
|
|
21
|
+
* count: $agg.count(),
|
|
22
|
+
* total: $agg.sum("duration"),
|
|
23
|
+
* avg: $agg.avg("rating")
|
|
24
|
+
* })
|
|
25
|
+
* .get();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Abstract aggregate expression format.
|
|
30
|
+
*
|
|
31
|
+
* This format is database-agnostic and will be translated by each driver
|
|
32
|
+
* to their native syntax.
|
|
33
|
+
*/
|
|
34
|
+
type AggregateExpression = {
|
|
35
|
+
/** The aggregate function type */__agg: AggregateFunction; /** The field to aggregate (null for count) */
|
|
36
|
+
__field: string | null;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Supported aggregate functions.
|
|
40
|
+
*/
|
|
41
|
+
type AggregateFunction = "count" | "sum" | "avg" | "min" | "max" | "first" | "last" | "distinct" | "floor";
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a value is an abstract aggregate expression.
|
|
44
|
+
*/
|
|
45
|
+
declare function isAggregateExpression(value: unknown): value is AggregateExpression;
|
|
46
|
+
/**
|
|
47
|
+
* Database-agnostic aggregation expression helpers.
|
|
48
|
+
*
|
|
49
|
+
* These helpers create abstract expressions that each driver translates
|
|
50
|
+
* to their native format.
|
|
51
|
+
*/
|
|
52
|
+
declare const $agg: {
|
|
53
|
+
/**
|
|
54
|
+
* Count documents in each group.
|
|
55
|
+
*
|
|
56
|
+
* @returns Abstract count expression
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* query.groupBy("type", {
|
|
61
|
+
* count: $agg.count()
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Translates to:
|
|
66
|
+
* - MongoDB: `{ $sum: 1 }`
|
|
67
|
+
* - SQL: `COUNT(*)`
|
|
68
|
+
*/
|
|
69
|
+
count(): AggregateExpression;
|
|
70
|
+
/**
|
|
71
|
+
* Sum a numeric field across documents in each group.
|
|
72
|
+
*
|
|
73
|
+
* @param field - The field name to sum
|
|
74
|
+
* @returns Abstract sum expression
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* query.groupBy("type", {
|
|
79
|
+
* totalDuration: $agg.sum("duration")
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* Translates to:
|
|
84
|
+
* - MongoDB: `{ $sum: "$duration" }`
|
|
85
|
+
* - SQL: `SUM(duration)`
|
|
86
|
+
*/
|
|
87
|
+
sum(field: string): AggregateExpression;
|
|
88
|
+
/**
|
|
89
|
+
* Calculate the average value of a field across documents in each group.
|
|
90
|
+
*
|
|
91
|
+
* @param field - The field name to average
|
|
92
|
+
* @returns Abstract average expression
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* query.groupBy("type", {
|
|
97
|
+
* avgRating: $agg.avg("rating")
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* Translates to:
|
|
102
|
+
* - MongoDB: `{ $avg: "$rating" }`
|
|
103
|
+
* - SQL: `AVG(rating)`
|
|
104
|
+
*/
|
|
105
|
+
avg(field: string): AggregateExpression;
|
|
106
|
+
/**
|
|
107
|
+
* Get the minimum value of a field across documents in each group.
|
|
108
|
+
*
|
|
109
|
+
* @param field - The field name
|
|
110
|
+
* @returns Abstract min expression
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* query.groupBy("type", {
|
|
115
|
+
* minPrice: $agg.min("price")
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* Translates to:
|
|
120
|
+
* - MongoDB: `{ $min: "$price" }`
|
|
121
|
+
* - SQL: `MIN(price)`
|
|
122
|
+
*/
|
|
123
|
+
min(field: string): AggregateExpression;
|
|
124
|
+
/**
|
|
125
|
+
* Get the maximum value of a field across documents in each group.
|
|
126
|
+
*
|
|
127
|
+
* @param field - The field name
|
|
128
|
+
* @returns Abstract max expression
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* query.groupBy("type", {
|
|
133
|
+
* maxPrice: $agg.max("price")
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* Translates to:
|
|
138
|
+
* - MongoDB: `{ $max: "$price" }`
|
|
139
|
+
* - SQL: `MAX(price)`
|
|
140
|
+
*/
|
|
141
|
+
max(field: string): AggregateExpression;
|
|
142
|
+
/**
|
|
143
|
+
* Get the distinct values of a field across documents in each group.
|
|
144
|
+
*
|
|
145
|
+
* @param field - The field name
|
|
146
|
+
* @returns Abstract distinct expression
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* query.groupBy("type", {
|
|
151
|
+
* distinctColors: $agg.distinct("color")
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* **MongoDB-only.** MongoDB: `{ $distinct: "$color" }` (returns the array
|
|
156
|
+
* of distinct values). On Postgres this throws — SQL `DISTINCT` is a set
|
|
157
|
+
* quantifier, not a scalar aggregate, so there is no equivalent single
|
|
158
|
+
* value to put in a `GROUP BY` projection. Use `selectRaw` if you need a
|
|
159
|
+
* Postgres-specific shape (e.g. `array_agg(DISTINCT color)`).
|
|
160
|
+
*/
|
|
161
|
+
distinct(field: string): AggregateExpression;
|
|
162
|
+
/**
|
|
163
|
+
* Get the floor value of a field across documents in each group.
|
|
164
|
+
*
|
|
165
|
+
* @param field - The field name
|
|
166
|
+
* @returns Abstract floor expression
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* query.groupBy("type", {
|
|
171
|
+
* floorPrice: $agg.floor("price")
|
|
172
|
+
* });
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* **MongoDB-only.** MongoDB: `{ $floor: "$price" }`. On Postgres this
|
|
176
|
+
* throws — `FLOOR` is a scalar function, not an aggregate, so it is
|
|
177
|
+
* meaningless inside a bare `$group` / `GROUP BY`. Use `selectRaw` with
|
|
178
|
+
* `FLOOR(...)` over the aggregated value if you need it on Postgres.
|
|
179
|
+
*/
|
|
180
|
+
floor(field: string): AggregateExpression;
|
|
181
|
+
/**
|
|
182
|
+
* Get the first value of a field in each group (order-dependent).
|
|
183
|
+
*
|
|
184
|
+
* @param field - The field name
|
|
185
|
+
* @returns Abstract first expression
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* query.groupBy("type", {
|
|
190
|
+
* firstName: $agg.first("name")
|
|
191
|
+
* });
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* **MongoDB-only.** MongoDB: `{ $first: "$name" }` (group-order
|
|
195
|
+
* dependent). On Postgres this throws — the SQL equivalent is
|
|
196
|
+
* `FIRST_VALUE(name) OVER (ORDER BY ...)`, a window function needing an
|
|
197
|
+
* ordering context the `$agg` API doesn't carry. Use `selectRaw` with an
|
|
198
|
+
* explicit window function if you need it on Postgres.
|
|
199
|
+
*/
|
|
200
|
+
first(field: string): AggregateExpression;
|
|
201
|
+
/**
|
|
202
|
+
* Get the last value of a field in each group (order-dependent).
|
|
203
|
+
*
|
|
204
|
+
* @param field - The field name
|
|
205
|
+
* @returns Abstract last expression
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* query.groupBy("type", {
|
|
210
|
+
* lastName: $agg.last("name")
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* **MongoDB-only.** MongoDB: `{ $last: "$name" }` (group-order
|
|
215
|
+
* dependent). On Postgres this throws — the SQL equivalent is
|
|
216
|
+
* `LAST_VALUE(name) OVER (ORDER BY ...)`, a window function needing an
|
|
217
|
+
* ordering context the `$agg` API doesn't carry. Use `selectRaw` with an
|
|
218
|
+
* explicit window function if you need it on Postgres.
|
|
219
|
+
*/
|
|
220
|
+
last(field: string): AggregateExpression;
|
|
221
|
+
};
|
|
222
|
+
//#endregion
|
|
223
|
+
export { $agg, AggregateExpression, AggregateFunction, isAggregateExpression };
|
|
224
|
+
//# sourceMappingURL=aggregate-expressions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-expressions.d.mts","names":[],"sources":["../../../../../../@warlock.js/cascade/src/expressions/aggregate-expressions.ts"],"mappings":";;AAiCA;;;;;;;;AAIS;AAMT;;;;AAA6B;AAc7B;;;;;;;;AAAmF;AAenF;;;;;;;;KAvCY,mBAAA;EAyLY,kCAvLtB,KAAA,EAAO,iBAAiB,EAqOH;EAnOrB,OAAA;AAAA;;;;KAMU,iBAAA;;;;iBAcI,qBAAA,CAAsB,KAAA,YAAiB,KAAA,IAAS,mBAAmB;;;;;;;cAetE,IAAA;;;;;;;;;;;;;AAgM6B;;;;WA/K/B,mBAAA;;;;;;;;;;;;;;;;;;sBAqBW,mBAAA;;;;;;;;;;;;;;;;;;sBAqBA,mBAAA;;;;;;;;;;;;;;;;;;sBAqBA,mBAAA;;;;;;;;;;;;;;;;;;sBAqBA,mBAAA;;;;;;;;;;;;;;;;;;;;2BAuBK,mBAAA;;;;;;;;;;;;;;;;;;;wBAsBH,mBAAA;;;;;;;;;;;;;;;;;;;;wBAuBA,mBAAA;;;;;;;;;;;;;;;;;;;;uBAuBD,mBAAA;AAAA"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
//#region ../../@warlock.js/cascade/src/expressions/aggregate-expressions.ts
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a value is an abstract aggregate expression.
|
|
4
|
+
*/
|
|
5
|
+
function isAggregateExpression(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && "__field" in value && typeof value.__agg === "string";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Database-agnostic aggregation expression helpers.
|
|
10
|
+
*
|
|
11
|
+
* These helpers create abstract expressions that each driver translates
|
|
12
|
+
* to their native format.
|
|
13
|
+
*/
|
|
14
|
+
const $agg = {
|
|
15
|
+
/**
|
|
16
|
+
* Count documents in each group.
|
|
17
|
+
*
|
|
18
|
+
* @returns Abstract count expression
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* query.groupBy("type", {
|
|
23
|
+
* count: $agg.count()
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Translates to:
|
|
28
|
+
* - MongoDB: `{ $sum: 1 }`
|
|
29
|
+
* - SQL: `COUNT(*)`
|
|
30
|
+
*/
|
|
31
|
+
count() {
|
|
32
|
+
return {
|
|
33
|
+
__agg: "count",
|
|
34
|
+
__field: null
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Sum a numeric field across documents in each group.
|
|
39
|
+
*
|
|
40
|
+
* @param field - The field name to sum
|
|
41
|
+
* @returns Abstract sum expression
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* query.groupBy("type", {
|
|
46
|
+
* totalDuration: $agg.sum("duration")
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* Translates to:
|
|
51
|
+
* - MongoDB: `{ $sum: "$duration" }`
|
|
52
|
+
* - SQL: `SUM(duration)`
|
|
53
|
+
*/
|
|
54
|
+
sum(field) {
|
|
55
|
+
return {
|
|
56
|
+
__agg: "sum",
|
|
57
|
+
__field: field
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Calculate the average value of a field across documents in each group.
|
|
62
|
+
*
|
|
63
|
+
* @param field - The field name to average
|
|
64
|
+
* @returns Abstract average expression
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* query.groupBy("type", {
|
|
69
|
+
* avgRating: $agg.avg("rating")
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* Translates to:
|
|
74
|
+
* - MongoDB: `{ $avg: "$rating" }`
|
|
75
|
+
* - SQL: `AVG(rating)`
|
|
76
|
+
*/
|
|
77
|
+
avg(field) {
|
|
78
|
+
return {
|
|
79
|
+
__agg: "avg",
|
|
80
|
+
__field: field
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Get the minimum value of a field across documents in each group.
|
|
85
|
+
*
|
|
86
|
+
* @param field - The field name
|
|
87
|
+
* @returns Abstract min expression
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* query.groupBy("type", {
|
|
92
|
+
* minPrice: $agg.min("price")
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* Translates to:
|
|
97
|
+
* - MongoDB: `{ $min: "$price" }`
|
|
98
|
+
* - SQL: `MIN(price)`
|
|
99
|
+
*/
|
|
100
|
+
min(field) {
|
|
101
|
+
return {
|
|
102
|
+
__agg: "min",
|
|
103
|
+
__field: field
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Get the maximum value of a field across documents in each group.
|
|
108
|
+
*
|
|
109
|
+
* @param field - The field name
|
|
110
|
+
* @returns Abstract max expression
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* query.groupBy("type", {
|
|
115
|
+
* maxPrice: $agg.max("price")
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* Translates to:
|
|
120
|
+
* - MongoDB: `{ $max: "$price" }`
|
|
121
|
+
* - SQL: `MAX(price)`
|
|
122
|
+
*/
|
|
123
|
+
max(field) {
|
|
124
|
+
return {
|
|
125
|
+
__agg: "max",
|
|
126
|
+
__field: field
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Get the distinct values of a field across documents in each group.
|
|
131
|
+
*
|
|
132
|
+
* @param field - The field name
|
|
133
|
+
* @returns Abstract distinct expression
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* query.groupBy("type", {
|
|
138
|
+
* distinctColors: $agg.distinct("color")
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* **MongoDB-only.** MongoDB: `{ $distinct: "$color" }` (returns the array
|
|
143
|
+
* of distinct values). On Postgres this throws — SQL `DISTINCT` is a set
|
|
144
|
+
* quantifier, not a scalar aggregate, so there is no equivalent single
|
|
145
|
+
* value to put in a `GROUP BY` projection. Use `selectRaw` if you need a
|
|
146
|
+
* Postgres-specific shape (e.g. `array_agg(DISTINCT color)`).
|
|
147
|
+
*/
|
|
148
|
+
distinct(field) {
|
|
149
|
+
return {
|
|
150
|
+
__agg: "distinct",
|
|
151
|
+
__field: field
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Get the floor value of a field across documents in each group.
|
|
156
|
+
*
|
|
157
|
+
* @param field - The field name
|
|
158
|
+
* @returns Abstract floor expression
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* query.groupBy("type", {
|
|
163
|
+
* floorPrice: $agg.floor("price")
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* **MongoDB-only.** MongoDB: `{ $floor: "$price" }`. On Postgres this
|
|
168
|
+
* throws — `FLOOR` is a scalar function, not an aggregate, so it is
|
|
169
|
+
* meaningless inside a bare `$group` / `GROUP BY`. Use `selectRaw` with
|
|
170
|
+
* `FLOOR(...)` over the aggregated value if you need it on Postgres.
|
|
171
|
+
*/
|
|
172
|
+
floor(field) {
|
|
173
|
+
return {
|
|
174
|
+
__agg: "floor",
|
|
175
|
+
__field: field
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* Get the first value of a field in each group (order-dependent).
|
|
180
|
+
*
|
|
181
|
+
* @param field - The field name
|
|
182
|
+
* @returns Abstract first expression
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* query.groupBy("type", {
|
|
187
|
+
* firstName: $agg.first("name")
|
|
188
|
+
* });
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* **MongoDB-only.** MongoDB: `{ $first: "$name" }` (group-order
|
|
192
|
+
* dependent). On Postgres this throws — the SQL equivalent is
|
|
193
|
+
* `FIRST_VALUE(name) OVER (ORDER BY ...)`, a window function needing an
|
|
194
|
+
* ordering context the `$agg` API doesn't carry. Use `selectRaw` with an
|
|
195
|
+
* explicit window function if you need it on Postgres.
|
|
196
|
+
*/
|
|
197
|
+
first(field) {
|
|
198
|
+
return {
|
|
199
|
+
__agg: "first",
|
|
200
|
+
__field: field
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Get the last value of a field in each group (order-dependent).
|
|
205
|
+
*
|
|
206
|
+
* @param field - The field name
|
|
207
|
+
* @returns Abstract last expression
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* query.groupBy("type", {
|
|
212
|
+
* lastName: $agg.last("name")
|
|
213
|
+
* });
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* **MongoDB-only.** MongoDB: `{ $last: "$name" }` (group-order
|
|
217
|
+
* dependent). On Postgres this throws — the SQL equivalent is
|
|
218
|
+
* `LAST_VALUE(name) OVER (ORDER BY ...)`, a window function needing an
|
|
219
|
+
* ordering context the `$agg` API doesn't carry. Use `selectRaw` with an
|
|
220
|
+
* explicit window function if you need it on Postgres.
|
|
221
|
+
*/
|
|
222
|
+
last(field) {
|
|
223
|
+
return {
|
|
224
|
+
__agg: "last",
|
|
225
|
+
__field: field
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
//#endregion
|
|
231
|
+
export { $agg, isAggregateExpression };
|
|
232
|
+
//# sourceMappingURL=aggregate-expressions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-expressions.mjs","names":[],"sources":["../../../../../../@warlock.js/cascade/src/expressions/aggregate-expressions.ts"],"sourcesContent":["/**\n * Database-agnostic aggregation expressions.\n *\n * `count` / `sum` / `avg` / `min` / `max` are **cross-driver** — the same\n * call compiles to the native shape on every supported database (MongoDB\n * `{ $sum: \"$field\" }`, SQL `SUM(field)`, ...).\n *\n * `distinct` / `floor` / `first` / `last` are **MongoDB-only**. They have no\n * single-scalar `GROUP BY` equivalent in SQL, so on Postgres they throw a\n * fail-fast error at the `.groupBy()` call (naming the `selectRaw` /\n * `havingRaw` escape hatch) rather than emit a silently-different query.\n *\n * @example\n * ```typescript\n * import { $agg } from '@warlock.js/cascade';\n *\n * // Works for both MongoDB and SQL\n * Lesson.query()\n * .groupBy(\"type\", {\n * count: $agg.count(),\n * total: $agg.sum(\"duration\"),\n * avg: $agg.avg(\"rating\")\n * })\n * .get();\n * ```\n */\n\n/**\n * Abstract aggregate expression format.\n *\n * This format is database-agnostic and will be translated by each driver\n * to their native syntax.\n */\nexport type AggregateExpression = {\n /** The aggregate function type */\n __agg: AggregateFunction;\n /** The field to aggregate (null for count) */\n __field: string | null;\n};\n\n/**\n * Supported aggregate functions.\n */\nexport type AggregateFunction =\n | \"count\"\n | \"sum\"\n | \"avg\"\n | \"min\"\n | \"max\"\n | \"first\"\n | \"last\"\n | \"distinct\"\n | \"floor\";\n\n/**\n * Checks if a value is an abstract aggregate expression.\n */\nexport function isAggregateExpression(value: unknown): value is AggregateExpression {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__field\" in value &&\n typeof (value as AggregateExpression).__agg === \"string\"\n );\n}\n\n/**\n * Database-agnostic aggregation expression helpers.\n *\n * These helpers create abstract expressions that each driver translates\n * to their native format.\n */\nexport const $agg = {\n /**\n * Count documents in each group.\n *\n * @returns Abstract count expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * count: $agg.count()\n * });\n * ```\n *\n * Translates to:\n * - MongoDB: `{ $sum: 1 }`\n * - SQL: `COUNT(*)`\n */\n count(): AggregateExpression {\n return { __agg: \"count\", __field: null };\n },\n\n /**\n * Sum a numeric field across documents in each group.\n *\n * @param field - The field name to sum\n * @returns Abstract sum expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * totalDuration: $agg.sum(\"duration\")\n * });\n * ```\n *\n * Translates to:\n * - MongoDB: `{ $sum: \"$duration\" }`\n * - SQL: `SUM(duration)`\n */\n sum(field: string): AggregateExpression {\n return { __agg: \"sum\", __field: field };\n },\n\n /**\n * Calculate the average value of a field across documents in each group.\n *\n * @param field - The field name to average\n * @returns Abstract average expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * avgRating: $agg.avg(\"rating\")\n * });\n * ```\n *\n * Translates to:\n * - MongoDB: `{ $avg: \"$rating\" }`\n * - SQL: `AVG(rating)`\n */\n avg(field: string): AggregateExpression {\n return { __agg: \"avg\", __field: field };\n },\n\n /**\n * Get the minimum value of a field across documents in each group.\n *\n * @param field - The field name\n * @returns Abstract min expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * minPrice: $agg.min(\"price\")\n * });\n * ```\n *\n * Translates to:\n * - MongoDB: `{ $min: \"$price\" }`\n * - SQL: `MIN(price)`\n */\n min(field: string): AggregateExpression {\n return { __agg: \"min\", __field: field };\n },\n\n /**\n * Get the maximum value of a field across documents in each group.\n *\n * @param field - The field name\n * @returns Abstract max expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * maxPrice: $agg.max(\"price\")\n * });\n * ```\n *\n * Translates to:\n * - MongoDB: `{ $max: \"$price\" }`\n * - SQL: `MAX(price)`\n */\n max(field: string): AggregateExpression {\n return { __agg: \"max\", __field: field };\n },\n\n /**\n * Get the distinct values of a field across documents in each group.\n *\n * @param field - The field name\n * @returns Abstract distinct expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * distinctColors: $agg.distinct(\"color\")\n * });\n * ```\n *\n * **MongoDB-only.** MongoDB: `{ $distinct: \"$color\" }` (returns the array\n * of distinct values). On Postgres this throws — SQL `DISTINCT` is a set\n * quantifier, not a scalar aggregate, so there is no equivalent single\n * value to put in a `GROUP BY` projection. Use `selectRaw` if you need a\n * Postgres-specific shape (e.g. `array_agg(DISTINCT color)`).\n */\n distinct(field: string): AggregateExpression {\n return { __agg: \"distinct\", __field: field };\n },\n\n /**\n * Get the floor value of a field across documents in each group.\n *\n * @param field - The field name\n * @returns Abstract floor expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * floorPrice: $agg.floor(\"price\")\n * });\n * ```\n *\n * **MongoDB-only.** MongoDB: `{ $floor: \"$price\" }`. On Postgres this\n * throws — `FLOOR` is a scalar function, not an aggregate, so it is\n * meaningless inside a bare `$group` / `GROUP BY`. Use `selectRaw` with\n * `FLOOR(...)` over the aggregated value if you need it on Postgres.\n */\n floor(field: string): AggregateExpression {\n return { __agg: \"floor\", __field: field };\n },\n\n /**\n * Get the first value of a field in each group (order-dependent).\n *\n * @param field - The field name\n * @returns Abstract first expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * firstName: $agg.first(\"name\")\n * });\n * ```\n *\n * **MongoDB-only.** MongoDB: `{ $first: \"$name\" }` (group-order\n * dependent). On Postgres this throws — the SQL equivalent is\n * `FIRST_VALUE(name) OVER (ORDER BY ...)`, a window function needing an\n * ordering context the `$agg` API doesn't carry. Use `selectRaw` with an\n * explicit window function if you need it on Postgres.\n */\n first(field: string): AggregateExpression {\n return { __agg: \"first\", __field: field };\n },\n\n /**\n * Get the last value of a field in each group (order-dependent).\n *\n * @param field - The field name\n * @returns Abstract last expression\n *\n * @example\n * ```typescript\n * query.groupBy(\"type\", {\n * lastName: $agg.last(\"name\")\n * });\n * ```\n *\n * **MongoDB-only.** MongoDB: `{ $last: \"$name\" }` (group-order\n * dependent). On Postgres this throws — the SQL equivalent is\n * `LAST_VALUE(name) OVER (ORDER BY ...)`, a window function needing an\n * ordering context the `$agg` API doesn't carry. Use `selectRaw` with an\n * explicit window function if you need it on Postgres.\n */\n last(field: string): AggregateExpression {\n return { __agg: \"last\", __field: field };\n },\n};\n"],"mappings":";;;;AAyDA,SAAgB,sBAAsB,OAA8C;CAClF,OACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAQ,MAA8B,UAAU;AAEpD;;;;;;;AAQA,MAAa,OAAO;;;;;;;;;;;;;;;;;CAiBlB,QAA6B;EAC3B,OAAO;GAAE,OAAO;GAAS,SAAS;EAAK;CACzC;;;;;;;;;;;;;;;;;;CAmBA,IAAI,OAAoC;EACtC,OAAO;GAAE,OAAO;GAAO,SAAS;EAAM;CACxC;;;;;;;;;;;;;;;;;;CAmBA,IAAI,OAAoC;EACtC,OAAO;GAAE,OAAO;GAAO,SAAS;EAAM;CACxC;;;;;;;;;;;;;;;;;;CAmBA,IAAI,OAAoC;EACtC,OAAO;GAAE,OAAO;GAAO,SAAS;EAAM;CACxC;;;;;;;;;;;;;;;;;;CAmBA,IAAI,OAAoC;EACtC,OAAO;GAAE,OAAO;GAAO,SAAS;EAAM;CACxC;;;;;;;;;;;;;;;;;;;;CAqBA,SAAS,OAAoC;EAC3C,OAAO;GAAE,OAAO;GAAY,SAAS;EAAM;CAC7C;;;;;;;;;;;;;;;;;;;CAoBA,MAAM,OAAoC;EACxC,OAAO;GAAE,OAAO;GAAS,SAAS;EAAM;CAC1C;;;;;;;;;;;;;;;;;;;;CAqBA,MAAM,OAAoC;EACxC,OAAO;GAAE,OAAO;GAAS,SAAS;EAAM;CAC1C;;;;;;;;;;;;;;;;;;;;CAqBA,KAAK,OAAoC;EACvC,OAAO;GAAE,OAAO;GAAQ,SAAS;EAAM;CACzC;AACF"}
|
package/esm/index.d.mts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DeleteStrategy, MigrationDefaults, ModelDefaults, NamingConvention, RelationDefaults, StrictMode, UuidStrategy } from "./types.mjs";
|
|
2
|
+
import { TableIndexInformation } from "./contracts/driver-blueprint.contract.mjs";
|
|
3
|
+
import { ColumnDefinition, ColumnType, ForeignKeyDefinition, FullTextIndexOptions, GeoIndexOptions, IndexDefinition, MigrationDriverContract, MigrationDriverFactory, VectorIndexOptions } from "./contracts/migration-driver.contract.mjs";
|
|
4
|
+
import { ColumnBuilder } from "./migration/column-builder.mjs";
|
|
5
|
+
import { DetachedColumnBuilder, arrayBigInt, arrayBoolean, arrayDate, arrayDecimal, arrayFloat, arrayInt, arrayJson, arrayText, arrayTimestamp, arrayUuid, bigInt, bigInteger, binary, blobCol, boolCol, char, date, dateTime, decimal, double, enumCol, float, geometry, int, integer, ipAddress, json, lineString, longText, macAddress, mediumText, objectCol, point, polygon, setCol, smallInt, smallInteger, string, text, time, timestamp, tinyInt, tinyInteger, ulid, uuid, vector, year } from "./migration/column-helpers.mjs";
|
|
6
|
+
import { DatabaseDirtyTracker } from "./database-dirty-tracker.mjs";
|
|
7
|
+
import { ChildModel, GlobalScopeDefinition, GlobalScopeOptions, LocalScopeCallback, ModelSchema, ScopeTiming } from "./model/model.types.mjs";
|
|
8
|
+
import { ModelEventListener, ModelEventName, ModelEvents, OnDeletedEventContext, globalModelEvents } from "./events/model-events.mjs";
|
|
9
|
+
import { BelongsToManyOptions, BelongsToOptions, HasManyOptions, HasOneOptions, LoadedRelationResult, LoadedRelationsMap, PivotData, PivotIds, RelationConstraintCallback, RelationConstraints, RelationDefinition, RelationDefinitions, RelationType } from "./relations/types.mjs";
|
|
10
|
+
import { PivotOperations, createPivotOperations } from "./relations/pivot-operations.mjs";
|
|
11
|
+
import { ModelSnapshot, RelationHydrator, SerializedRelation } from "./relations/relation-hydrator.mjs";
|
|
12
|
+
import { EmbedKey, ModelSyncConfig, ModelSyncContract, ModelSyncOperationContract, SyncConfig, SyncContext, SyncEventPayload, SyncInstruction, SyncInstructionOptions, SyncResult } from "./sync/types.mjs";
|
|
13
|
+
import { Model } from "./model/model.mjs";
|
|
14
|
+
import { ConnectionOptions, DatabaseDriver, ModelDefaultConfig, connectToDatabase, getDatabaseDriver, transaction } from "./utils/connect-to-database.mjs";
|
|
15
|
+
import { ForeignKeyBuilder } from "./migration/foreign-key-builder.mjs";
|
|
16
|
+
import { AlterSchema, ColumnMap, IndexEntry, Migration, MigrationAlterOptions, MigrationConstructor, MigrationContract, MigrationCreateOptions, OperationType, PendingOperation, UniqueEntry, migrate } from "./migration/migration.mjs";
|
|
17
|
+
import { ChunkCallback, CursorPaginationOptions, CursorPaginationResult, DriverQuery, GroupByInput, HavingInput, JoinOptions, OrderDirection, PaginationOptions, PaginationResult, QueryBuilderContract, RawExpression, WhereCallback, WhereObject, WhereOperator } from "./contracts/query-builder.contract.mjs";
|
|
18
|
+
import { SyncAdapterContract } from "./contracts/sync-adapter.contract.mjs";
|
|
19
|
+
import { CreateDatabaseOptions, DriverContract, DriverEvent, DriverEventListener, DriverTransactionContract, DropDatabaseOptions, InsertResult, TransactionContext, UpdateOperations, UpdateResult } from "./contracts/database-driver.contract.mjs";
|
|
20
|
+
import { GenerateIdOptions, IdGeneratorContract } from "./contracts/database-id-generator.contract.mjs";
|
|
21
|
+
import { RemoverContract, RemoverOptions, RemoverResult } from "./contracts/database-remover.contract.mjs";
|
|
22
|
+
import { RestorerContract, RestorerOptions, RestorerResult } from "./contracts/database-restorer.contract.mjs";
|
|
23
|
+
import { BuildUpdateOperationsResult, WriterContract, WriterOptions, WriterResult } from "./contracts/database-writer.contract.mjs";
|
|
24
|
+
import { DataSource, DataSourceOptions } from "./data-source/data-source.mjs";
|
|
25
|
+
import { databaseDataSourceContext } from "./context/database-data-source-context.mjs";
|
|
26
|
+
import { databaseTransactionContext } from "./context/database-transaction-context.mjs";
|
|
27
|
+
import { DataSourceRegistryEvent, DataSourceRegistryListener, dataSourceRegistry } from "./data-source/data-source-registry.mjs";
|
|
28
|
+
import { MissingDataSourceError } from "./errors/missing-data-source.error.mjs";
|
|
29
|
+
import { TransactionRollbackError } from "./errors/transaction-rollback.error.mjs";
|
|
30
|
+
import { ModelRef, RegisterModel, RegisterModelOptions, cleanupModelsRegistery, getAllModelsFromRegistry, getModelFromRegistry, registerModelInRegistry, removeModelFromRegistery, resolveModelClass, resolveModelName, tryResolveModelClass, verifyRegisteredRelations } from "./model/register-model.mjs";
|
|
31
|
+
import { BelongsTo, BelongsToMany, HasMany, HasOne, RELATION_METADATA_KEY } from "./model/relation-decorators.mjs";
|
|
32
|
+
import { DatabaseRemover } from "./remover/database-remover.mjs";
|
|
33
|
+
import { DatabaseRestorer } from "./restorer/database-restorer.mjs";
|
|
34
|
+
import { DatabaseWriterValidationError } from "./validation/database-writer-validation-error.mjs";
|
|
35
|
+
import { BaseQueryRuleOptions, BaseUniqueRuleOptions, ExistsRuleOptions, UniqueRuleOptions } from "./validation/types.mjs";
|
|
36
|
+
import { DatabaseWriter } from "./writer/database-writer.mjs";
|
|
37
|
+
import { RelationLoader } from "./relations/relation-loader.mjs";
|
|
38
|
+
import { $agg, AggregateExpression, AggregateFunction, isAggregateExpression } from "./expressions/aggregate-expressions.mjs";
|
|
39
|
+
import { MongoDriverOptions, Operation, PipelineStage } from "./drivers/mongodb/types.mjs";
|
|
40
|
+
import { MongoDbDriver, isMongoDBDriverLoaded } from "./drivers/mongodb/mongodb-driver.mjs";
|
|
41
|
+
import { MongoIdGenerator } from "./drivers/mongodb/mongodb-id-generator.mjs";
|
|
42
|
+
import { MongoQueryBuilder } from "./drivers/mongodb/mongodb-query-builder.mjs";
|
|
43
|
+
import { MongoSyncAdapter } from "./drivers/mongodb/mongodb-sync-adapter.mjs";
|
|
44
|
+
import { modelSync } from "./sync/model-sync.mjs";
|
|
45
|
+
import { ModelSyncOperation } from "./sync/model-sync-operation.mjs";
|
|
46
|
+
import { DEFAULT_MAX_SYNC_DEPTH, SyncContextManager } from "./sync/sync-context.mjs";
|
|
47
|
+
import { SyncManager } from "./sync/sync-manager.mjs";
|
|
48
|
+
import { ModelTransformCallback, useModelTransformer } from "./utils/database-writer.utils.mjs";
|
|
49
|
+
import { DefineModelOptions, ModelType, defineModel } from "./utils/define-model.mjs";
|
|
50
|
+
import { onceConnected, onceDisconnected } from "./utils/once-connected.mjs";
|
|
51
|
+
import { MigrationRecord, MigrationResult, MigrationRunnerOptions, MigrationStatus, PendingMigration, RollbackOptions, RunMigrationsOptions } from "./migration/types.mjs";
|
|
52
|
+
import { MigrationRunner, migrationRunner } from "./migration/migration-runner.mjs";
|
|
53
|
+
import { CreateDatabaseResult, DropAllTablesResult, createDatabase, dropAllTables } from "./operations/database.mjs";
|
|
54
|
+
import { ExportMigrationsSQLOptions, RollbackMigrationsOptions, exportMigrationsSQL, freshMigrate, listExecutedMigrations, rollbackMigrations, runMigrations } from "./operations/migrations.mjs";
|
|
55
|
+
import { MongoMigrationDriver } from "./drivers/mongodb/mongodb-migration-driver.mjs";
|
|
56
|
+
import { SqlDialectContract } from "./drivers/sql/sql-dialect.contract.mjs";
|
|
57
|
+
import { SqlAggregateFunction, SqlDeleteOperation, SqlGroupClause, SqlHavingClause, SqlInsertOperation, SqlJoinClause, SqlJoinType, SqlOrderClause, SqlQueryConfig, SqlQueryResult, SqlSelectClause, SqlUpdateOperation, SqlWhereOperation, SqlWhereType } from "./drivers/sql/sql-types.mjs";
|
|
58
|
+
import { PostgresDialect } from "./drivers/postgres/postgres-dialect.mjs";
|
|
59
|
+
import { PostgresConnectionConfig, PostgresCopyOptions, PostgresIsolationLevel, PostgresNotification, PostgresOperation, PostgresPoolConfig, PostgresQueryResult, PostgresTransactionOptions, PostgresWhereClause } from "./drivers/postgres/types.mjs";
|
|
60
|
+
import { PostgresDriver } from "./drivers/postgres/postgres-driver.mjs";
|
|
61
|
+
import { PostgresBlueprint } from "./drivers/postgres/postgres-blueprint.mjs";
|
|
62
|
+
import { PostgresMigrationDriver } from "./drivers/postgres/postgres-migration-driver.mjs";
|
|
63
|
+
import { PostgresQueryBuilder } from "./drivers/postgres/postgres-query-builder.mjs";
|
|
64
|
+
import { PostgresOperationType, PostgresParserOperation, PostgresParserOptions, PostgresQueryParser } from "./drivers/postgres/postgres-query-parser.mjs";
|
|
65
|
+
import { PostgresSyncAdapter } from "./drivers/postgres/postgres-sync-adapter.mjs";
|
|
66
|
+
import { MongoClientOptions, TransactionOptions } from "mongodb";
|
|
67
|
+
export { $agg, AggregateExpression, AggregateFunction, AlterSchema, type BaseQueryRuleOptions, type BaseUniqueRuleOptions, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToOptions, BuildUpdateOperationsResult, type ChildModel, ChunkCallback, ColumnBuilder, ColumnDefinition, ColumnMap, ColumnType, ConnectionOptions, CreateDatabaseOptions, CreateDatabaseResult, CursorPaginationOptions, CursorPaginationResult, DEFAULT_MAX_SYNC_DEPTH, DataSource, DataSourceOptions, DataSourceRegistryEvent, DataSourceRegistryListener, DatabaseDirtyTracker, DatabaseDriver, DatabaseRemover, DatabaseRestorer, DatabaseWriter, DatabaseWriterValidationError, DefineModelOptions, DeleteStrategy, DetachedColumnBuilder, DriverContract, DriverEvent, DriverEventListener, DriverQuery, DriverTransactionContract, DropAllTablesResult, DropDatabaseOptions, type EmbedKey, type ExistsRuleOptions, ExportMigrationsSQLOptions, ForeignKeyBuilder, ForeignKeyDefinition, FullTextIndexOptions, GenerateIdOptions, GeoIndexOptions, type GlobalScopeDefinition, type GlobalScopeOptions, GroupByInput, HasMany, type HasManyOptions, HasOne, type HasOneOptions, HavingInput, IdGeneratorContract, IndexDefinition, IndexEntry, InsertResult, JoinOptions, type LoadedRelationResult, type LoadedRelationsMap, type LocalScopeCallback, Migration, MigrationAlterOptions, MigrationConstructor, MigrationContract, MigrationCreateOptions, MigrationDefaults, MigrationDriverContract, MigrationDriverFactory, type MigrationRecord, type MigrationResult, MigrationRunner, type MigrationRunnerOptions, type MigrationStatus, MissingDataSourceError, Model, ModelDefaultConfig, ModelDefaults, ModelEventListener, ModelEventName, ModelEvents, ModelRef, type ModelSchema, type ModelSnapshot, type ModelSyncConfig, type ModelSyncContract, ModelSyncOperation, type ModelSyncOperationContract, ModelTransformCallback, ModelType, type MongoClientOptions, MongoDbDriver, MongoDriverOptions, MongoIdGenerator, MongoMigrationDriver, MongoQueryBuilder, MongoSyncAdapter, NamingConvention, OnDeletedEventContext, Operation, OperationType, OrderDirection, PaginationOptions, PaginationResult, type PendingMigration, PendingOperation, PipelineStage, type PivotData, type PivotIds, PivotOperations, PostgresBlueprint, PostgresConnectionConfig, PostgresCopyOptions, PostgresDialect, PostgresDriver, PostgresIsolationLevel, PostgresMigrationDriver, PostgresNotification, PostgresOperation, PostgresOperationType, PostgresParserOperation, PostgresParserOptions, PostgresPoolConfig, PostgresQueryBuilder, PostgresQueryParser, PostgresQueryResult, PostgresSyncAdapter, PostgresTransactionOptions, PostgresWhereClause, QueryBuilderContract, RELATION_METADATA_KEY, RawExpression, RegisterModel, RegisterModelOptions, type RelationConstraintCallback, type RelationConstraints, RelationDefaults, type RelationDefinition, type RelationDefinitions, RelationHydrator, RelationLoader, type RelationType, RemoverContract, RemoverOptions, RemoverResult, RestorerContract, RestorerOptions, RestorerResult, RollbackMigrationsOptions, type RollbackOptions, type RunMigrationsOptions, type ScopeTiming, type SerializedRelation, SqlAggregateFunction, SqlDeleteOperation, SqlDialectContract, SqlGroupClause, SqlHavingClause, SqlInsertOperation, SqlJoinClause, SqlJoinType, SqlOrderClause, SqlQueryConfig, SqlQueryResult, SqlSelectClause, SqlUpdateOperation, SqlWhereOperation, SqlWhereType, StrictMode, SyncAdapterContract, type SyncConfig, type SyncContext, SyncContextManager, type SyncEventPayload, SyncInstruction, type SyncInstructionOptions, SyncManager, type SyncResult, type TableIndexInformation, TransactionContext, type TransactionOptions, TransactionRollbackError, UniqueEntry, type UniqueRuleOptions, UpdateOperations, UpdateResult, UuidStrategy, VectorIndexOptions, WhereCallback, WhereObject, WhereOperator, WriterContract, WriterOptions, WriterResult, arrayBigInt, arrayBoolean, arrayDate, arrayDecimal, arrayFloat, arrayInt, arrayJson, arrayText, arrayTimestamp, arrayUuid, bigInt, bigInteger, binary, blobCol, boolCol as bool, boolCol, char, cleanupModelsRegistery, connectToDatabase, createDatabase, createPivotOperations, dataSourceRegistry, databaseDataSourceContext, databaseTransactionContext, date, dateTime, decimal, defineModel, double, dropAllTables, enumCol, exportMigrationsSQL, float, freshMigrate, geometry, getAllModelsFromRegistry, getDatabaseDriver, getModelFromRegistry, globalModelEvents, int, integer, ipAddress, isAggregateExpression, isMongoDBDriverLoaded, json, lineString, listExecutedMigrations, longText, macAddress, mediumText, migrate, migrationRunner, modelSync, objectCol, onceConnected, onceDisconnected, point, polygon, registerModelInRegistry, removeModelFromRegistery, resolveModelClass, resolveModelName, rollbackMigrations, runMigrations, setCol, smallInt, smallInteger, string, text, time, timestamp, tinyInt, tinyInteger, transaction, tryResolveModelClass, ulid, useModelTransformer, uuid, vector, verifyRegisteredRelations, year };
|
package/esm/index.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { databaseDataSourceContext } from "./context/database-data-source-context.mjs";
|
|
2
|
+
import { databaseTransactionContext } from "./context/database-transaction-context.mjs";
|
|
3
|
+
import { DataSource } from "./data-source/data-source.mjs";
|
|
4
|
+
import { MissingDataSourceError } from "./errors/missing-data-source.error.mjs";
|
|
5
|
+
import { dataSourceRegistry } from "./data-source/data-source-registry.mjs";
|
|
6
|
+
import { TransactionRollbackError } from "./errors/transaction-rollback.error.mjs";
|
|
7
|
+
import { DatabaseDirtyTracker } from "./database-dirty-tracker.mjs";
|
|
8
|
+
import { ModelEvents, globalModelEvents } from "./events/model-events.mjs";
|
|
9
|
+
import { BelongsTo, BelongsToMany, HasMany, HasOne, RELATION_METADATA_KEY } from "./model/relation-decorators.mjs";
|
|
10
|
+
import { RegisterModel, cleanupModelsRegistery, getAllModelsFromRegistry, getModelFromRegistry, registerModelInRegistry, removeModelFromRegistery, resolveModelClass, resolveModelName, tryResolveModelClass, verifyRegisteredRelations } from "./model/register-model.mjs";
|
|
11
|
+
import { RelationLoader } from "./relations/relation-loader.mjs";
|
|
12
|
+
import { DEFAULT_MAX_SYNC_DEPTH, SyncContextManager } from "./sync/sync-context.mjs";
|
|
13
|
+
import { SyncManager } from "./sync/sync-manager.mjs";
|
|
14
|
+
import { ModelSyncOperation } from "./sync/model-sync-operation.mjs";
|
|
15
|
+
import { modelSync } from "./sync/model-sync.mjs";
|
|
16
|
+
import { DatabaseRemover } from "./remover/database-remover.mjs";
|
|
17
|
+
import { RelationHydrator } from "./relations/relation-hydrator.mjs";
|
|
18
|
+
import { DatabaseWriterValidationError } from "./validation/database-writer-validation-error.mjs";
|
|
19
|
+
import "./validation/index.mjs";
|
|
20
|
+
import { DatabaseWriter } from "./writer/database-writer.mjs";
|
|
21
|
+
import { PivotOperations, createPivotOperations } from "./relations/pivot-operations.mjs";
|
|
22
|
+
import { DatabaseRestorer } from "./restorer/database-restorer.mjs";
|
|
23
|
+
import { Model } from "./model/model.mjs";
|
|
24
|
+
import "./relations/index.mjs";
|
|
25
|
+
import { $agg, isAggregateExpression } from "./expressions/aggregate-expressions.mjs";
|
|
26
|
+
import { MongoIdGenerator } from "./drivers/mongodb/mongodb-id-generator.mjs";
|
|
27
|
+
import { MongoMigrationDriver } from "./drivers/mongodb/mongodb-migration-driver.mjs";
|
|
28
|
+
import { MongoQueryBuilder } from "./drivers/mongodb/mongodb-query-builder.mjs";
|
|
29
|
+
import { MongoSyncAdapter } from "./drivers/mongodb/mongodb-sync-adapter.mjs";
|
|
30
|
+
import { MongoDbDriver, isMongoDBDriverLoaded } from "./drivers/mongodb/mongodb-driver.mjs";
|
|
31
|
+
import { PostgresBlueprint } from "./drivers/postgres/postgres-blueprint.mjs";
|
|
32
|
+
import { PostgresDialect } from "./drivers/postgres/postgres-dialect.mjs";
|
|
33
|
+
import { PostgresMigrationDriver } from "./drivers/postgres/postgres-migration-driver.mjs";
|
|
34
|
+
import { PostgresQueryParser } from "./drivers/postgres/postgres-query-parser.mjs";
|
|
35
|
+
import { PostgresQueryBuilder } from "./drivers/postgres/postgres-query-builder.mjs";
|
|
36
|
+
import { PostgresSyncAdapter } from "./drivers/postgres/postgres-sync-adapter.mjs";
|
|
37
|
+
import { PostgresDriver } from "./drivers/postgres/postgres-driver.mjs";
|
|
38
|
+
import "./drivers/postgres/index.mjs";
|
|
39
|
+
import { connectToDatabase, getDatabaseDriver, transaction } from "./utils/connect-to-database.mjs";
|
|
40
|
+
import { useModelTransformer } from "./utils/database-writer.utils.mjs";
|
|
41
|
+
import { defineModel } from "./utils/define-model.mjs";
|
|
42
|
+
import { onceConnected, onceDisconnected } from "./utils/once-connected.mjs";
|
|
43
|
+
import { ColumnBuilder } from "./migration/column-builder.mjs";
|
|
44
|
+
import { ForeignKeyBuilder } from "./migration/foreign-key-builder.mjs";
|
|
45
|
+
import { DetachedColumnBuilder, arrayBigInt, arrayBoolean, arrayDate, arrayDecimal, arrayFloat, arrayInt, arrayJson, arrayText, arrayTimestamp, arrayUuid, bigInt, bigInteger, binary, blobCol, boolCol, char, date, dateTime, decimal, double, enumCol, float, geometry, int, integer, ipAddress, json, lineString, longText, macAddress, mediumText, objectCol, point, polygon, setCol, smallInt, smallInteger, string, text, time, timestamp, tinyInt, tinyInteger, ulid, uuid, vector, year } from "./migration/column-helpers.mjs";
|
|
46
|
+
import { Migration, migrate } from "./migration/migration.mjs";
|
|
47
|
+
import { MigrationRunner, migrationRunner } from "./migration/migration-runner.mjs";
|
|
48
|
+
import "./migration/index.mjs";
|
|
49
|
+
import { createDatabase, dropAllTables } from "./operations/database.mjs";
|
|
50
|
+
import { exportMigrationsSQL, freshMigrate, listExecutedMigrations, rollbackMigrations, runMigrations } from "./operations/migrations.mjs";
|
|
51
|
+
import "./operations/index.mjs";
|
|
52
|
+
|
|
53
|
+
export { $agg, BelongsTo, BelongsToMany, ColumnBuilder, DEFAULT_MAX_SYNC_DEPTH, DataSource, DatabaseDirtyTracker, DatabaseRemover, DatabaseRestorer, DatabaseWriter, DatabaseWriterValidationError, DetachedColumnBuilder, ForeignKeyBuilder, HasMany, HasOne, Migration, MigrationRunner, MissingDataSourceError, Model, ModelEvents, ModelSyncOperation, MongoDbDriver, MongoIdGenerator, MongoMigrationDriver, MongoQueryBuilder, MongoSyncAdapter, PivotOperations, PostgresBlueprint, PostgresDialect, PostgresDriver, PostgresMigrationDriver, PostgresQueryBuilder, PostgresQueryParser, PostgresSyncAdapter, RELATION_METADATA_KEY, RegisterModel, RelationHydrator, RelationLoader, SyncContextManager, SyncManager, TransactionRollbackError, arrayBigInt, arrayBoolean, arrayDate, arrayDecimal, arrayFloat, arrayInt, arrayJson, arrayText, arrayTimestamp, arrayUuid, bigInt, bigInteger, binary, blobCol, boolCol as bool, boolCol, char, cleanupModelsRegistery, connectToDatabase, createDatabase, createPivotOperations, dataSourceRegistry, databaseDataSourceContext, databaseTransactionContext, date, dateTime, decimal, defineModel, double, dropAllTables, enumCol, exportMigrationsSQL, float, freshMigrate, geometry, getAllModelsFromRegistry, getDatabaseDriver, getModelFromRegistry, globalModelEvents, int, integer, ipAddress, isAggregateExpression, isMongoDBDriverLoaded, json, lineString, listExecutedMigrations, longText, macAddress, mediumText, migrate, migrationRunner, modelSync, objectCol, onceConnected, onceDisconnected, point, polygon, registerModelInRegistry, removeModelFromRegistery, resolveModelClass, resolveModelName, rollbackMigrations, runMigrations, setCol, smallInt, smallInteger, string, text, time, timestamp, tinyInt, tinyInteger, transaction, tryResolveModelClass, ulid, useModelTransformer, uuid, vector, verifyRegisteredRelations, year };
|