@warlock.js/cascade 4.0.48 → 4.0.59
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/cjs/context/database-data-source-context.d.ts +29 -0
- package/cjs/context/database-data-source-context.d.ts.map +1 -0
- package/cjs/context/database-data-source-context.js +28 -0
- package/cjs/context/database-data-source-context.js.map +1 -0
- package/cjs/context/database-transaction-context.d.ts +31 -0
- package/cjs/context/database-transaction-context.d.ts.map +1 -0
- package/cjs/context/database-transaction-context.js +34 -0
- package/cjs/context/database-transaction-context.js.map +1 -0
- package/cjs/contracts/database-driver.contract.d.ts +143 -0
- package/cjs/contracts/database-driver.contract.d.ts.map +1 -0
- package/cjs/contracts/database-id-generator.contract.d.ts +109 -0
- package/cjs/contracts/database-id-generator.contract.d.ts.map +1 -0
- package/cjs/contracts/database-remover.contract.d.ts +104 -0
- package/cjs/contracts/database-remover.contract.d.ts.map +1 -0
- package/cjs/contracts/database-restorer.contract.d.ts +143 -0
- package/cjs/contracts/database-restorer.contract.d.ts.map +1 -0
- package/cjs/contracts/database-writer.contract.d.ts +119 -0
- package/cjs/contracts/database-writer.contract.d.ts.map +1 -0
- package/cjs/contracts/driver-blueprint.contract.d.ts +45 -0
- package/cjs/contracts/driver-blueprint.contract.d.ts.map +1 -0
- package/cjs/contracts/index.d.ts +10 -0
- package/cjs/contracts/index.d.ts.map +1 -0
- package/cjs/contracts/migration-driver.contract.d.ts +365 -0
- package/cjs/contracts/migration-driver.contract.d.ts.map +1 -0
- package/cjs/contracts/query-builder.contract.d.ts +1128 -0
- package/cjs/contracts/query-builder.contract.d.ts.map +1 -0
- package/cjs/contracts/sync-adapter.contract.d.ts +58 -0
- package/cjs/contracts/sync-adapter.contract.d.ts.map +1 -0
- package/cjs/data-source/data-source-registry.d.ts +104 -0
- package/cjs/data-source/data-source-registry.d.ts.map +1 -0
- package/cjs/data-source/data-source-registry.js +138 -0
- package/cjs/data-source/data-source-registry.js.map +1 -0
- package/cjs/data-source/data-source.d.ts +106 -0
- package/cjs/data-source/data-source.d.ts.map +1 -0
- package/cjs/data-source/data-source.js +77 -0
- package/cjs/data-source/data-source.js.map +1 -0
- package/cjs/database-dirty-tracker.d.ts +253 -0
- package/cjs/database-dirty-tracker.d.ts.map +1 -0
- package/cjs/database-dirty-tracker.js +389 -0
- package/cjs/database-dirty-tracker.js.map +1 -0
- package/cjs/drivers/mongo/mongo-id-generator.d.ts +116 -0
- package/cjs/drivers/mongo/mongo-id-generator.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-id-generator.js +149 -0
- package/cjs/drivers/mongo/mongo-id-generator.js.map +1 -0
- package/cjs/drivers/mongo/mongo-migration-driver.d.ts +228 -0
- package/cjs/drivers/mongo/mongo-migration-driver.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-migration-driver.js +524 -0
- package/cjs/drivers/mongo/mongo-migration-driver.js.map +1 -0
- package/cjs/drivers/mongo/mongo-query-builder.d.ts +922 -0
- package/cjs/drivers/mongo/mongo-query-builder.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-query-builder.js +1740 -0
- package/cjs/drivers/mongo/mongo-query-builder.js.map +1 -0
- package/cjs/drivers/mongo/mongo-query-operations.d.ts +226 -0
- package/cjs/drivers/mongo/mongo-query-operations.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-query-operations.js +270 -0
- package/cjs/drivers/mongo/mongo-query-operations.js.map +1 -0
- package/cjs/drivers/mongo/mongo-query-parser.d.ts +262 -0
- package/cjs/drivers/mongo/mongo-query-parser.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-query-parser.js +1351 -0
- package/cjs/drivers/mongo/mongo-query-parser.js.map +1 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.d.ts +79 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.js +146 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.js.map +1 -0
- package/cjs/drivers/mongo/mongodb-blueprint.d.ts +30 -0
- package/cjs/drivers/mongo/mongodb-blueprint.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongodb-blueprint.js +51 -0
- package/cjs/drivers/mongo/mongodb-blueprint.js.map +1 -0
- package/cjs/drivers/mongo/mongodb-driver.d.ts +188 -0
- package/cjs/drivers/mongo/mongodb-driver.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongodb-driver.js +411 -0
- package/cjs/drivers/mongo/mongodb-driver.js.map +1 -0
- package/cjs/drivers/mongo/types.d.ts +43 -0
- package/cjs/drivers/mongo/types.d.ts.map +1 -0
- package/cjs/errors/missing-data-source.error.d.ts +22 -0
- package/cjs/errors/missing-data-source.error.d.ts.map +1 -0
- package/cjs/errors/missing-data-source.error.js +29 -0
- package/cjs/errors/missing-data-source.error.js.map +1 -0
- package/cjs/events/model-events.d.ts +231 -0
- package/cjs/events/model-events.d.ts.map +1 -0
- package/cjs/events/model-events.js +259 -0
- package/cjs/events/model-events.js.map +1 -0
- package/cjs/expressions/aggregate-expressions.d.ts +215 -0
- package/cjs/expressions/aggregate-expressions.d.ts.map +1 -0
- package/cjs/expressions/aggregate-expressions.js +221 -0
- package/cjs/expressions/aggregate-expressions.js.map +1 -0
- package/cjs/expressions/index.d.ts +2 -0
- package/cjs/expressions/index.d.ts.map +1 -0
- package/cjs/index.d.ts +41 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +1 -267
- package/cjs/index.js.map +1 -1
- package/cjs/migration/column-builder.d.ts +167 -0
- package/cjs/migration/column-builder.d.ts.map +1 -0
- package/cjs/migration/column-builder.js +217 -0
- package/cjs/migration/column-builder.js.map +1 -0
- package/cjs/migration/foreign-key-builder.d.ts +110 -0
- package/cjs/migration/foreign-key-builder.d.ts.map +1 -0
- package/cjs/migration/foreign-key-builder.js +129 -0
- package/cjs/migration/foreign-key-builder.js.map +1 -0
- package/cjs/migration/index.d.ts +6 -0
- package/cjs/migration/index.d.ts.map +1 -0
- package/cjs/migration/migration-runner.d.ts +231 -0
- package/cjs/migration/migration-runner.d.ts.map +1 -0
- package/cjs/migration/migration-runner.js +443 -0
- package/cjs/migration/migration-runner.js.map +1 -0
- package/cjs/migration/migration.js +1346 -0
- package/cjs/migration/migration.js.map +1 -0
- package/cjs/migration/types.d.ts +132 -0
- package/cjs/migration/types.d.ts.map +1 -0
- package/cjs/model/model.d.ts +1267 -0
- package/cjs/model/model.d.ts.map +1 -0
- package/cjs/model/model.js +1463 -0
- package/cjs/model/model.js.map +1 -0
- package/cjs/model/register-model.d.ts +80 -0
- package/cjs/model/register-model.d.ts.map +1 -0
- package/cjs/model/register-model.js +91 -0
- package/cjs/model/register-model.js.map +1 -0
- package/cjs/remover/database-remover.d.ts +100 -0
- package/cjs/remover/database-remover.d.ts.map +1 -0
- package/cjs/remover/database-remover.js +209 -0
- package/cjs/remover/database-remover.js.map +1 -0
- package/cjs/restorer/database-restorer.d.ts +131 -0
- package/cjs/restorer/database-restorer.d.ts.map +1 -0
- package/cjs/restorer/database-restorer.js +425 -0
- package/cjs/restorer/database-restorer.js.map +1 -0
- package/cjs/sync/index.d.ts +12 -0
- package/cjs/sync/index.d.ts.map +1 -0
- package/cjs/sync/model-events.d.ts +62 -0
- package/cjs/sync/model-events.d.ts.map +1 -0
- package/cjs/sync/model-events.js +49 -0
- package/cjs/sync/model-events.js.map +1 -0
- package/cjs/sync/model-sync-operation.d.ts +163 -0
- package/cjs/sync/model-sync-operation.d.ts.map +1 -0
- package/cjs/sync/model-sync-operation.js +292 -0
- package/cjs/sync/model-sync-operation.js.map +1 -0
- package/cjs/sync/model-sync.d.ts +130 -0
- package/cjs/sync/model-sync.d.ts.map +1 -0
- package/cjs/sync/model-sync.js +178 -0
- package/cjs/sync/model-sync.js.map +1 -0
- package/cjs/sync/sync-context.d.ts +70 -0
- package/cjs/sync/sync-context.d.ts.map +1 -0
- package/cjs/sync/sync-context.js +101 -0
- package/cjs/sync/sync-context.js.map +1 -0
- package/cjs/sync/sync-manager.d.ts +213 -0
- package/cjs/sync/sync-manager.d.ts.map +1 -0
- package/cjs/sync/sync-manager.js +689 -0
- package/cjs/sync/sync-manager.js.map +1 -0
- package/cjs/sync/types.d.ts +289 -0
- package/cjs/sync/types.d.ts.map +1 -0
- package/cjs/types.d.ts +45 -0
- package/cjs/types.d.ts.map +1 -0
- package/cjs/utils/connect-to-database.d.ts +246 -0
- package/cjs/utils/connect-to-database.d.ts.map +1 -0
- package/cjs/utils/connect-to-database.js +92 -0
- package/cjs/utils/connect-to-database.js.map +1 -0
- package/cjs/utils/database-writer.utils.d.ts +15 -0
- package/cjs/utils/database-writer.utils.d.ts.map +1 -0
- package/cjs/utils/database-writer.utils.js +14 -0
- package/cjs/utils/database-writer.utils.js.map +1 -0
- package/cjs/utils/define-model.js +100 -0
- package/cjs/utils/define-model.js.map +1 -0
- package/cjs/utils/once-connected.d.ts +146 -0
- package/cjs/utils/once-connected.d.ts.map +1 -0
- package/cjs/utils/once-connected.js +252 -0
- package/cjs/utils/once-connected.js.map +1 -0
- package/cjs/validation/database-seal-plugins.d.ts +2 -0
- package/cjs/validation/database-seal-plugins.d.ts.map +1 -0
- package/cjs/validation/database-seal-plugins.js +4 -0
- package/cjs/validation/database-seal-plugins.js.map +1 -0
- package/cjs/validation/database-writer-validation-error.d.ts +97 -0
- package/cjs/validation/database-writer-validation-error.d.ts.map +1 -0
- package/cjs/validation/database-writer-validation-error.js +160 -0
- package/cjs/validation/database-writer-validation-error.js.map +1 -0
- package/cjs/validation/index.d.ts +3 -0
- package/cjs/validation/index.d.ts.map +1 -0
- package/cjs/validation/mutators/embed-mutator.d.ts +9 -0
- package/cjs/validation/mutators/embed-mutator.d.ts.map +1 -0
- package/cjs/validation/mutators/embed-mutator.js +33 -0
- package/cjs/validation/mutators/embed-mutator.js.map +1 -0
- package/cjs/validation/plugins/embed-validator-plugin.d.ts +24 -0
- package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +1 -0
- package/cjs/validation/plugins/embed-validator-plugin.js +18 -0
- package/cjs/validation/plugins/embed-validator-plugin.js.map +1 -0
- package/cjs/validation/rules/database-model-rule.d.ts +7 -0
- package/cjs/validation/rules/database-model-rule.d.ts.map +1 -0
- package/cjs/validation/rules/database-model-rule.js +27 -0
- package/cjs/validation/rules/database-model-rule.js.map +1 -0
- package/cjs/validation/transformers/embed-model-transformer.d.ts +3 -0
- package/cjs/validation/transformers/embed-model-transformer.d.ts.map +1 -0
- package/cjs/validation/transformers/embed-model-transformer.js +18 -0
- package/cjs/validation/transformers/embed-model-transformer.js.map +1 -0
- package/cjs/validation/validators/embed-validator.d.ts +21 -0
- package/cjs/validation/validators/embed-validator.d.ts.map +1 -0
- package/cjs/validation/validators/embed-validator.js +42 -0
- package/cjs/validation/validators/embed-validator.js.map +1 -0
- package/cjs/writer/database-writer.d.ts +181 -0
- package/cjs/writer/database-writer.d.ts.map +1 -0
- package/cjs/writer/database-writer.js +402 -0
- package/cjs/writer/database-writer.js.map +1 -0
- package/esm/context/database-data-source-context.d.ts +29 -0
- package/esm/context/database-data-source-context.d.ts.map +1 -0
- package/esm/context/database-data-source-context.js +28 -0
- package/esm/context/database-data-source-context.js.map +1 -0
- package/esm/context/database-transaction-context.d.ts +31 -0
- package/esm/context/database-transaction-context.d.ts.map +1 -0
- package/esm/context/database-transaction-context.js +34 -0
- package/esm/context/database-transaction-context.js.map +1 -0
- package/esm/contracts/database-driver.contract.d.ts +143 -0
- package/esm/contracts/database-driver.contract.d.ts.map +1 -0
- package/esm/contracts/database-id-generator.contract.d.ts +109 -0
- package/esm/contracts/database-id-generator.contract.d.ts.map +1 -0
- package/esm/contracts/database-remover.contract.d.ts +104 -0
- package/esm/contracts/database-remover.contract.d.ts.map +1 -0
- package/esm/contracts/database-restorer.contract.d.ts +143 -0
- package/esm/contracts/database-restorer.contract.d.ts.map +1 -0
- package/esm/contracts/database-writer.contract.d.ts +119 -0
- package/esm/contracts/database-writer.contract.d.ts.map +1 -0
- package/esm/contracts/driver-blueprint.contract.d.ts +45 -0
- package/esm/contracts/driver-blueprint.contract.d.ts.map +1 -0
- package/esm/contracts/index.d.ts +10 -0
- package/esm/contracts/index.d.ts.map +1 -0
- package/esm/contracts/migration-driver.contract.d.ts +365 -0
- package/esm/contracts/migration-driver.contract.d.ts.map +1 -0
- package/esm/contracts/query-builder.contract.d.ts +1128 -0
- package/esm/contracts/query-builder.contract.d.ts.map +1 -0
- package/esm/contracts/sync-adapter.contract.d.ts +58 -0
- package/esm/contracts/sync-adapter.contract.d.ts.map +1 -0
- package/esm/data-source/data-source-registry.d.ts +104 -0
- package/esm/data-source/data-source-registry.d.ts.map +1 -0
- package/esm/data-source/data-source-registry.js +138 -0
- package/esm/data-source/data-source-registry.js.map +1 -0
- package/esm/data-source/data-source.d.ts +106 -0
- package/esm/data-source/data-source.d.ts.map +1 -0
- package/esm/data-source/data-source.js +77 -0
- package/esm/data-source/data-source.js.map +1 -0
- package/esm/database-dirty-tracker.d.ts +253 -0
- package/esm/database-dirty-tracker.d.ts.map +1 -0
- package/esm/database-dirty-tracker.js +389 -0
- package/esm/database-dirty-tracker.js.map +1 -0
- package/esm/drivers/mongo/mongo-id-generator.d.ts +116 -0
- package/esm/drivers/mongo/mongo-id-generator.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-id-generator.js +149 -0
- package/esm/drivers/mongo/mongo-id-generator.js.map +1 -0
- package/esm/drivers/mongo/mongo-migration-driver.d.ts +228 -0
- package/esm/drivers/mongo/mongo-migration-driver.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-migration-driver.js +524 -0
- package/esm/drivers/mongo/mongo-migration-driver.js.map +1 -0
- package/esm/drivers/mongo/mongo-query-builder.d.ts +922 -0
- package/esm/drivers/mongo/mongo-query-builder.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-query-builder.js +1740 -0
- package/esm/drivers/mongo/mongo-query-builder.js.map +1 -0
- package/esm/drivers/mongo/mongo-query-operations.d.ts +226 -0
- package/esm/drivers/mongo/mongo-query-operations.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-query-operations.js +270 -0
- package/esm/drivers/mongo/mongo-query-operations.js.map +1 -0
- package/esm/drivers/mongo/mongo-query-parser.d.ts +262 -0
- package/esm/drivers/mongo/mongo-query-parser.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-query-parser.js +1351 -0
- package/esm/drivers/mongo/mongo-query-parser.js.map +1 -0
- package/esm/drivers/mongo/mongo-sync-adapter.d.ts +79 -0
- package/esm/drivers/mongo/mongo-sync-adapter.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-sync-adapter.js +146 -0
- package/esm/drivers/mongo/mongo-sync-adapter.js.map +1 -0
- package/esm/drivers/mongo/mongodb-blueprint.d.ts +30 -0
- package/esm/drivers/mongo/mongodb-blueprint.d.ts.map +1 -0
- package/esm/drivers/mongo/mongodb-blueprint.js +51 -0
- package/esm/drivers/mongo/mongodb-blueprint.js.map +1 -0
- package/esm/drivers/mongo/mongodb-driver.d.ts +188 -0
- package/esm/drivers/mongo/mongodb-driver.d.ts.map +1 -0
- package/esm/drivers/mongo/mongodb-driver.js +411 -0
- package/esm/drivers/mongo/mongodb-driver.js.map +1 -0
- package/esm/drivers/mongo/types.d.ts +43 -0
- package/esm/drivers/mongo/types.d.ts.map +1 -0
- package/esm/errors/missing-data-source.error.d.ts +22 -0
- package/esm/errors/missing-data-source.error.d.ts.map +1 -0
- package/esm/errors/missing-data-source.error.js +29 -0
- package/esm/errors/missing-data-source.error.js.map +1 -0
- package/esm/events/model-events.d.ts +231 -0
- package/esm/events/model-events.d.ts.map +1 -0
- package/esm/events/model-events.js +259 -0
- package/esm/events/model-events.js.map +1 -0
- package/esm/expressions/aggregate-expressions.d.ts +215 -0
- package/esm/expressions/aggregate-expressions.d.ts.map +1 -0
- package/esm/expressions/aggregate-expressions.js +221 -0
- package/esm/expressions/aggregate-expressions.js.map +1 -0
- package/esm/expressions/index.d.ts +2 -0
- package/esm/expressions/index.d.ts.map +1 -0
- package/esm/index.d.ts +41 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +1 -40
- package/esm/index.js.map +1 -1
- package/esm/migration/column-builder.d.ts +167 -0
- package/esm/migration/column-builder.d.ts.map +1 -0
- package/esm/migration/column-builder.js +217 -0
- package/esm/migration/column-builder.js.map +1 -0
- package/esm/migration/foreign-key-builder.d.ts +110 -0
- package/esm/migration/foreign-key-builder.d.ts.map +1 -0
- package/esm/migration/foreign-key-builder.js +129 -0
- package/esm/migration/foreign-key-builder.js.map +1 -0
- package/esm/migration/index.d.ts +6 -0
- package/esm/migration/index.d.ts.map +1 -0
- package/esm/migration/migration-runner.d.ts +231 -0
- package/esm/migration/migration-runner.d.ts.map +1 -0
- package/esm/migration/migration-runner.js +443 -0
- package/esm/migration/migration-runner.js.map +1 -0
- package/esm/migration/migration.js +1346 -0
- package/esm/migration/migration.js.map +1 -0
- package/esm/migration/types.d.ts +132 -0
- package/esm/migration/types.d.ts.map +1 -0
- package/esm/model/model.d.ts +1267 -0
- package/esm/model/model.d.ts.map +1 -0
- package/esm/model/model.js +1463 -0
- package/esm/model/model.js.map +1 -0
- package/esm/model/register-model.d.ts +80 -0
- package/esm/model/register-model.d.ts.map +1 -0
- package/esm/model/register-model.js +91 -0
- package/esm/model/register-model.js.map +1 -0
- package/esm/remover/database-remover.d.ts +100 -0
- package/esm/remover/database-remover.d.ts.map +1 -0
- package/esm/remover/database-remover.js +209 -0
- package/esm/remover/database-remover.js.map +1 -0
- package/esm/restorer/database-restorer.d.ts +131 -0
- package/esm/restorer/database-restorer.d.ts.map +1 -0
- package/esm/restorer/database-restorer.js +425 -0
- package/esm/restorer/database-restorer.js.map +1 -0
- package/esm/sync/index.d.ts +12 -0
- package/esm/sync/index.d.ts.map +1 -0
- package/esm/sync/model-events.d.ts +62 -0
- package/esm/sync/model-events.d.ts.map +1 -0
- package/esm/sync/model-events.js +49 -0
- package/esm/sync/model-events.js.map +1 -0
- package/esm/sync/model-sync-operation.d.ts +163 -0
- package/esm/sync/model-sync-operation.d.ts.map +1 -0
- package/esm/sync/model-sync-operation.js +292 -0
- package/esm/sync/model-sync-operation.js.map +1 -0
- package/esm/sync/model-sync.d.ts +130 -0
- package/esm/sync/model-sync.d.ts.map +1 -0
- package/esm/sync/model-sync.js +178 -0
- package/esm/sync/model-sync.js.map +1 -0
- package/esm/sync/sync-context.d.ts +70 -0
- package/esm/sync/sync-context.d.ts.map +1 -0
- package/esm/sync/sync-context.js +101 -0
- package/esm/sync/sync-context.js.map +1 -0
- package/esm/sync/sync-manager.d.ts +213 -0
- package/esm/sync/sync-manager.d.ts.map +1 -0
- package/esm/sync/sync-manager.js +689 -0
- package/esm/sync/sync-manager.js.map +1 -0
- package/esm/sync/types.d.ts +289 -0
- package/esm/sync/types.d.ts.map +1 -0
- package/esm/types.d.ts +45 -0
- package/esm/types.d.ts.map +1 -0
- package/esm/utils/connect-to-database.d.ts +246 -0
- package/esm/utils/connect-to-database.d.ts.map +1 -0
- package/esm/utils/connect-to-database.js +92 -0
- package/esm/utils/connect-to-database.js.map +1 -0
- package/esm/utils/database-writer.utils.d.ts +15 -0
- package/esm/utils/database-writer.utils.d.ts.map +1 -0
- package/esm/utils/database-writer.utils.js +14 -0
- package/esm/utils/database-writer.utils.js.map +1 -0
- package/esm/utils/define-model.js +100 -0
- package/esm/utils/define-model.js.map +1 -0
- package/esm/utils/once-connected.d.ts +146 -0
- package/esm/utils/once-connected.d.ts.map +1 -0
- package/esm/utils/once-connected.js +252 -0
- package/esm/utils/once-connected.js.map +1 -0
- package/esm/validation/database-seal-plugins.d.ts +2 -0
- package/esm/validation/database-seal-plugins.d.ts.map +1 -0
- package/esm/validation/database-seal-plugins.js +4 -0
- package/esm/validation/database-seal-plugins.js.map +1 -0
- package/esm/validation/database-writer-validation-error.d.ts +97 -0
- package/esm/validation/database-writer-validation-error.d.ts.map +1 -0
- package/esm/validation/database-writer-validation-error.js +160 -0
- package/esm/validation/database-writer-validation-error.js.map +1 -0
- package/esm/validation/index.d.ts +3 -0
- package/esm/validation/index.d.ts.map +1 -0
- package/esm/validation/mutators/embed-mutator.d.ts +9 -0
- package/esm/validation/mutators/embed-mutator.d.ts.map +1 -0
- package/esm/validation/mutators/embed-mutator.js +33 -0
- package/esm/validation/mutators/embed-mutator.js.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.d.ts +24 -0
- package/esm/validation/plugins/embed-validator-plugin.d.ts.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.js +18 -0
- package/esm/validation/plugins/embed-validator-plugin.js.map +1 -0
- package/esm/validation/rules/database-model-rule.d.ts +7 -0
- package/esm/validation/rules/database-model-rule.d.ts.map +1 -0
- package/esm/validation/rules/database-model-rule.js +27 -0
- package/esm/validation/rules/database-model-rule.js.map +1 -0
- package/esm/validation/transformers/embed-model-transformer.d.ts +3 -0
- package/esm/validation/transformers/embed-model-transformer.d.ts.map +1 -0
- package/esm/validation/transformers/embed-model-transformer.js +18 -0
- package/esm/validation/transformers/embed-model-transformer.js.map +1 -0
- package/esm/validation/validators/embed-validator.d.ts +21 -0
- package/esm/validation/validators/embed-validator.d.ts.map +1 -0
- package/esm/validation/validators/embed-validator.js +42 -0
- package/esm/validation/validators/embed-validator.js.map +1 -0
- package/esm/writer/database-writer.d.ts +181 -0
- package/esm/writer/database-writer.d.ts.map +1 -0
- package/esm/writer/database-writer.js +402 -0
- package/esm/writer/database-writer.js.map +1 -0
- package/package.json +61 -52
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { GenerateIdOptions, IdGeneratorContract } from "../../contracts";
|
|
2
|
+
import type { MongoDbDriver } from "./mongodb-driver";
|
|
3
|
+
/**
|
|
4
|
+
* MongoDB-specific ID generator for auto-incrementing integer IDs.
|
|
5
|
+
*
|
|
6
|
+
* Maintains a separate collection that tracks the last generated ID for each table.
|
|
7
|
+
* Generates auto-incrementing IDs similar to SQL's AUTO_INCREMENT feature.
|
|
8
|
+
*
|
|
9
|
+
* **Collection Structure:**
|
|
10
|
+
* ```json
|
|
11
|
+
* {
|
|
12
|
+
* "collection": "users",
|
|
13
|
+
* "id": 12345
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* **Features:**
|
|
18
|
+
* - Atomic ID generation using findOneAndUpdate with aggregation pipeline
|
|
19
|
+
* - Automatic transaction support (driver handles session context)
|
|
20
|
+
* - Configurable initial ID and increment values
|
|
21
|
+
* - Thread-safe and concurrent-safe
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const mongoDriver = new MongoDbDriver(config);
|
|
26
|
+
* const idGenerator = new MongoIdGenerator(mongoDriver);
|
|
27
|
+
*
|
|
28
|
+
* const dataSource = new DataSource({
|
|
29
|
+
* name: "primary",
|
|
30
|
+
* driver: mongoDriver,
|
|
31
|
+
* idGenerator,
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Generate IDs with custom configuration
|
|
35
|
+
* const id = await idGenerator.generateNextId({
|
|
36
|
+
* table: "users",
|
|
37
|
+
* initialId: 1000,
|
|
38
|
+
* incrementIdBy: 1
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class MongoIdGenerator implements IdGeneratorContract {
|
|
43
|
+
private readonly driver;
|
|
44
|
+
/**
|
|
45
|
+
* The collection name that stores ID counters.
|
|
46
|
+
* Each document tracks the last ID for a specific table.
|
|
47
|
+
*
|
|
48
|
+
* Named "MasterMind" for backward compatibility with legacy Cascade.
|
|
49
|
+
*/
|
|
50
|
+
readonly counterCollection: string;
|
|
51
|
+
/**
|
|
52
|
+
* Create a new MongoDB ID generator instance.
|
|
53
|
+
*
|
|
54
|
+
* @param driver - The MongoDB driver instance
|
|
55
|
+
* @param counterCollection - Name of the collection storing ID counters (default: "MasterMind")
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const idGenerator = new MongoIdGenerator(mongoDriver, "id_counters");
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
constructor(driver: MongoDbDriver, counterCollection?: string);
|
|
63
|
+
/**
|
|
64
|
+
* Generate the next ID for a table.
|
|
65
|
+
*
|
|
66
|
+
* Uses atomic findOneAndUpdate with aggregation pipeline to ensure uniqueness
|
|
67
|
+
* even in concurrent scenarios. Automatically participates in active transactions.
|
|
68
|
+
*
|
|
69
|
+
* @param options - Configuration for ID generation
|
|
70
|
+
* @returns The generated ID
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* // Simple usage
|
|
75
|
+
* const id = await idGenerator.generateNextId({ table: "users" });
|
|
76
|
+
*
|
|
77
|
+
* // With custom initial ID
|
|
78
|
+
* const id = await idGenerator.generateNextId({
|
|
79
|
+
* table: "products",
|
|
80
|
+
* initialId: 1000,
|
|
81
|
+
* incrementIdBy: 1
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
generateNextId(options: GenerateIdOptions): Promise<number>;
|
|
86
|
+
/**
|
|
87
|
+
* Get the last generated ID for a table.
|
|
88
|
+
*
|
|
89
|
+
* @param table - The table/collection name
|
|
90
|
+
* @returns The last generated ID, or 0 if none exists
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const lastId = await idGenerator.getLastId("users");
|
|
95
|
+
* console.log(`Last user ID: ${lastId}`);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
getLastId(table: string): Promise<number>;
|
|
99
|
+
/**
|
|
100
|
+
* Set the last ID for a table.
|
|
101
|
+
*
|
|
102
|
+
* Creates or updates the counter document for the specified table.
|
|
103
|
+
* Useful for seeding or resetting ID sequences.
|
|
104
|
+
*
|
|
105
|
+
* @param table - The table/collection name
|
|
106
|
+
* @param id - The ID to set as the last generated ID
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* // Reset user IDs to start from 1000
|
|
111
|
+
* await idGenerator.setLastId("users", 1000);
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
setLastId(table: string, id: number): Promise<void>;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=mongo-id-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-id-generator.d.ts","sourceRoot":"","sources":["../../../src/drivers/mongo/mongo-id-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,gBAAiB,YAAW,mBAAmB;IAqBxD,OAAO,CAAC,QAAQ,CAAC,MAAM;IApBzB;;;;;OAKG;IACH,SAAgB,iBAAiB,EAAE,MAAM,CAAgB;IAEzD;;;;;;;;;;OAUG;gBAEgB,MAAM,EAAE,aAAa,EACtC,iBAAiB,CAAC,EAAE,MAAM;IAO5B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACU,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAkCxE;;;;;;;;;;;OAWG;IACU,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMtD;;;;;;;;;;;;;;OAcG;IACU,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQjE"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use strict';/**
|
|
2
|
+
* MongoDB-specific ID generator for auto-incrementing integer IDs.
|
|
3
|
+
*
|
|
4
|
+
* Maintains a separate collection that tracks the last generated ID for each table.
|
|
5
|
+
* Generates auto-incrementing IDs similar to SQL's AUTO_INCREMENT feature.
|
|
6
|
+
*
|
|
7
|
+
* **Collection Structure:**
|
|
8
|
+
* ```json
|
|
9
|
+
* {
|
|
10
|
+
* "collection": "users",
|
|
11
|
+
* "id": 12345
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* **Features:**
|
|
16
|
+
* - Atomic ID generation using findOneAndUpdate with aggregation pipeline
|
|
17
|
+
* - Automatic transaction support (driver handles session context)
|
|
18
|
+
* - Configurable initial ID and increment values
|
|
19
|
+
* - Thread-safe and concurrent-safe
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const mongoDriver = new MongoDbDriver(config);
|
|
24
|
+
* const idGenerator = new MongoIdGenerator(mongoDriver);
|
|
25
|
+
*
|
|
26
|
+
* const dataSource = new DataSource({
|
|
27
|
+
* name: "primary",
|
|
28
|
+
* driver: mongoDriver,
|
|
29
|
+
* idGenerator,
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Generate IDs with custom configuration
|
|
33
|
+
* const id = await idGenerator.generateNextId({
|
|
34
|
+
* table: "users",
|
|
35
|
+
* initialId: 1000,
|
|
36
|
+
* incrementIdBy: 1
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class MongoIdGenerator {
|
|
41
|
+
driver;
|
|
42
|
+
/**
|
|
43
|
+
* The collection name that stores ID counters.
|
|
44
|
+
* Each document tracks the last ID for a specific table.
|
|
45
|
+
*
|
|
46
|
+
* Named "MasterMind" for backward compatibility with legacy Cascade.
|
|
47
|
+
*/
|
|
48
|
+
counterCollection = "MasterMind";
|
|
49
|
+
/**
|
|
50
|
+
* Create a new MongoDB ID generator instance.
|
|
51
|
+
*
|
|
52
|
+
* @param driver - The MongoDB driver instance
|
|
53
|
+
* @param counterCollection - Name of the collection storing ID counters (default: "MasterMind")
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const idGenerator = new MongoIdGenerator(mongoDriver, "id_counters");
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
constructor(driver, counterCollection) {
|
|
61
|
+
this.driver = driver;
|
|
62
|
+
if (counterCollection) {
|
|
63
|
+
this.counterCollection = counterCollection;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generate the next ID for a table.
|
|
68
|
+
*
|
|
69
|
+
* Uses atomic findOneAndUpdate with aggregation pipeline to ensure uniqueness
|
|
70
|
+
* even in concurrent scenarios. Automatically participates in active transactions.
|
|
71
|
+
*
|
|
72
|
+
* @param options - Configuration for ID generation
|
|
73
|
+
* @returns The generated ID
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* // Simple usage
|
|
78
|
+
* const id = await idGenerator.generateNextId({ table: "users" });
|
|
79
|
+
*
|
|
80
|
+
* // With custom initial ID
|
|
81
|
+
* const id = await idGenerator.generateNextId({
|
|
82
|
+
* table: "products",
|
|
83
|
+
* initialId: 1000,
|
|
84
|
+
* incrementIdBy: 1
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
async generateNextId(options) {
|
|
89
|
+
const { table, initialId = 1, incrementIdBy = 1 } = options;
|
|
90
|
+
// Get the MongoDB database instance
|
|
91
|
+
const database = this.driver.getDatabase();
|
|
92
|
+
const collection = database.collection(this.counterCollection);
|
|
93
|
+
// Use atomic findOneAndUpdate with aggregation pipeline
|
|
94
|
+
// The driver's withSession method will automatically attach the session if in a transaction
|
|
95
|
+
const result = await collection.findOneAndUpdate({ collection: table }, [
|
|
96
|
+
{
|
|
97
|
+
$set: {
|
|
98
|
+
id: {
|
|
99
|
+
$cond: {
|
|
100
|
+
if: { $or: [{ $eq: ["$id", null] }, { $not: "$id" }] },
|
|
101
|
+
then: initialId,
|
|
102
|
+
else: { $add: ["$id", incrementIdBy] },
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
collection: table,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
], {
|
|
109
|
+
upsert: true,
|
|
110
|
+
returnDocument: "after",
|
|
111
|
+
});
|
|
112
|
+
return result?.id ?? initialId;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get the last generated ID for a table.
|
|
116
|
+
*
|
|
117
|
+
* @param table - The table/collection name
|
|
118
|
+
* @returns The last generated ID, or 0 if none exists
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const lastId = await idGenerator.getLastId("users");
|
|
123
|
+
* console.log(`Last user ID: ${lastId}`);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
async getLastId(table) {
|
|
127
|
+
const query = this.driver.queryBuilder(this.counterCollection);
|
|
128
|
+
const doc = (await query.where("collection", table).first());
|
|
129
|
+
return doc?.id ?? 0;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Set the last ID for a table.
|
|
133
|
+
*
|
|
134
|
+
* Creates or updates the counter document for the specified table.
|
|
135
|
+
* Useful for seeding or resetting ID sequences.
|
|
136
|
+
*
|
|
137
|
+
* @param table - The table/collection name
|
|
138
|
+
* @param id - The ID to set as the last generated ID
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* // Reset user IDs to start from 1000
|
|
143
|
+
* await idGenerator.setLastId("users", 1000);
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
async setLastId(table, id) {
|
|
147
|
+
await this.driver.update(this.counterCollection, { collection: table }, { $set: { id, collection: table } }, { upsert: true });
|
|
148
|
+
}
|
|
149
|
+
}exports.MongoIdGenerator=MongoIdGenerator;//# sourceMappingURL=mongo-id-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-id-generator.js","sources":["../../../src/drivers/mongo/mongo-id-generator.ts"],"sourcesContent":[null],"names":[],"mappings":"aA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EAAE,IAAI;AACZ,YAAA,cAAc,EAAE,OAAO;AACxB,SAAA,CACF,CAAC;AAEF,QAAA,OAAO,MAAM,EAAE,EAAE,IAAI,SAAS,CAAC;KAChC;AAED;;;;;;;;;;;AAWG;IACI,MAAM,SAAS,CAAC,KAAa,EAAA;AAClC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC/D,QAAA,MAAM,GAAG,IAAI,MAAM,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAmC,CAAC;AAC/F,QAAA,OAAQ,GAAG,EAAE,EAAa,IAAI,CAAC,CAAC;KACjC;AAED;;;;;;;;;;;;;;AAcG;AACI,IAAA,MAAM,SAAS,CAAC,KAAa,EAAE,EAAU,EAAA;AAC9C,QAAA,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACtB,IAAI,CAAC,iBAAiB,EACtB,EAAE,UAAU,EAAE,KAAK,EAAE,EACrB,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EACnC,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAC;KACH;AACF"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { ColumnDefinition, ForeignKeyDefinition, FullTextIndexOptions, GeoIndexOptions, IndexDefinition, MigrationDriverContract, VectorIndexOptions } from "../../contracts/migration-driver.contract";
|
|
2
|
+
import type { MongoDbDriver } from "./mongodb-driver";
|
|
3
|
+
/**
|
|
4
|
+
* MongoDB-specific migration driver implementation.
|
|
5
|
+
*
|
|
6
|
+
* Key behaviors:
|
|
7
|
+
* - Column operations are **no-ops** (MongoDB is schema-less)
|
|
8
|
+
* - Index operations use native `createIndex()`
|
|
9
|
+
* - Foreign keys are **no-ops** (MongoDB has no FK constraints)
|
|
10
|
+
* - TTL indexes supported natively
|
|
11
|
+
* - Vector indexes use Atlas Search (when available)
|
|
12
|
+
* - Schema validation uses `collMod` command
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const migrationDriver = new MongoMigrationDriver(mongoDriver);
|
|
17
|
+
* await migrationDriver.createIndex("users", {
|
|
18
|
+
* columns: ["email"],
|
|
19
|
+
* unique: true,
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class MongoMigrationDriver implements MigrationDriverContract {
|
|
24
|
+
private readonly driver;
|
|
25
|
+
/** Active transaction session (if any) */
|
|
26
|
+
private session?;
|
|
27
|
+
/**
|
|
28
|
+
* Create a new MongoDB migration driver.
|
|
29
|
+
*
|
|
30
|
+
* @param driver - The MongoDB driver instance
|
|
31
|
+
*/
|
|
32
|
+
constructor(driver: MongoDbDriver);
|
|
33
|
+
/**
|
|
34
|
+
* Get the MongoDB database instance.
|
|
35
|
+
*/
|
|
36
|
+
private get db();
|
|
37
|
+
/**
|
|
38
|
+
* Get session options for operations.
|
|
39
|
+
*/
|
|
40
|
+
private get sessionOptions();
|
|
41
|
+
/**
|
|
42
|
+
* Create a new collection.
|
|
43
|
+
*
|
|
44
|
+
* MongoDB creates collections lazily on first insert, but this method
|
|
45
|
+
* creates them explicitly for migrations that need to add indexes or
|
|
46
|
+
* schema validation.
|
|
47
|
+
*/
|
|
48
|
+
createTable(table: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Create table if not exists
|
|
51
|
+
*/
|
|
52
|
+
createTableIfNotExists(table: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Drop an existing collection.
|
|
55
|
+
*
|
|
56
|
+
* @throws Error if collection doesn't exist
|
|
57
|
+
*/
|
|
58
|
+
dropTable(table: string): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Drop collection if it exists (no error if missing).
|
|
61
|
+
*/
|
|
62
|
+
dropTableIfExists(table: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Rename a collection.
|
|
65
|
+
*/
|
|
66
|
+
renameTable(from: string, to: string): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Check if a collection exists.
|
|
69
|
+
*/
|
|
70
|
+
tableExists(table: string): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Add a column (no-op for MongoDB).
|
|
73
|
+
*
|
|
74
|
+
* MongoDB is schema-less, so columns don't need to be declared.
|
|
75
|
+
*/
|
|
76
|
+
addColumn(_table: string, _column: ColumnDefinition): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Drop a column by running $unset on all documents.
|
|
79
|
+
*
|
|
80
|
+
* This actually removes the field from all documents in the collection.
|
|
81
|
+
*/
|
|
82
|
+
dropColumn(table: string, column: string): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Drop multiple columns by running $unset on all documents.
|
|
85
|
+
*/
|
|
86
|
+
dropColumns(table: string, columns: string[]): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Rename a column by running $rename on all documents.
|
|
89
|
+
*/
|
|
90
|
+
renameColumn(table: string, from: string, to: string): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Modify a column definition (no-op for MongoDB).
|
|
93
|
+
*
|
|
94
|
+
* MongoDB is schema-less, so column types don't need to be modified.
|
|
95
|
+
*/
|
|
96
|
+
modifyColumn(_table: string, _column: ColumnDefinition): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Create an index on one or more columns.
|
|
99
|
+
*/
|
|
100
|
+
createIndex(table: string, index: IndexDefinition): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Drop an index by name or columns.
|
|
103
|
+
*
|
|
104
|
+
* @param indexNameOrColumns - Index name (string) or columns array
|
|
105
|
+
*/
|
|
106
|
+
dropIndex(table: string, indexNameOrColumns: string | string[]): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Create a unique index/constraint.
|
|
109
|
+
*/
|
|
110
|
+
createUniqueIndex(table: string, columns: string[], name?: string): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Drop a unique index by finding its name from columns.
|
|
113
|
+
*/
|
|
114
|
+
dropUniqueIndex(table: string, columns: string[]): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Create a full-text search index.
|
|
117
|
+
*
|
|
118
|
+
* MongoDB uses "text" index type for full-text search.
|
|
119
|
+
*/
|
|
120
|
+
createFullTextIndex(table: string, columns: string[], options?: FullTextIndexOptions): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Drop a full-text search index.
|
|
123
|
+
*/
|
|
124
|
+
dropFullTextIndex(table: string, name: string): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Create a geo-spatial index.
|
|
127
|
+
*/
|
|
128
|
+
createGeoIndex(table: string, column: string, options?: GeoIndexOptions): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Drop a geo-spatial index.
|
|
131
|
+
*/
|
|
132
|
+
dropGeoIndex(table: string, column: string): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Create a vector search index for AI embeddings.
|
|
135
|
+
*
|
|
136
|
+
* Note: This requires MongoDB Atlas with Vector Search enabled.
|
|
137
|
+
* For self-hosted MongoDB, this will create a regular index on the field.
|
|
138
|
+
*/
|
|
139
|
+
createVectorIndex(table: string, column: string, options: VectorIndexOptions): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Drop a vector search index.
|
|
142
|
+
*/
|
|
143
|
+
dropVectorIndex(table: string, column: string): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* Create a TTL (time-to-live) index for automatic document expiration.
|
|
146
|
+
*/
|
|
147
|
+
createTTLIndex(table: string, column: string, expireAfterSeconds: number): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Drop a TTL index.
|
|
150
|
+
*/
|
|
151
|
+
dropTTLIndex(table: string, column: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Add a foreign key constraint (no-op for MongoDB).
|
|
154
|
+
*
|
|
155
|
+
* MongoDB doesn't support foreign key constraints.
|
|
156
|
+
* Use application-level validation or DBRefs instead.
|
|
157
|
+
*/
|
|
158
|
+
addForeignKey(_table: string, _foreignKey: ForeignKeyDefinition): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Drop a foreign key constraint (no-op for MongoDB).
|
|
161
|
+
*/
|
|
162
|
+
dropForeignKey(_table: string, _name: string): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Add a primary key constraint (no-op for MongoDB).
|
|
165
|
+
*
|
|
166
|
+
* MongoDB always has _id as the primary key.
|
|
167
|
+
*/
|
|
168
|
+
addPrimaryKey(_table: string, _columns: string[]): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Drop the primary key constraint (no-op for MongoDB).
|
|
171
|
+
*/
|
|
172
|
+
dropPrimaryKey(_table: string): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Set JSON schema validation rules on a collection.
|
|
175
|
+
*
|
|
176
|
+
* Uses MongoDB's validator feature to enforce document structure.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* await driver.setSchemaValidation("users", {
|
|
181
|
+
* bsonType: "object",
|
|
182
|
+
* required: ["name", "email"],
|
|
183
|
+
* properties: {
|
|
184
|
+
* name: { bsonType: "string" },
|
|
185
|
+
* email: { bsonType: "string" },
|
|
186
|
+
* },
|
|
187
|
+
* });
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
setSchemaValidation(table: string, schema: object): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Remove schema validation rules from a collection.
|
|
193
|
+
*/
|
|
194
|
+
removeSchemaValidation(table: string): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Begin a database transaction.
|
|
197
|
+
*
|
|
198
|
+
* Uses the driver's transaction mechanism.
|
|
199
|
+
*/
|
|
200
|
+
beginTransaction(): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Commit the current transaction.
|
|
203
|
+
*/
|
|
204
|
+
commit(): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Rollback the current transaction.
|
|
207
|
+
*/
|
|
208
|
+
rollback(): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* MongoDB supports transactions (requires replica set).
|
|
211
|
+
*/
|
|
212
|
+
supportsTransactions(): boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Execute raw operations with direct database access.
|
|
215
|
+
*
|
|
216
|
+
* @param callback - Callback receiving the MongoDB Db instance
|
|
217
|
+
* @returns Result from callback
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* await driver.raw(async (db) => {
|
|
222
|
+
* await db.collection("users").updateMany({}, { $set: { active: true } });
|
|
223
|
+
* });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
raw<T>(callback: (connection: unknown) => Promise<T>): Promise<T>;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=mongo-migration-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-migration-driver.d.ts","sourceRoot":"","sources":["../../../src/drivers/mongo/mongo-migration-driver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAqB,YAAW,uBAAuB;IAS/C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAR1C,0CAA0C;IAC1C,OAAO,CAAC,OAAO,CAAC,CAAgB;IAEhC;;;;OAIG;gBACiC,MAAM,EAAE,aAAa;IAEzD;;OAEG;IACH,OAAO,KAAK,EAAE,GAEb;IAED;;OAEG;IACH,OAAO,KAA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