@warlock.js/cascade 5.29.0 → 5.31.0
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/CHANGELOG.md +12 -0
- package/README.md +1 -5
- package/cjs/index.cjs +101 -102
- package/cjs/index.cjs.map +1 -1
- package/esm/context/database-data-source-context.d.mts +1 -1
- package/esm/context/database-data-source-context.d.mts.map +1 -1
- package/esm/context/database-data-source-context.mjs +1 -1
- package/esm/context/database-data-source-context.mjs.map +1 -1
- package/esm/context/database-transaction-context.d.mts +1 -1
- package/esm/context/database-transaction-context.d.mts.map +1 -1
- package/esm/context/database-transaction-context.mjs +1 -1
- package/esm/context/database-transaction-context.mjs.map +1 -1
- package/esm/contracts/database-driver.contract.d.mts +1 -1
- package/esm/contracts/database-driver.contract.d.mts.map +1 -1
- package/esm/contracts/database-id-generator.contract.d.mts +1 -1
- package/esm/contracts/database-id-generator.contract.d.mts.map +1 -1
- package/esm/contracts/database-remover.contract.d.mts +1 -1
- package/esm/contracts/database-remover.contract.d.mts.map +1 -1
- package/esm/contracts/database-restorer.contract.d.mts +1 -1
- package/esm/contracts/database-restorer.contract.d.mts.map +1 -1
- package/esm/contracts/database-writer.contract.d.mts +1 -1
- package/esm/contracts/database-writer.contract.d.mts.map +1 -1
- package/esm/contracts/driver-blueprint.contract.d.mts +1 -1
- package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -1
- package/esm/contracts/migration-driver.contract.d.mts +1 -1
- package/esm/contracts/migration-driver.contract.d.mts.map +1 -1
- package/esm/contracts/query-builder.contract.d.mts +1 -1
- package/esm/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/contracts/sync-adapter.contract.d.mts +1 -1
- package/esm/contracts/sync-adapter.contract.d.mts.map +1 -1
- package/esm/data-source/data-source-registry.d.mts +1 -1
- package/esm/data-source/data-source-registry.d.mts.map +1 -1
- package/esm/data-source/data-source-registry.mjs +1 -1
- package/esm/data-source/data-source-registry.mjs.map +1 -1
- package/esm/data-source/data-source.d.mts +1 -1
- package/esm/data-source/data-source.d.mts.map +1 -1
- package/esm/data-source/data-source.mjs +1 -1
- package/esm/data-source/data-source.mjs.map +1 -1
- package/esm/database-dirty-tracker.d.mts +1 -1
- package/esm/database-dirty-tracker.d.mts.map +1 -1
- package/esm/database-dirty-tracker.mjs +1 -1
- package/esm/database-dirty-tracker.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-blueprint.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-driver.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-driver.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-update-translator.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-update-translator.mjs.map +1 -1
- package/esm/drivers/mongodb/pipeline-stage-object.mjs +1 -1
- package/esm/drivers/mongodb/pipeline-stage-object.mjs.map +1 -1
- package/esm/drivers/mongodb/types.d.mts +1 -1
- package/esm/drivers/mongodb/types.d.mts.map +1 -1
- package/esm/drivers/postgres/naming.mjs +1 -1
- package/esm/drivers/postgres/naming.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-blueprint.d.mts +1 -1
- package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-blueprint.mjs +1 -1
- package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-dialect.d.mts +1 -1
- package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-dialect.mjs +1 -1
- package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-driver.d.mts +1 -1
- package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-driver.mjs +1 -1
- package/esm/drivers/postgres/postgres-driver.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.d.mts +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.mjs +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-query-builder.d.mts +1 -1
- package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-query-builder.mjs +1 -1
- package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-query-parser.d.mts +1 -1
- package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-query-parser.mjs +1 -2
- package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-sql-serializer.mjs +1 -1
- package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-ttl-purge.mjs +1 -1
- package/esm/drivers/postgres/postgres-ttl-purge.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-type-converters.mjs +1 -1
- package/esm/drivers/postgres/postgres-type-converters.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-update-validator.mjs +1 -1
- package/esm/drivers/postgres/postgres-update-validator.mjs.map +1 -1
- package/esm/drivers/postgres/types.d.mts +1 -1
- package/esm/drivers/postgres/types.d.mts.map +1 -1
- package/esm/drivers/sql/sql-dialect.contract.d.mts +1 -1
- package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -1
- package/esm/drivers/sql/sql-types.d.mts +1 -1
- package/esm/drivers/sql/sql-types.d.mts.map +1 -1
- package/esm/errors/missing-data-source.error.d.mts +1 -1
- package/esm/errors/missing-data-source.error.d.mts.map +1 -1
- package/esm/errors/missing-data-source.error.mjs +1 -1
- package/esm/errors/missing-data-source.error.mjs.map +1 -1
- package/esm/errors/transaction-rollback.error.d.mts +1 -1
- package/esm/errors/transaction-rollback.error.d.mts.map +1 -1
- package/esm/errors/transaction-rollback.error.mjs +1 -1
- package/esm/errors/transaction-rollback.error.mjs.map +1 -1
- package/esm/errors/undefined-where-value.error.d.mts +1 -1
- package/esm/errors/undefined-where-value.error.d.mts.map +1 -1
- package/esm/errors/undefined-where-value.error.mjs +1 -1
- package/esm/errors/undefined-where-value.error.mjs.map +1 -1
- package/esm/errors/unsafe-filter.error.d.mts +1 -1
- package/esm/errors/unsafe-filter.error.d.mts.map +1 -1
- package/esm/errors/unsafe-filter.error.mjs +1 -1
- package/esm/errors/unsafe-filter.error.mjs.map +1 -1
- package/esm/errors/unsafe-raw-expression.error.d.mts +1 -1
- package/esm/errors/unsafe-raw-expression.error.d.mts.map +1 -1
- package/esm/errors/unsafe-raw-expression.error.mjs +1 -1
- package/esm/errors/unsafe-raw-expression.error.mjs.map +1 -1
- package/esm/errors/unsupported-lean-operation.error.d.mts +1 -1
- package/esm/errors/unsupported-lean-operation.error.d.mts.map +1 -1
- package/esm/errors/unsupported-lean-operation.error.mjs +1 -1
- package/esm/errors/unsupported-lean-operation.error.mjs.map +1 -1
- package/esm/errors/unsupported-lock-for-update.error.d.mts +1 -1
- package/esm/errors/unsupported-lock-for-update.error.d.mts.map +1 -1
- package/esm/errors/unsupported-lock-for-update.error.mjs +1 -1
- package/esm/errors/unsupported-lock-for-update.error.mjs.map +1 -1
- package/esm/errors/unsupported-query-operation.error.d.mts +1 -1
- package/esm/errors/unsupported-query-operation.error.d.mts.map +1 -1
- package/esm/errors/unsupported-query-operation.error.mjs +1 -1
- package/esm/errors/unsupported-query-operation.error.mjs.map +1 -1
- package/esm/errors/unsupported-update-operation.error.d.mts +1 -1
- package/esm/errors/unsupported-update-operation.error.d.mts.map +1 -1
- package/esm/errors/unsupported-update-operation.error.mjs +1 -1
- package/esm/errors/unsupported-update-operation.error.mjs.map +1 -1
- package/esm/events/model-events.d.mts +1 -1
- package/esm/events/model-events.d.mts.map +1 -1
- package/esm/events/model-events.mjs +1 -1
- package/esm/events/model-events.mjs.map +1 -1
- package/esm/expressions/aggregate-expressions.d.mts +1 -1
- package/esm/expressions/aggregate-expressions.d.mts.map +1 -1
- package/esm/expressions/aggregate-expressions.mjs +1 -1
- package/esm/expressions/aggregate-expressions.mjs.map +1 -1
- package/esm/expressions/column-expressions.d.mts +1 -1
- package/esm/expressions/column-expressions.d.mts.map +1 -1
- package/esm/expressions/column-expressions.mjs +1 -1
- package/esm/expressions/column-expressions.mjs.map +1 -1
- package/esm/migration/column-builder.d.mts +1 -1
- package/esm/migration/column-builder.d.mts.map +1 -1
- package/esm/migration/column-builder.mjs +1 -1
- package/esm/migration/column-builder.mjs.map +1 -1
- package/esm/migration/column-helpers.d.mts +1 -1
- package/esm/migration/column-helpers.d.mts.map +1 -1
- package/esm/migration/column-helpers.mjs +1 -1
- package/esm/migration/column-helpers.mjs.map +1 -1
- package/esm/migration/foreign-key-builder.d.mts +1 -1
- package/esm/migration/foreign-key-builder.d.mts.map +1 -1
- package/esm/migration/foreign-key-builder.mjs +1 -1
- package/esm/migration/foreign-key-builder.mjs.map +1 -1
- package/esm/migration/migration-order.mjs +1 -1
- package/esm/migration/migration-order.mjs.map +1 -1
- package/esm/migration/migration-runner.d.mts +1 -1
- package/esm/migration/migration-runner.d.mts.map +1 -1
- package/esm/migration/migration-runner.mjs +1 -1
- package/esm/migration/migration-runner.mjs.map +1 -1
- package/esm/migration/migration.d.mts +1 -1
- package/esm/migration/migration.d.mts.map +1 -1
- package/esm/migration/migration.mjs +1 -1
- package/esm/migration/migration.mjs.map +1 -1
- package/esm/migration/parse-created-at.mjs +1 -1
- package/esm/migration/parse-created-at.mjs.map +1 -1
- package/esm/migration/sql-grammar.mjs +1 -1
- package/esm/migration/sql-grammar.mjs.map +1 -1
- package/esm/migration/sql-serializer.d.mts +1 -1
- package/esm/migration/sql-serializer.d.mts.map +1 -1
- package/esm/migration/sql-serializer.mjs +1 -1
- package/esm/migration/sql-serializer.mjs.map +1 -1
- package/esm/migration/types.d.mts +1 -1
- package/esm/migration/types.d.mts.map +1 -1
- package/esm/model/generate-model-id.mjs +1 -1
- package/esm/model/generate-model-id.mjs.map +1 -1
- package/esm/model/methods/accessor-methods.mjs +1 -1
- package/esm/model/methods/accessor-methods.mjs.map +1 -1
- package/esm/model/methods/delete-methods.mjs +1 -1
- package/esm/model/methods/delete-methods.mjs.map +1 -1
- package/esm/model/methods/dirty-methods.mjs +1 -1
- package/esm/model/methods/dirty-methods.mjs.map +1 -1
- package/esm/model/methods/hydration-methods.mjs +1 -1
- package/esm/model/methods/hydration-methods.mjs.map +1 -1
- package/esm/model/methods/instance-event-methods.mjs +1 -1
- package/esm/model/methods/instance-event-methods.mjs.map +1 -1
- package/esm/model/methods/meta-methods.mjs +1 -1
- package/esm/model/methods/meta-methods.mjs.map +1 -1
- package/esm/model/methods/pivot-methods.mjs +1 -1
- package/esm/model/methods/pivot-methods.mjs.map +1 -1
- package/esm/model/methods/query-methods.mjs +1 -1
- package/esm/model/methods/query-methods.mjs.map +1 -1
- package/esm/model/methods/restore-methods.mjs +1 -1
- package/esm/model/methods/restore-methods.mjs.map +1 -1
- package/esm/model/methods/scope-methods.mjs +1 -1
- package/esm/model/methods/scope-methods.mjs.map +1 -1
- package/esm/model/methods/serialization-methods.mjs +1 -1
- package/esm/model/methods/serialization-methods.mjs.map +1 -1
- package/esm/model/methods/static-event-methods.mjs +1 -1
- package/esm/model/methods/static-event-methods.mjs.map +1 -1
- package/esm/model/methods/write-methods.d.mts +1 -1
- package/esm/model/methods/write-methods.d.mts.map +1 -1
- package/esm/model/methods/write-methods.mjs +1 -1
- package/esm/model/methods/write-methods.mjs.map +1 -1
- package/esm/model/model.d.mts +1 -1
- package/esm/model/model.d.mts.map +1 -1
- package/esm/model/model.mjs +1 -1
- package/esm/model/model.mjs.map +1 -1
- package/esm/model/model.types.d.mts +1 -1
- package/esm/model/model.types.d.mts.map +1 -1
- package/esm/model/register-model.d.mts +1 -1
- package/esm/model/register-model.d.mts.map +1 -1
- package/esm/model/register-model.mjs +1 -1
- package/esm/model/register-model.mjs.map +1 -1
- package/esm/model/relation-decorators.d.mts +1 -1
- package/esm/model/relation-decorators.d.mts.map +1 -1
- package/esm/model/relation-decorators.mjs +1 -1
- package/esm/model/relation-decorators.mjs.map +1 -1
- package/esm/operations/database.d.mts +1 -1
- package/esm/operations/database.d.mts.map +1 -1
- package/esm/operations/database.mjs +1 -1
- package/esm/operations/database.mjs.map +1 -1
- package/esm/operations/migrations.d.mts +1 -1
- package/esm/operations/migrations.d.mts.map +1 -1
- package/esm/operations/migrations.mjs +1 -1
- package/esm/operations/migrations.mjs.map +1 -1
- package/esm/query-builder/lean-records.mjs +1 -1
- package/esm/query-builder/lean-records.mjs.map +1 -1
- package/esm/query-builder/query-builder.d.mts +1 -1
- package/esm/query-builder/query-builder.d.mts.map +1 -1
- package/esm/query-builder/query-builder.mjs +1 -1
- package/esm/query-builder/query-builder.mjs.map +1 -1
- package/esm/relations/key-conventions.mjs +1 -1
- package/esm/relations/key-conventions.mjs.map +1 -1
- package/esm/relations/pivot-operations.d.mts +1 -1
- package/esm/relations/pivot-operations.d.mts.map +1 -1
- package/esm/relations/pivot-operations.mjs +1 -1
- package/esm/relations/pivot-operations.mjs.map +1 -1
- package/esm/relations/relation-hydrator.d.mts +1 -1
- package/esm/relations/relation-hydrator.d.mts.map +1 -1
- package/esm/relations/relation-hydrator.mjs +1 -1
- package/esm/relations/relation-hydrator.mjs.map +1 -1
- package/esm/relations/relation-loader.d.mts +1 -1
- package/esm/relations/relation-loader.d.mts.map +1 -1
- package/esm/relations/relation-loader.mjs +1 -1
- package/esm/relations/relation-loader.mjs.map +1 -1
- package/esm/relations/types.d.mts +1 -1
- package/esm/relations/types.d.mts.map +1 -1
- package/esm/remover/database-remover.d.mts +1 -1
- package/esm/remover/database-remover.d.mts.map +1 -1
- package/esm/remover/database-remover.mjs +1 -1
- package/esm/remover/database-remover.mjs.map +1 -1
- package/esm/restorer/database-restorer.d.mts +1 -1
- package/esm/restorer/database-restorer.d.mts.map +1 -1
- package/esm/restorer/database-restorer.mjs +1 -1
- package/esm/restorer/database-restorer.mjs.map +1 -1
- package/esm/sql-database-dirty-tracker.d.mts +1 -1
- package/esm/sql-database-dirty-tracker.d.mts.map +1 -1
- package/esm/sql-database-dirty-tracker.mjs +1 -1
- package/esm/sql-database-dirty-tracker.mjs.map +1 -1
- package/esm/sync/model-events.mjs +1 -1
- package/esm/sync/model-events.mjs.map +1 -1
- package/esm/sync/model-sync-operation.d.mts +1 -1
- package/esm/sync/model-sync-operation.d.mts.map +1 -1
- package/esm/sync/model-sync-operation.mjs +1 -1
- package/esm/sync/model-sync-operation.mjs.map +1 -1
- package/esm/sync/model-sync.d.mts +1 -1
- package/esm/sync/model-sync.d.mts.map +1 -1
- package/esm/sync/model-sync.mjs +1 -1
- package/esm/sync/model-sync.mjs.map +1 -1
- package/esm/sync/sync-context.d.mts +1 -1
- package/esm/sync/sync-context.d.mts.map +1 -1
- package/esm/sync/sync-context.mjs +1 -1
- package/esm/sync/sync-context.mjs.map +1 -1
- package/esm/sync/sync-fanout.mjs +1 -1
- package/esm/sync/sync-fanout.mjs.map +1 -1
- package/esm/sync/sync-manager.d.mts +1 -1
- package/esm/sync/sync-manager.d.mts.map +1 -1
- package/esm/sync/sync-manager.mjs +1 -1
- package/esm/sync/sync-manager.mjs.map +1 -1
- package/esm/sync/types.d.mts +1 -1
- package/esm/sync/types.d.mts.map +1 -1
- package/esm/transactions/after-commit.d.mts +1 -1
- package/esm/transactions/after-commit.d.mts.map +1 -1
- package/esm/transactions/after-commit.mjs +1 -1
- package/esm/transactions/after-commit.mjs.map +1 -1
- package/esm/types.d.mts +1 -1
- package/esm/types.d.mts.map +1 -1
- package/esm/utils/connect-to-database.d.mts +1 -1
- package/esm/utils/connect-to-database.d.mts.map +1 -1
- package/esm/utils/connect-to-database.mjs +1 -1
- package/esm/utils/connect-to-database.mjs.map +1 -1
- package/esm/utils/database-writer.utils.d.mts +1 -1
- package/esm/utils/database-writer.utils.d.mts.map +1 -1
- package/esm/utils/database-writer.utils.mjs +1 -1
- package/esm/utils/database-writer.utils.mjs.map +1 -1
- package/esm/utils/define-model.d.mts +1 -1
- package/esm/utils/define-model.d.mts.map +1 -1
- package/esm/utils/define-model.mjs +1 -1
- package/esm/utils/define-model.mjs.map +1 -1
- package/esm/utils/escape-regex.d.mts +1 -1
- package/esm/utils/escape-regex.d.mts.map +1 -1
- package/esm/utils/escape-regex.mjs +1 -1
- package/esm/utils/escape-regex.mjs.map +1 -1
- package/esm/utils/is-valid-date-value.mjs +1 -1
- package/esm/utils/is-valid-date-value.mjs.map +1 -1
- package/esm/utils/once-connected.d.mts +1 -1
- package/esm/utils/once-connected.d.mts.map +1 -1
- package/esm/utils/once-connected.mjs +1 -1
- package/esm/utils/once-connected.mjs.map +1 -1
- package/esm/utils/prune-empty-parents.mjs +1 -1
- package/esm/utils/prune-empty-parents.mjs.map +1 -1
- package/esm/utils/sanitize-filter.d.mts +1 -1
- package/esm/utils/sanitize-filter.d.mts.map +1 -1
- package/esm/utils/sanitize-filter.mjs +1 -1
- package/esm/utils/sanitize-filter.mjs.map +1 -1
- package/esm/validation/database-seal-plugins.mjs +1 -1
- package/esm/validation/database-seal-plugins.mjs.map +1 -1
- package/esm/validation/database-writer-validation-error.d.mts +1 -1
- package/esm/validation/database-writer-validation-error.d.mts.map +1 -1
- package/esm/validation/database-writer-validation-error.mjs +1 -1
- package/esm/validation/database-writer-validation-error.mjs.map +1 -1
- package/esm/validation/mutators/embed-mutator.mjs +1 -1
- package/esm/validation/mutators/embed-mutator.mjs.map +1 -1
- package/esm/validation/plugins/database-rules-plugin.d.mts +1 -1
- package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -1
- package/esm/validation/plugins/database-rules-plugin.mjs +1 -1
- package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -1
- package/esm/validation/plugins/embed-validator-plugin.d.mts +1 -1
- package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -1
- package/esm/validation/plugins/embed-validator-plugin.mjs +1 -1
- package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -1
- package/esm/validation/rules/database-model-rule.mjs +1 -1
- package/esm/validation/rules/database-model-rule.mjs.map +1 -1
- package/esm/validation/rules/exists-rule.mjs +1 -1
- package/esm/validation/rules/exists-rule.mjs.map +1 -1
- package/esm/validation/rules/unique-rule.mjs +1 -1
- package/esm/validation/rules/unique-rule.mjs.map +1 -1
- package/esm/validation/transformers/embed-model-transformer.mjs +1 -1
- package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -1
- package/esm/validation/types.d.mts +1 -1
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validators/embed-validator.d.mts +1 -1
- package/esm/validation/validators/embed-validator.d.mts.map +1 -1
- package/esm/validation/validators/embed-validator.mjs +1 -1
- package/esm/validation/validators/embed-validator.mjs.map +1 -1
- package/esm/writer/database-writer.d.mts +1 -1
- package/esm/writer/database-writer.d.mts.map +1 -1
- package/esm/writer/database-writer.mjs +1 -1
- package/esm/writer/database-writer.mjs.map +1 -1
- package/llms-full.txt +541 -434
- package/package.json +7 -6
- package/skills/aggregate-data/SKILL.md +28 -17
- package/skills/alter-migration/SKILL.md +325 -233
- package/skills/cascade-basics/SKILL.md +19 -19
- package/skills/configure-delete-strategy/SKILL.md +11 -11
- package/skills/define-model/SKILL.md +19 -17
- package/skills/define-relations/SKILL.md +13 -18
- package/skills/index.md +3 -0
- package/skills/manage-transactions/SKILL.md +18 -12
- package/skills/paginate-results/SKILL.md +6 -8
- package/skills/perform-atomic-ops/SKILL.md +26 -21
- package/skills/query-data/SKILL.md +27 -33
- package/skills/run-cascade-cli/SKILL.md +11 -10
- package/skills/search-by-vector/SKILL.md +8 -5
- package/skills/subscribe-to-model-events/SKILL.md +17 -17
- package/skills/track-changes/SKILL.md +9 -9
- package/skills/write-migration/SKILL.md +4 -4
package/package.json
CHANGED
|
@@ -13,16 +13,17 @@
|
|
|
13
13
|
"@mongez/events": "^2.2.8",
|
|
14
14
|
"@mongez/reinforcements": "^4.0.2",
|
|
15
15
|
"@mongez/supportive-is": "^3.0.0",
|
|
16
|
-
"@warlock.js/context": "5.
|
|
17
|
-
"@warlock.js/logger": "5.
|
|
18
|
-
"@warlock.js/scheduler": "5.
|
|
19
|
-
"@warlock.js/seal": "5.
|
|
16
|
+
"@warlock.js/context": "5.31.0",
|
|
17
|
+
"@warlock.js/logger": "5.31.0",
|
|
18
|
+
"@warlock.js/scheduler": "5.31.0",
|
|
19
|
+
"@warlock.js/seal": "5.31.0",
|
|
20
20
|
"citty": "^0.2.2",
|
|
21
21
|
"fast-glob": "^3.3.3"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "https://github.com/warlockjs/
|
|
25
|
+
"url": "git+https://github.com/warlockjs/framework.git",
|
|
26
|
+
"directory": "packages/cascade"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"mongodb": "^5.7.0 || ^6.0.0 || ^7.0.0",
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
],
|
|
53
54
|
"author": "hassanzohdy",
|
|
54
55
|
"license": "MIT",
|
|
55
|
-
"version": "5.
|
|
56
|
+
"version": "5.31.0",
|
|
56
57
|
"main": "./cjs/index.cjs",
|
|
57
58
|
"module": "./esm/index.mjs",
|
|
58
59
|
"types": "./esm/index.d.mts",
|
|
@@ -10,23 +10,21 @@ Cascade's query builder isn't only for finding records — it crunches numbers t
|
|
|
10
10
|
## Scalar aggregates
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
|
-
const total
|
|
14
|
-
const revenue
|
|
15
|
-
const avgTicket
|
|
16
|
-
const cheapest
|
|
17
|
-
const priciest
|
|
13
|
+
const total = await Order.count(); // count is static on the model
|
|
14
|
+
const revenue = await Order.query().sum("total");
|
|
15
|
+
const avgTicket = await Order.query().avg("total");
|
|
16
|
+
const cheapest = await Order.query().min("total");
|
|
17
|
+
const priciest = await Order.query().max("total");
|
|
18
18
|
|
|
19
19
|
// Filtered
|
|
20
|
-
const monthRevenue = await Order.query()
|
|
21
|
-
.whereDateAfter("created_at", startOfMonth)
|
|
22
|
-
.sum("total");
|
|
20
|
+
const monthRevenue = await Order.query().whereDateAfter("created_at", startOfMonth).sum("total");
|
|
23
21
|
```
|
|
24
22
|
|
|
25
23
|
Each returns a single number (`Promise<number>`). Only `count` is a static shortcut on the model; `sum` / `avg` / `min` / `max` (and the date helpers) are query-builder methods — reach them via `Order.query()` or chain off `Order.where(...)`. Date filters take a single date: `whereDate(field, value)` (exact day, time ignored), `whereDateAfter` / `whereDateBefore` (one-sided), `whereDateBetween(field, [a, b])` (range) — there is no 3-arg `whereDate(field, op, value)`. By Cascade convention the scalar terminators return **`0` on zero rows — not `null`** — so you can use the result directly without a null guard.
|
|
26
24
|
|
|
27
25
|
## Grouped rollups — two-arg `groupBy(fields, aggregates)`
|
|
28
26
|
|
|
29
|
-
To compute aggregates
|
|
27
|
+
To compute aggregates _per group_, pass a second argument to `groupBy`: an object mapping output aliases to aggregate expressions. Build the expressions with the `$agg` helpers:
|
|
30
28
|
|
|
31
29
|
```ts
|
|
32
30
|
import { $agg } from "@warlock.js/cascade";
|
|
@@ -59,8 +57,8 @@ import { $agg, $expr } from "@warlock.js/cascade";
|
|
|
59
57
|
|
|
60
58
|
const revenue = await OrderItem.query()
|
|
61
59
|
.groupBy("product_id", {
|
|
62
|
-
revenue: $agg.sum($expr.mul("price", "quantity")),
|
|
63
|
-
net:
|
|
60
|
+
revenue: $agg.sum($expr.mul("price", "quantity")), // SUM(price * quantity)
|
|
61
|
+
net: $agg.sum($expr.mul($expr.sub($expr.lit(1), "discount"), "price")), // SUM((1 - discount) * price)
|
|
64
62
|
})
|
|
65
63
|
.get();
|
|
66
64
|
```
|
|
@@ -108,7 +106,7 @@ const monthly = await Order.query()
|
|
|
108
106
|
|
|
109
107
|
## `.having(...)` — filter groups by a computed aggregate
|
|
110
108
|
|
|
111
|
-
`.where()` filters rows
|
|
109
|
+
`.where()` filters rows _before_ grouping (cheap, uses indexes). `.having()` filters _after_ aggregation, by the alias you defined:
|
|
112
110
|
|
|
113
111
|
```ts
|
|
114
112
|
const big = await Order.query()
|
|
@@ -137,14 +135,27 @@ The `orderBy` reference matches the alias from the aggregates object.
|
|
|
137
135
|
const rows = await Post.query().unwind("tags").where("tags", "news").lean().get();
|
|
138
136
|
|
|
139
137
|
// Keep posts with no tags; record each tag's position
|
|
140
|
-
await Post.query()
|
|
138
|
+
await Post.query()
|
|
139
|
+
.unwind("tags", { preserveNullAndEmptyArrays: true, includeArrayIndex: "position" })
|
|
140
|
+
.get();
|
|
141
141
|
|
|
142
142
|
// Computed field, existing fields kept
|
|
143
|
-
await Post.query()
|
|
143
|
+
await Post.query()
|
|
144
|
+
.addFields({ score: { $add: ["$likes", "$shares"] } })
|
|
145
|
+
.orderBy("score", "desc")
|
|
146
|
+
.get();
|
|
144
147
|
|
|
145
148
|
// Pipeline $lookup
|
|
146
|
-
await Post.query()
|
|
147
|
-
|
|
149
|
+
await Post.query()
|
|
150
|
+
.join({
|
|
151
|
+
table: "comments",
|
|
152
|
+
localField: "id",
|
|
153
|
+
foreignField: "postId",
|
|
154
|
+
alias: "approved",
|
|
155
|
+
pipeline: [{ $match: { approved: true } }],
|
|
156
|
+
})
|
|
157
|
+
.lean()
|
|
158
|
+
.get();
|
|
148
159
|
```
|
|
149
160
|
|
|
150
161
|
`unwind()` returns several rows for one stored document. Use `.lean()` when you only read them. `addFields` expressions are raw aggregation expressions: write them in code, never from request data. Computed columns in the output also work with `selectRaw({ alias: expr })` (`$project`). There is no `$facet` method yet.
|
|
@@ -156,7 +167,7 @@ Raw stages: `joinRaw({ $lookup: { from, let, pipeline, as } })` (or an array of
|
|
|
156
167
|
## Gotchas
|
|
157
168
|
|
|
158
169
|
- **`where` vs `having`.** Row filters go in `.where()` (before grouping, index-friendly); aggregate filters go in `.having()`.
|
|
159
|
-
- **Empty sets.** Scalar terminators return `0` on zero rows (above). For
|
|
170
|
+
- **Empty sets.** Scalar terminators return `0` on zero rows (above). For _grouped_ reports, a group with no rows simply doesn't appear — a report over an empty range returns `[]`, not a row of zeros.
|
|
160
171
|
- **Don't `.all()` then `array.reduce`.** Always push aggregates to the database.
|
|
161
172
|
|
|
162
173
|
## See also
|