uql-orm 0.20.2 → 0.21.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/README.md +45 -109
- package/dist/browser/http/bus.d.ts +0 -1
- package/dist/browser/http/bus.js +0 -1
- package/dist/browser/http/http.d.ts +0 -1
- package/dist/browser/http/http.js +0 -1
- package/dist/browser/http/index.d.ts +0 -1
- package/dist/browser/http/index.js +0 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.js +0 -1
- package/dist/browser/options.d.ts +0 -1
- package/dist/browser/options.js +0 -1
- package/dist/browser/querier/httpQuerier.d.ts +0 -1
- package/dist/browser/querier/httpQuerier.js +0 -1
- package/dist/browser/querier/index.d.ts +0 -1
- package/dist/browser/querier/index.js +0 -1
- package/dist/browser/type/clientQuerier.d.ts +0 -1
- package/dist/browser/type/clientQuerier.js +0 -1
- package/dist/browser/type/clientQuerierPool.d.ts +0 -1
- package/dist/browser/type/clientQuerierPool.js +0 -1
- package/dist/browser/type/index.d.ts +0 -1
- package/dist/browser/type/index.js +0 -1
- package/dist/browser/type/request.d.ts +0 -1
- package/dist/browser/type/request.js +0 -1
- package/dist/browser/uql-browser.min.js +2 -2
- package/dist/browser/uql-browser.min.js.map +1 -1
- package/dist/bunSql/bunSql.util.d.ts +0 -1
- package/dist/bunSql/bunSql.util.js +0 -1
- package/dist/bunSql/bunSqlCockroachDialect.d.ts +0 -1
- package/dist/bunSql/bunSqlCockroachDialect.js +0 -1
- package/dist/bunSql/bunSqlPostgresDialect.d.ts +0 -1
- package/dist/bunSql/bunSqlPostgresDialect.js +0 -1
- package/dist/bunSql/bunSqlQuerier.d.ts +0 -1
- package/dist/bunSql/bunSqlQuerier.js +0 -1
- package/dist/bunSql/bunSqlQuerierPool.d.ts +0 -1
- package/dist/bunSql/bunSqlQuerierPool.js +0 -1
- package/dist/bunSql/bunSqliteDialect.d.ts +0 -1
- package/dist/bunSql/bunSqliteDialect.js +0 -1
- package/dist/bunSql/index.d.ts +0 -1
- package/dist/bunSql/index.js +0 -1
- package/dist/cockroachdb/cockroachDialect.d.ts +0 -1
- package/dist/cockroachdb/cockroachDialect.js +0 -1
- package/dist/cockroachdb/crdbQuerier.d.ts +0 -1
- package/dist/cockroachdb/crdbQuerier.js +0 -1
- package/dist/cockroachdb/crdbQuerierPool.d.ts +0 -1
- package/dist/cockroachdb/crdbQuerierPool.js +0 -1
- package/dist/cockroachdb/index.d.ts +0 -1
- package/dist/cockroachdb/index.js +0 -1
- package/dist/context/context.browser.d.ts +0 -1
- package/dist/context/context.browser.js +0 -1
- package/dist/context/context.d.ts +0 -1
- package/dist/context/context.js +0 -1
- package/dist/context/securityError.d.ts +0 -1
- package/dist/context/securityError.js +0 -1
- package/dist/d1/d1Querier.d.ts +0 -1
- package/dist/d1/d1Querier.js +0 -1
- package/dist/d1/d1QuerierPool.d.ts +0 -1
- package/dist/d1/d1QuerierPool.js +0 -1
- package/dist/d1/d1SqliteDialect.d.ts +0 -1
- package/dist/d1/d1SqliteDialect.js +0 -1
- package/dist/d1/index.d.ts +0 -1
- package/dist/d1/index.js +0 -1
- package/dist/dialect/abstractDialect.d.ts +13 -2
- package/dist/dialect/abstractDialect.js +17 -1
- package/dist/dialect/abstractSqlDialect.d.ts +27 -15
- package/dist/dialect/abstractSqlDialect.js +121 -139
- package/dist/dialect/index.d.ts +0 -1
- package/dist/dialect/index.js +0 -1
- package/dist/dialect/jsonArrayElemMatchUtils.d.ts +0 -1
- package/dist/dialect/jsonArrayElemMatchUtils.js +0 -1
- package/dist/dialect/jsonSql.d.ts +0 -1
- package/dist/dialect/jsonSql.js +1 -2
- package/dist/dialect/mysqlLikeSqlDialect.d.ts +0 -1
- package/dist/dialect/mysqlLikeSqlDialect.js +2 -4
- package/dist/dialect/pgLikeSqlDialect.d.ts +3 -3
- package/dist/dialect/pgLikeSqlDialect.js +7 -18
- package/dist/dialect/queryContext.d.ts +0 -1
- package/dist/dialect/queryContext.js +0 -1
- package/dist/dialect/vectorCast.d.ts +11 -0
- package/dist/dialect/vectorCast.js +13 -0
- package/dist/dialect/vectorSqlDialect.d.ts +1 -2
- package/dist/dialect/vectorSqlDialect.js +1 -2
- package/dist/entity/decorator/entity.d.ts +0 -1
- package/dist/entity/decorator/entity.js +0 -1
- package/dist/entity/decorator/field.d.ts +0 -1
- package/dist/entity/decorator/field.js +0 -1
- package/dist/entity/decorator/filter.d.ts +0 -1
- package/dist/entity/decorator/filter.js +0 -1
- package/dist/entity/decorator/hook.d.ts +0 -1
- package/dist/entity/decorator/hook.js +0 -1
- package/dist/entity/decorator/id.d.ts +0 -1
- package/dist/entity/decorator/id.js +0 -1
- package/dist/entity/decorator/index-decorator.d.ts +0 -1
- package/dist/entity/decorator/index-decorator.js +0 -1
- package/dist/entity/decorator/index.d.ts +0 -1
- package/dist/entity/decorator/index.js +0 -1
- package/dist/entity/decorator/relation.d.ts +0 -1
- package/dist/entity/decorator/relation.js +0 -1
- package/dist/entity/index.d.ts +0 -1
- package/dist/entity/index.js +0 -1
- package/dist/entity/metadata/definition.d.ts +0 -2
- package/dist/entity/metadata/definition.js +6 -3
- package/dist/express/index.d.ts +0 -1
- package/dist/express/index.js +0 -1
- package/dist/express/querierMiddleware.d.ts +0 -1
- package/dist/express/querierMiddleware.js +0 -1
- package/dist/http/contract.d.ts +0 -1
- package/dist/http/contract.js +0 -1
- package/dist/http/fetchHandler.d.ts +0 -1
- package/dist/http/fetchHandler.js +0 -1
- package/dist/http/handler.d.ts +0 -1
- package/dist/http/handler.js +0 -1
- package/dist/http/index.d.ts +0 -1
- package/dist/http/index.js +0 -1
- package/dist/http/query.d.ts +0 -1
- package/dist/http/query.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/libsql/index.d.ts +0 -1
- package/dist/libsql/index.js +0 -1
- package/dist/libsql/libsqlDialect.d.ts +0 -1
- package/dist/libsql/libsqlDialect.js +0 -1
- package/dist/libsql/libsqlQuerier.d.ts +0 -1
- package/dist/libsql/libsqlQuerier.js +9 -2
- package/dist/libsql/libsqlQuerierPool.d.ts +0 -1
- package/dist/libsql/libsqlQuerierPool.js +0 -1
- package/dist/maria/index.d.ts +0 -1
- package/dist/maria/index.js +0 -1
- package/dist/maria/mariaDialect.d.ts +0 -1
- package/dist/maria/mariaDialect.js +0 -1
- package/dist/maria/mariadbQuerier.d.ts +0 -1
- package/dist/maria/mariadbQuerier.js +0 -1
- package/dist/maria/mariadbQuerierPool.d.ts +0 -1
- package/dist/maria/mariadbQuerierPool.js +0 -1
- package/dist/migrate/acquireQuerierForMigrations.d.ts +0 -1
- package/dist/migrate/acquireQuerierForMigrations.js +0 -1
- package/dist/migrate/assertCliConfig.d.ts +0 -1
- package/dist/migrate/assertCliConfig.js +0 -1
- package/dist/migrate/bin.d.ts +0 -1
- package/dist/migrate/bin.js +0 -1
- package/dist/migrate/builder/columnBuilder.d.ts +0 -1
- package/dist/migrate/builder/columnBuilder.js +0 -1
- package/dist/migrate/builder/expressions.d.ts +0 -1
- package/dist/migrate/builder/expressions.js +0 -1
- package/dist/migrate/builder/index.d.ts +0 -1
- package/dist/migrate/builder/index.js +0 -1
- package/dist/migrate/builder/migrationBuilder.d.ts +0 -1
- package/dist/migrate/builder/migrationBuilder.js +0 -1
- package/dist/migrate/builder/splitSqlStatements.d.ts +0 -1
- package/dist/migrate/builder/splitSqlStatements.js +0 -1
- package/dist/migrate/builder/tableBuilder.d.ts +0 -1
- package/dist/migrate/builder/tableBuilder.js +0 -1
- package/dist/migrate/builder/types.d.ts +0 -1
- package/dist/migrate/builder/types.js +0 -1
- package/dist/migrate/cli-config.d.ts +0 -1
- package/dist/migrate/cli-config.js +9 -5
- package/dist/migrate/cli.d.ts +0 -1
- package/dist/migrate/cli.js +0 -1
- package/dist/migrate/codegen/entityCodeGenerator.d.ts +0 -1
- package/dist/migrate/codegen/entityCodeGenerator.js +0 -1
- package/dist/migrate/codegen/entityMerger.d.ts +0 -1
- package/dist/migrate/codegen/entityMerger.js +0 -1
- package/dist/migrate/codegen/index.d.ts +0 -1
- package/dist/migrate/codegen/index.js +0 -1
- package/dist/migrate/codegen/migrationCodeGenerator.d.ts +0 -1
- package/dist/migrate/codegen/migrationCodeGenerator.js +0 -1
- package/dist/migrate/codegen/migrationFile.d.ts +0 -1
- package/dist/migrate/codegen/migrationFile.js +0 -1
- package/dist/migrate/codegen/smartRelationDetector.d.ts +0 -1
- package/dist/migrate/codegen/smartRelationDetector.js +0 -1
- package/dist/migrate/drift/driftDetector.d.ts +0 -1
- package/dist/migrate/drift/driftDetector.js +0 -1
- package/dist/migrate/drift/index.d.ts +0 -1
- package/dist/migrate/drift/index.js +0 -1
- package/dist/migrate/generator/index.d.ts +0 -1
- package/dist/migrate/generator/index.js +0 -1
- package/dist/migrate/generator/mongoSchemaGenerator.d.ts +0 -1
- package/dist/migrate/generator/mongoSchemaGenerator.js +0 -1
- package/dist/migrate/index.d.ts +0 -1
- package/dist/migrate/index.js +0 -1
- package/dist/migrate/introspection/abstractSqlSchemaIntrospector.d.ts +0 -1
- package/dist/migrate/introspection/abstractSqlSchemaIntrospector.js +0 -1
- package/dist/migrate/introspection/baseSqlIntrospector.d.ts +0 -1
- package/dist/migrate/introspection/baseSqlIntrospector.js +0 -1
- package/dist/migrate/introspection/index.d.ts +0 -1
- package/dist/migrate/introspection/index.js +0 -1
- package/dist/migrate/introspection/mongoIntrospector.d.ts +0 -1
- package/dist/migrate/introspection/mongoIntrospector.js +0 -1
- package/dist/migrate/introspection/mysqlIntrospector.d.ts +0 -1
- package/dist/migrate/introspection/mysqlIntrospector.js +0 -1
- package/dist/migrate/introspection/postgresIntrospector.d.ts +0 -1
- package/dist/migrate/introspection/postgresIntrospector.js +0 -1
- package/dist/migrate/introspection/sqliteIntrospector.d.ts +0 -1
- package/dist/migrate/introspection/sqliteIntrospector.js +0 -1
- package/dist/migrate/migrator.d.ts +0 -1
- package/dist/migrate/migrator.js +0 -1
- package/dist/migrate/schemaGenerator.d.ts +0 -1
- package/dist/migrate/schemaGenerator.js +0 -1
- package/dist/migrate/schemaGeneratorAsync.d.ts +0 -1
- package/dist/migrate/schemaGeneratorAsync.js +0 -1
- package/dist/migrate/storage/databaseStorage.d.ts +0 -1
- package/dist/migrate/storage/databaseStorage.js +0 -1
- package/dist/migrate/storage/index.d.ts +0 -1
- package/dist/migrate/storage/index.js +0 -1
- package/dist/migrate/storage/jsonStorage.d.ts +0 -1
- package/dist/migrate/storage/jsonStorage.js +0 -1
- package/dist/migrate/sync/index.d.ts +0 -1
- package/dist/migrate/sync/index.js +0 -1
- package/dist/migrate/sync/schemaSync.d.ts +0 -1
- package/dist/migrate/sync/schemaSync.js +0 -1
- package/dist/mongo/index.d.ts +0 -1
- package/dist/mongo/index.js +0 -1
- package/dist/mongo/mongoDialect.d.ts +91 -5
- package/dist/mongo/mongoDialect.js +301 -80
- package/dist/mongo/mongodbNativeDialect.d.ts +0 -1
- package/dist/mongo/mongodbNativeDialect.js +0 -1
- package/dist/mongo/mongodbQuerier.d.ts +5 -1
- package/dist/mongo/mongodbQuerier.js +61 -19
- package/dist/mongo/mongodbQuerierPool.d.ts +0 -1
- package/dist/mongo/mongodbQuerierPool.js +0 -1
- package/dist/mysql/index.d.ts +0 -1
- package/dist/mysql/index.js +0 -1
- package/dist/mysql/mysql2Dialect.d.ts +0 -1
- package/dist/mysql/mysql2Dialect.js +0 -1
- package/dist/mysql/mysql2Querier.d.ts +0 -1
- package/dist/mysql/mysql2Querier.js +0 -1
- package/dist/mysql/mysql2QuerierPool.d.ts +0 -1
- package/dist/mysql/mysql2QuerierPool.js +0 -1
- package/dist/mysql/mysqlDialect.d.ts +0 -1
- package/dist/mysql/mysqlDialect.js +0 -1
- package/dist/namingStrategy/defaultNamingStrategy.d.ts +0 -1
- package/dist/namingStrategy/defaultNamingStrategy.js +0 -1
- package/dist/namingStrategy/index.d.ts +0 -1
- package/dist/namingStrategy/index.js +0 -1
- package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts +0 -1
- package/dist/namingStrategy/snakeCaseNamingStrategy.js +0 -1
- package/dist/neon/index.d.ts +0 -1
- package/dist/neon/index.js +0 -1
- package/dist/neon/neonDialect.d.ts +0 -1
- package/dist/neon/neonDialect.js +0 -1
- package/dist/neon/neonQuerier.d.ts +0 -1
- package/dist/neon/neonQuerier.js +0 -1
- package/dist/neon/neonQuerierPool.d.ts +0 -1
- package/dist/neon/neonQuerierPool.js +0 -1
- package/dist/nestjs/index.d.ts +0 -1
- package/dist/nestjs/index.js +0 -1
- package/dist/nestjs/uqlContextInterceptor.d.ts +0 -1
- package/dist/nestjs/uqlContextInterceptor.js +9 -2
- package/dist/nestjs/uqlModule.d.ts +0 -1
- package/dist/nestjs/uqlModule.js +12 -2
- package/dist/options.d.ts +0 -1
- package/dist/options.js +0 -1
- package/dist/postgres/abstractPgQuerier.d.ts +0 -1
- package/dist/postgres/abstractPgQuerier.js +0 -1
- package/dist/postgres/abstractPgQuerierPool.d.ts +0 -1
- package/dist/postgres/abstractPgQuerierPool.js +0 -1
- package/dist/postgres/index.d.ts +0 -1
- package/dist/postgres/index.js +0 -1
- package/dist/postgres/pgDialect.d.ts +0 -1
- package/dist/postgres/pgDialect.js +0 -1
- package/dist/postgres/pgQuerier.d.ts +0 -1
- package/dist/postgres/pgQuerier.js +0 -1
- package/dist/postgres/pgQuerierPool.d.ts +0 -1
- package/dist/postgres/pgQuerierPool.js +0 -1
- package/dist/postgres/postgresDialect.d.ts +0 -1
- package/dist/postgres/postgresDialect.js +0 -1
- package/dist/postgres/postgresWireDriverCapabilities.d.ts +0 -1
- package/dist/postgres/postgresWireDriverCapabilities.js +0 -1
- package/dist/querier/abstractPoolQuerier.d.ts +0 -1
- package/dist/querier/abstractPoolQuerier.js +0 -1
- package/dist/querier/abstractQuerier.d.ts +0 -1
- package/dist/querier/abstractQuerier.js +9 -2
- package/dist/querier/abstractQuerierPool.d.ts +0 -1
- package/dist/querier/abstractQuerierPool.js +0 -1
- package/dist/querier/abstractSqlQuerier.d.ts +0 -1
- package/dist/querier/abstractSqlQuerier.js +9 -2
- package/dist/querier/abstractSqlQuerierPool.d.ts +0 -1
- package/dist/querier/abstractSqlQuerierPool.js +0 -1
- package/dist/querier/decorator/index.d.ts +0 -1
- package/dist/querier/decorator/index.js +0 -1
- package/dist/querier/decorator/injectQuerier.d.ts +0 -1
- package/dist/querier/decorator/injectQuerier.js +0 -1
- package/dist/querier/decorator/log.d.ts +0 -1
- package/dist/querier/decorator/log.js +0 -1
- package/dist/querier/decorator/serialized.d.ts +0 -1
- package/dist/querier/decorator/serialized.js +0 -1
- package/dist/querier/decorator/transactional.d.ts +0 -1
- package/dist/querier/decorator/transactional.js +0 -1
- package/dist/querier/index.d.ts +0 -1
- package/dist/querier/index.js +0 -1
- package/dist/schema/canonicalType.d.ts +0 -11
- package/dist/schema/canonicalType.js +0 -13
- package/dist/schema/index.d.ts +0 -1
- package/dist/schema/index.js +0 -1
- package/dist/schema/schemaAST.d.ts +0 -1
- package/dist/schema/schemaAST.js +0 -1
- package/dist/schema/schemaASTBuilder.d.ts +0 -1
- package/dist/schema/schemaASTBuilder.js +0 -1
- package/dist/schema/schemaASTDiffer.d.ts +0 -1
- package/dist/schema/schemaASTDiffer.js +0 -1
- package/dist/schema/types.d.ts +0 -1
- package/dist/schema/types.js +0 -1
- package/dist/sqlite/abstractSqliteQuerier.d.ts +0 -1
- package/dist/sqlite/abstractSqliteQuerier.js +0 -1
- package/dist/sqlite/betterSqlite3Dialect.d.ts +0 -1
- package/dist/sqlite/betterSqlite3Dialect.js +0 -1
- package/dist/sqlite/index.d.ts +0 -1
- package/dist/sqlite/index.js +0 -1
- package/dist/sqlite/sqliteDialect.d.ts +0 -1
- package/dist/sqlite/sqliteDialect.js +0 -1
- package/dist/sqlite/sqliteQuerier.d.ts +0 -1
- package/dist/sqlite/sqliteQuerier.js +0 -1
- package/dist/sqlite/sqliteQuerierPool.d.ts +0 -1
- package/dist/sqlite/sqliteQuerierPool.js +0 -1
- package/dist/type/config.d.ts +0 -1
- package/dist/type/config.js +0 -1
- package/dist/type/dialect.d.ts +0 -1
- package/dist/type/dialect.js +0 -1
- package/dist/type/entity.d.ts +0 -1
- package/dist/type/entity.js +0 -1
- package/dist/type/index.d.ts +0 -1
- package/dist/type/index.js +0 -1
- package/dist/type/logger.d.ts +0 -1
- package/dist/type/logger.js +0 -1
- package/dist/type/migration.d.ts +0 -1
- package/dist/type/migration.js +0 -1
- package/dist/type/migratorDialect.d.ts +0 -1
- package/dist/type/migratorDialect.js +0 -1
- package/dist/type/namingStrategy.d.ts +0 -1
- package/dist/type/namingStrategy.js +0 -1
- package/dist/type/querier.d.ts +0 -1
- package/dist/type/querier.js +0 -1
- package/dist/type/querierPool.d.ts +0 -1
- package/dist/type/querierPool.js +0 -1
- package/dist/type/query.d.ts +0 -1
- package/dist/type/query.js +0 -1
- package/dist/type/queryAggregate.d.ts +0 -1
- package/dist/type/queryAggregate.js +0 -1
- package/dist/type/queryRaw.d.ts +0 -1
- package/dist/type/queryRaw.js +0 -1
- package/dist/type/queryWhere.d.ts +0 -1
- package/dist/type/queryWhere.js +0 -1
- package/dist/type/universalQuerier.d.ts +0 -1
- package/dist/type/universalQuerier.js +0 -1
- package/dist/type/utility.d.ts +0 -1
- package/dist/type/utility.js +0 -1
- package/dist/type/vector.d.ts +0 -1
- package/dist/type/vector.js +0 -1
- package/dist/util/dialect.util.d.ts +8 -2
- package/dist/util/dialect.util.js +16 -1
- package/dist/util/field.util.d.ts +0 -1
- package/dist/util/field.util.js +0 -1
- package/dist/util/filters.util.d.ts +0 -1
- package/dist/util/filters.util.js +0 -1
- package/dist/util/hook.util.d.ts +0 -1
- package/dist/util/hook.util.js +0 -1
- package/dist/util/index.d.ts +0 -1
- package/dist/util/index.js +0 -1
- package/dist/util/logger.d.ts +0 -1
- package/dist/util/logger.js +0 -1
- package/dist/util/object.util.d.ts +0 -1
- package/dist/util/object.util.js +0 -1
- package/dist/util/raw.d.ts +0 -1
- package/dist/util/raw.js +0 -1
- package/dist/util/relationQuery.util.d.ts +0 -1
- package/dist/util/relationQuery.util.js +0 -1
- package/dist/util/sql.util.d.ts +0 -1
- package/dist/util/sql.util.js +0 -1
- package/dist/util/sqlLiteral.d.ts +19 -0
- package/dist/util/sqlLiteral.js +108 -0
- package/dist/util/string.util.d.ts +0 -1
- package/dist/util/string.util.js +0 -1
- package/package.json +43 -26
- package/CHANGELOG.md +0 -1359
- package/dist/browser/http/bus.d.ts.map +0 -1
- package/dist/browser/http/bus.js.map +0 -1
- package/dist/browser/http/http.d.ts.map +0 -1
- package/dist/browser/http/http.js.map +0 -1
- package/dist/browser/http/index.d.ts.map +0 -1
- package/dist/browser/http/index.js.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/options.d.ts.map +0 -1
- package/dist/browser/options.js.map +0 -1
- package/dist/browser/querier/httpQuerier.d.ts.map +0 -1
- package/dist/browser/querier/httpQuerier.js.map +0 -1
- package/dist/browser/querier/index.d.ts.map +0 -1
- package/dist/browser/querier/index.js.map +0 -1
- package/dist/browser/type/clientQuerier.d.ts.map +0 -1
- package/dist/browser/type/clientQuerier.js.map +0 -1
- package/dist/browser/type/clientQuerierPool.d.ts.map +0 -1
- package/dist/browser/type/clientQuerierPool.js.map +0 -1
- package/dist/browser/type/index.d.ts.map +0 -1
- package/dist/browser/type/index.js.map +0 -1
- package/dist/browser/type/request.d.ts.map +0 -1
- package/dist/browser/type/request.js.map +0 -1
- package/dist/bunSql/bunSql.util.d.ts.map +0 -1
- package/dist/bunSql/bunSql.util.js.map +0 -1
- package/dist/bunSql/bunSqlCockroachDialect.d.ts.map +0 -1
- package/dist/bunSql/bunSqlCockroachDialect.js.map +0 -1
- package/dist/bunSql/bunSqlPostgresDialect.d.ts.map +0 -1
- package/dist/bunSql/bunSqlPostgresDialect.js.map +0 -1
- package/dist/bunSql/bunSqlQuerier.d.ts.map +0 -1
- package/dist/bunSql/bunSqlQuerier.js.map +0 -1
- package/dist/bunSql/bunSqlQuerierPool.d.ts.map +0 -1
- package/dist/bunSql/bunSqlQuerierPool.js.map +0 -1
- package/dist/bunSql/bunSqliteDialect.d.ts.map +0 -1
- package/dist/bunSql/bunSqliteDialect.js.map +0 -1
- package/dist/bunSql/index.d.ts.map +0 -1
- package/dist/bunSql/index.js.map +0 -1
- package/dist/cockroachdb/cockroachDialect.d.ts.map +0 -1
- package/dist/cockroachdb/cockroachDialect.js.map +0 -1
- package/dist/cockroachdb/crdbQuerier.d.ts.map +0 -1
- package/dist/cockroachdb/crdbQuerier.js.map +0 -1
- package/dist/cockroachdb/crdbQuerierPool.d.ts.map +0 -1
- package/dist/cockroachdb/crdbQuerierPool.js.map +0 -1
- package/dist/cockroachdb/index.d.ts.map +0 -1
- package/dist/cockroachdb/index.js.map +0 -1
- package/dist/context/context.browser.d.ts.map +0 -1
- package/dist/context/context.browser.js.map +0 -1
- package/dist/context/context.d.ts.map +0 -1
- package/dist/context/context.js.map +0 -1
- package/dist/context/securityError.d.ts.map +0 -1
- package/dist/context/securityError.js.map +0 -1
- package/dist/d1/d1Querier.d.ts.map +0 -1
- package/dist/d1/d1Querier.js.map +0 -1
- package/dist/d1/d1QuerierPool.d.ts.map +0 -1
- package/dist/d1/d1QuerierPool.js.map +0 -1
- package/dist/d1/d1SqliteDialect.d.ts.map +0 -1
- package/dist/d1/d1SqliteDialect.js.map +0 -1
- package/dist/d1/index.d.ts.map +0 -1
- package/dist/d1/index.js.map +0 -1
- package/dist/dialect/abstractDialect.d.ts.map +0 -1
- package/dist/dialect/abstractDialect.js.map +0 -1
- package/dist/dialect/abstractSqlDialect.d.ts.map +0 -1
- package/dist/dialect/abstractSqlDialect.js.map +0 -1
- package/dist/dialect/index.d.ts.map +0 -1
- package/dist/dialect/index.js.map +0 -1
- package/dist/dialect/jsonArrayElemMatchUtils.d.ts.map +0 -1
- package/dist/dialect/jsonArrayElemMatchUtils.js.map +0 -1
- package/dist/dialect/jsonSql.d.ts.map +0 -1
- package/dist/dialect/jsonSql.js.map +0 -1
- package/dist/dialect/mysqlLikeSqlDialect.d.ts.map +0 -1
- package/dist/dialect/mysqlLikeSqlDialect.js.map +0 -1
- package/dist/dialect/pgLikeSqlDialect.d.ts.map +0 -1
- package/dist/dialect/pgLikeSqlDialect.js.map +0 -1
- package/dist/dialect/queryContext.d.ts.map +0 -1
- package/dist/dialect/queryContext.js.map +0 -1
- package/dist/dialect/vectorSqlDialect.d.ts.map +0 -1
- package/dist/dialect/vectorSqlDialect.js.map +0 -1
- package/dist/entity/decorator/entity.d.ts.map +0 -1
- package/dist/entity/decorator/entity.js.map +0 -1
- package/dist/entity/decorator/field.d.ts.map +0 -1
- package/dist/entity/decorator/field.js.map +0 -1
- package/dist/entity/decorator/filter.d.ts.map +0 -1
- package/dist/entity/decorator/filter.js.map +0 -1
- package/dist/entity/decorator/hook.d.ts.map +0 -1
- package/dist/entity/decorator/hook.js.map +0 -1
- package/dist/entity/decorator/id.d.ts.map +0 -1
- package/dist/entity/decorator/id.js.map +0 -1
- package/dist/entity/decorator/index-decorator.d.ts.map +0 -1
- package/dist/entity/decorator/index-decorator.js.map +0 -1
- package/dist/entity/decorator/index.d.ts.map +0 -1
- package/dist/entity/decorator/index.js.map +0 -1
- package/dist/entity/decorator/relation.d.ts.map +0 -1
- package/dist/entity/decorator/relation.js.map +0 -1
- package/dist/entity/index.d.ts.map +0 -1
- package/dist/entity/index.js.map +0 -1
- package/dist/entity/metadata/definition.d.ts.map +0 -1
- package/dist/entity/metadata/definition.js.map +0 -1
- package/dist/entity/test-helpers.d.ts +0 -4
- package/dist/entity/test-helpers.d.ts.map +0 -1
- package/dist/entity/test-helpers.js +0 -16
- package/dist/entity/test-helpers.js.map +0 -1
- package/dist/express/index.d.ts.map +0 -1
- package/dist/express/index.js.map +0 -1
- package/dist/express/querierMiddleware.d.ts.map +0 -1
- package/dist/express/querierMiddleware.js.map +0 -1
- package/dist/http/contract.d.ts.map +0 -1
- package/dist/http/contract.js.map +0 -1
- package/dist/http/fetchHandler.d.ts.map +0 -1
- package/dist/http/fetchHandler.js.map +0 -1
- package/dist/http/handler.d.ts.map +0 -1
- package/dist/http/handler.js.map +0 -1
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js.map +0 -1
- package/dist/http/query.d.ts.map +0 -1
- package/dist/http/query.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/libsql/index.d.ts.map +0 -1
- package/dist/libsql/index.js.map +0 -1
- package/dist/libsql/libsqlDialect.d.ts.map +0 -1
- package/dist/libsql/libsqlDialect.js.map +0 -1
- package/dist/libsql/libsqlQuerier.d.ts.map +0 -1
- package/dist/libsql/libsqlQuerier.js.map +0 -1
- package/dist/libsql/libsqlQuerierPool.d.ts.map +0 -1
- package/dist/libsql/libsqlQuerierPool.js.map +0 -1
- package/dist/maria/index.d.ts.map +0 -1
- package/dist/maria/index.js.map +0 -1
- package/dist/maria/mariaDialect.d.ts.map +0 -1
- package/dist/maria/mariaDialect.js.map +0 -1
- package/dist/maria/mariadbQuerier.d.ts.map +0 -1
- package/dist/maria/mariadbQuerier.js.map +0 -1
- package/dist/maria/mariadbQuerierPool.d.ts.map +0 -1
- package/dist/maria/mariadbQuerierPool.js.map +0 -1
- package/dist/migrate/acquireQuerierForMigrations.d.ts.map +0 -1
- package/dist/migrate/acquireQuerierForMigrations.js.map +0 -1
- package/dist/migrate/assertCliConfig.d.ts.map +0 -1
- package/dist/migrate/assertCliConfig.js.map +0 -1
- package/dist/migrate/bin.d.ts.map +0 -1
- package/dist/migrate/bin.js.map +0 -1
- package/dist/migrate/builder/columnBuilder.d.ts.map +0 -1
- package/dist/migrate/builder/columnBuilder.js.map +0 -1
- package/dist/migrate/builder/expressions.d.ts.map +0 -1
- package/dist/migrate/builder/expressions.js.map +0 -1
- package/dist/migrate/builder/index.d.ts.map +0 -1
- package/dist/migrate/builder/index.js.map +0 -1
- package/dist/migrate/builder/migrationBuilder.d.ts.map +0 -1
- package/dist/migrate/builder/migrationBuilder.js.map +0 -1
- package/dist/migrate/builder/splitSqlStatements.d.ts.map +0 -1
- package/dist/migrate/builder/splitSqlStatements.js.map +0 -1
- package/dist/migrate/builder/tableBuilder.d.ts.map +0 -1
- package/dist/migrate/builder/tableBuilder.js.map +0 -1
- package/dist/migrate/builder/types.d.ts.map +0 -1
- package/dist/migrate/builder/types.js.map +0 -1
- package/dist/migrate/cli-config.d.ts.map +0 -1
- package/dist/migrate/cli-config.js.map +0 -1
- package/dist/migrate/cli.d.ts.map +0 -1
- package/dist/migrate/cli.js.map +0 -1
- package/dist/migrate/codegen/entityCodeGenerator.d.ts.map +0 -1
- package/dist/migrate/codegen/entityCodeGenerator.js.map +0 -1
- package/dist/migrate/codegen/entityMerger.d.ts.map +0 -1
- package/dist/migrate/codegen/entityMerger.js.map +0 -1
- package/dist/migrate/codegen/index.d.ts.map +0 -1
- package/dist/migrate/codegen/index.js.map +0 -1
- package/dist/migrate/codegen/migrationCodeGenerator.d.ts.map +0 -1
- package/dist/migrate/codegen/migrationCodeGenerator.js.map +0 -1
- package/dist/migrate/codegen/migrationFile.d.ts.map +0 -1
- package/dist/migrate/codegen/migrationFile.js.map +0 -1
- package/dist/migrate/codegen/smartRelationDetector.d.ts.map +0 -1
- package/dist/migrate/codegen/smartRelationDetector.js.map +0 -1
- package/dist/migrate/drift/driftDetector.d.ts.map +0 -1
- package/dist/migrate/drift/driftDetector.js.map +0 -1
- package/dist/migrate/drift/index.d.ts.map +0 -1
- package/dist/migrate/drift/index.js.map +0 -1
- package/dist/migrate/generator/index.d.ts.map +0 -1
- package/dist/migrate/generator/index.js.map +0 -1
- package/dist/migrate/generator/mongoSchemaGenerator.d.ts.map +0 -1
- package/dist/migrate/generator/mongoSchemaGenerator.js.map +0 -1
- package/dist/migrate/index.d.ts.map +0 -1
- package/dist/migrate/index.js.map +0 -1
- package/dist/migrate/introspection/abstractSqlSchemaIntrospector.d.ts.map +0 -1
- package/dist/migrate/introspection/abstractSqlSchemaIntrospector.js.map +0 -1
- package/dist/migrate/introspection/baseSqlIntrospector.d.ts.map +0 -1
- package/dist/migrate/introspection/baseSqlIntrospector.js.map +0 -1
- package/dist/migrate/introspection/index.d.ts.map +0 -1
- package/dist/migrate/introspection/index.js.map +0 -1
- package/dist/migrate/introspection/mongoIntrospector.d.ts.map +0 -1
- package/dist/migrate/introspection/mongoIntrospector.js.map +0 -1
- package/dist/migrate/introspection/mysqlIntrospector.d.ts.map +0 -1
- package/dist/migrate/introspection/mysqlIntrospector.js.map +0 -1
- package/dist/migrate/introspection/postgresIntrospector.d.ts.map +0 -1
- package/dist/migrate/introspection/postgresIntrospector.js.map +0 -1
- package/dist/migrate/introspection/sqliteIntrospector.d.ts.map +0 -1
- package/dist/migrate/introspection/sqliteIntrospector.js.map +0 -1
- package/dist/migrate/migrator.d.ts.map +0 -1
- package/dist/migrate/migrator.js.map +0 -1
- package/dist/migrate/schemaGenerator.d.ts.map +0 -1
- package/dist/migrate/schemaGenerator.js.map +0 -1
- package/dist/migrate/schemaGeneratorAsync.d.ts.map +0 -1
- package/dist/migrate/schemaGeneratorAsync.js.map +0 -1
- package/dist/migrate/storage/databaseStorage.d.ts.map +0 -1
- package/dist/migrate/storage/databaseStorage.js.map +0 -1
- package/dist/migrate/storage/index.d.ts.map +0 -1
- package/dist/migrate/storage/index.js.map +0 -1
- package/dist/migrate/storage/jsonStorage.d.ts.map +0 -1
- package/dist/migrate/storage/jsonStorage.js.map +0 -1
- package/dist/migrate/sync/index.d.ts.map +0 -1
- package/dist/migrate/sync/index.js.map +0 -1
- package/dist/migrate/sync/schemaSync.d.ts.map +0 -1
- package/dist/migrate/sync/schemaSync.js.map +0 -1
- package/dist/mongo/index.d.ts.map +0 -1
- package/dist/mongo/index.js.map +0 -1
- package/dist/mongo/mongoDialect.d.ts.map +0 -1
- package/dist/mongo/mongoDialect.js.map +0 -1
- package/dist/mongo/mongodbNativeDialect.d.ts.map +0 -1
- package/dist/mongo/mongodbNativeDialect.js.map +0 -1
- package/dist/mongo/mongodbQuerier.d.ts.map +0 -1
- package/dist/mongo/mongodbQuerier.js.map +0 -1
- package/dist/mongo/mongodbQuerierPool.d.ts.map +0 -1
- package/dist/mongo/mongodbQuerierPool.js.map +0 -1
- package/dist/mysql/index.d.ts.map +0 -1
- package/dist/mysql/index.js.map +0 -1
- package/dist/mysql/mysql2Dialect.d.ts.map +0 -1
- package/dist/mysql/mysql2Dialect.js.map +0 -1
- package/dist/mysql/mysql2Querier.d.ts.map +0 -1
- package/dist/mysql/mysql2Querier.js.map +0 -1
- package/dist/mysql/mysql2QuerierPool.d.ts.map +0 -1
- package/dist/mysql/mysql2QuerierPool.js.map +0 -1
- package/dist/mysql/mysqlDialect.d.ts.map +0 -1
- package/dist/mysql/mysqlDialect.js.map +0 -1
- package/dist/namingStrategy/defaultNamingStrategy.d.ts.map +0 -1
- package/dist/namingStrategy/defaultNamingStrategy.js.map +0 -1
- package/dist/namingStrategy/index.d.ts.map +0 -1
- package/dist/namingStrategy/index.js.map +0 -1
- package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts.map +0 -1
- package/dist/namingStrategy/snakeCaseNamingStrategy.js.map +0 -1
- package/dist/neon/index.d.ts.map +0 -1
- package/dist/neon/index.js.map +0 -1
- package/dist/neon/neonDialect.d.ts.map +0 -1
- package/dist/neon/neonDialect.js.map +0 -1
- package/dist/neon/neonQuerier.d.ts.map +0 -1
- package/dist/neon/neonQuerier.js.map +0 -1
- package/dist/neon/neonQuerierPool.d.ts.map +0 -1
- package/dist/neon/neonQuerierPool.js.map +0 -1
- package/dist/nestjs/index.d.ts.map +0 -1
- package/dist/nestjs/index.js.map +0 -1
- package/dist/nestjs/uqlContextInterceptor.d.ts.map +0 -1
- package/dist/nestjs/uqlContextInterceptor.js.map +0 -1
- package/dist/nestjs/uqlModule.d.ts.map +0 -1
- package/dist/nestjs/uqlModule.js.map +0 -1
- package/dist/options.d.ts.map +0 -1
- package/dist/options.js.map +0 -1
- package/dist/postgres/abstractPgQuerier.d.ts.map +0 -1
- package/dist/postgres/abstractPgQuerier.js.map +0 -1
- package/dist/postgres/abstractPgQuerierPool.d.ts.map +0 -1
- package/dist/postgres/abstractPgQuerierPool.js.map +0 -1
- package/dist/postgres/index.d.ts.map +0 -1
- package/dist/postgres/index.js.map +0 -1
- package/dist/postgres/pgDialect.d.ts.map +0 -1
- package/dist/postgres/pgDialect.js.map +0 -1
- package/dist/postgres/pgQuerier.d.ts.map +0 -1
- package/dist/postgres/pgQuerier.js.map +0 -1
- package/dist/postgres/pgQuerierPool.d.ts.map +0 -1
- package/dist/postgres/pgQuerierPool.js.map +0 -1
- package/dist/postgres/postgresDialect.d.ts.map +0 -1
- package/dist/postgres/postgresDialect.js.map +0 -1
- package/dist/postgres/postgresWireDriverCapabilities.d.ts.map +0 -1
- package/dist/postgres/postgresWireDriverCapabilities.js.map +0 -1
- package/dist/querier/abstractPoolQuerier.d.ts.map +0 -1
- package/dist/querier/abstractPoolQuerier.js.map +0 -1
- package/dist/querier/abstractQuerier.d.ts.map +0 -1
- package/dist/querier/abstractQuerier.js.map +0 -1
- package/dist/querier/abstractQuerierPool.d.ts.map +0 -1
- package/dist/querier/abstractQuerierPool.js.map +0 -1
- package/dist/querier/abstractSqlQuerier.d.ts.map +0 -1
- package/dist/querier/abstractSqlQuerier.js.map +0 -1
- package/dist/querier/abstractSqlQuerierPool.d.ts.map +0 -1
- package/dist/querier/abstractSqlQuerierPool.js.map +0 -1
- package/dist/querier/decorator/index.d.ts.map +0 -1
- package/dist/querier/decorator/index.js.map +0 -1
- package/dist/querier/decorator/injectQuerier.d.ts.map +0 -1
- package/dist/querier/decorator/injectQuerier.js.map +0 -1
- package/dist/querier/decorator/log.d.ts.map +0 -1
- package/dist/querier/decorator/log.js.map +0 -1
- package/dist/querier/decorator/serialized.d.ts.map +0 -1
- package/dist/querier/decorator/serialized.js.map +0 -1
- package/dist/querier/decorator/transactional.d.ts.map +0 -1
- package/dist/querier/decorator/transactional.js.map +0 -1
- package/dist/querier/index.d.ts.map +0 -1
- package/dist/querier/index.js.map +0 -1
- package/dist/schema/canonicalType.d.ts.map +0 -1
- package/dist/schema/canonicalType.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/schemaAST.d.ts.map +0 -1
- package/dist/schema/schemaAST.js.map +0 -1
- package/dist/schema/schemaASTBuilder.d.ts.map +0 -1
- package/dist/schema/schemaASTBuilder.js.map +0 -1
- package/dist/schema/schemaASTDiffer.d.ts.map +0 -1
- package/dist/schema/schemaASTDiffer.js.map +0 -1
- package/dist/schema/types.d.ts.map +0 -1
- package/dist/schema/types.js.map +0 -1
- package/dist/sqlite/abstractSqliteQuerier.d.ts.map +0 -1
- package/dist/sqlite/abstractSqliteQuerier.js.map +0 -1
- package/dist/sqlite/betterSqlite3Dialect.d.ts.map +0 -1
- package/dist/sqlite/betterSqlite3Dialect.js.map +0 -1
- package/dist/sqlite/index.d.ts.map +0 -1
- package/dist/sqlite/index.js.map +0 -1
- package/dist/sqlite/sqliteDialect.d.ts.map +0 -1
- package/dist/sqlite/sqliteDialect.js.map +0 -1
- package/dist/sqlite/sqliteQuerier.d.ts.map +0 -1
- package/dist/sqlite/sqliteQuerier.js.map +0 -1
- package/dist/sqlite/sqliteQuerierPool.d.ts.map +0 -1
- package/dist/sqlite/sqliteQuerierPool.js.map +0 -1
- package/dist/type/config.d.ts.map +0 -1
- package/dist/type/config.js.map +0 -1
- package/dist/type/dialect.d.ts.map +0 -1
- package/dist/type/dialect.js.map +0 -1
- package/dist/type/entity.d.ts.map +0 -1
- package/dist/type/entity.js.map +0 -1
- package/dist/type/index.d.ts.map +0 -1
- package/dist/type/index.js.map +0 -1
- package/dist/type/logger.d.ts.map +0 -1
- package/dist/type/logger.js.map +0 -1
- package/dist/type/migration.d.ts.map +0 -1
- package/dist/type/migration.js.map +0 -1
- package/dist/type/migratorDialect.d.ts.map +0 -1
- package/dist/type/migratorDialect.js.map +0 -1
- package/dist/type/namingStrategy.d.ts.map +0 -1
- package/dist/type/namingStrategy.js.map +0 -1
- package/dist/type/querier.d.ts.map +0 -1
- package/dist/type/querier.js.map +0 -1
- package/dist/type/querierPool.d.ts.map +0 -1
- package/dist/type/querierPool.js.map +0 -1
- package/dist/type/query.d.ts.map +0 -1
- package/dist/type/query.js.map +0 -1
- package/dist/type/queryAggregate.d.ts.map +0 -1
- package/dist/type/queryAggregate.js.map +0 -1
- package/dist/type/queryRaw.d.ts.map +0 -1
- package/dist/type/queryRaw.js.map +0 -1
- package/dist/type/queryWhere.d.ts.map +0 -1
- package/dist/type/queryWhere.js.map +0 -1
- package/dist/type/universalQuerier.d.ts.map +0 -1
- package/dist/type/universalQuerier.js.map +0 -1
- package/dist/type/utility.d.ts.map +0 -1
- package/dist/type/utility.js.map +0 -1
- package/dist/type/vector.d.ts.map +0 -1
- package/dist/type/vector.js.map +0 -1
- package/dist/util/ansiSqlLiteral.d.ts +0 -23
- package/dist/util/ansiSqlLiteral.d.ts.map +0 -1
- package/dist/util/ansiSqlLiteral.js +0 -105
- package/dist/util/ansiSqlLiteral.js.map +0 -1
- package/dist/util/dialect.util.d.ts.map +0 -1
- package/dist/util/dialect.util.js.map +0 -1
- package/dist/util/field.util.d.ts.map +0 -1
- package/dist/util/field.util.js.map +0 -1
- package/dist/util/filters.util.d.ts.map +0 -1
- package/dist/util/filters.util.js.map +0 -1
- package/dist/util/hook.util.d.ts.map +0 -1
- package/dist/util/hook.util.js.map +0 -1
- package/dist/util/index.d.ts.map +0 -1
- package/dist/util/index.js.map +0 -1
- package/dist/util/logger.d.ts.map +0 -1
- package/dist/util/logger.js.map +0 -1
- package/dist/util/object.util.d.ts.map +0 -1
- package/dist/util/object.util.js.map +0 -1
- package/dist/util/raw.d.ts.map +0 -1
- package/dist/util/raw.js.map +0 -1
- package/dist/util/relationQuery.util.d.ts.map +0 -1
- package/dist/util/relationQuery.util.js.map +0 -1
- package/dist/util/sql.util.d.ts.map +0 -1
- package/dist/util/sql.util.js.map +0 -1
- package/dist/util/string.util.d.ts.map +0 -1
- package/dist/util/string.util.js.map +0 -1
package/CHANGELOG.md
DELETED
|
@@ -1,1359 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. Please add new changes to the top, be clear and concise.
|
|
4
|
-
|
|
5
|
-
date format is [yyyy-mm-dd]
|
|
6
|
-
|
|
7
|
-
## [0.20.2] - 2026-07-29
|
|
8
|
-
|
|
9
|
-
### Fixes
|
|
10
|
-
|
|
11
|
-
- **`uql drift:check` reported column type drift as "in sync".** The report compares each type rendered as the dialect's SQL, but the CLI built it without passing the dialect, so every type formatted as `unknown` and compared equal to every other one. A column that is `VARCHAR(50)` in the entity and `INTEGER` in the database now reports a critical type mismatch and exits `1`, instead of passing silently.
|
|
12
|
-
|
|
13
|
-
### Internal
|
|
14
|
-
|
|
15
|
-
- Test coverage raised to 98.5% statements / 93.7% branches (thresholds bumped to match), covering behaviors that previously had none: entity lifecycle hooks (`@BeforeInsert` and friends) executing through a querier, JSON column hydration through populated relations, safe-mode sync never dropping a column or index, `generate:from-db` entity emission, and the introspector's foreign-key/index AST building.
|
|
16
|
-
|
|
17
|
-
## [0.20.1] - 2026-07-27
|
|
18
|
-
|
|
19
|
-
### Fixes
|
|
20
|
-
|
|
21
|
-
- **A `security: true` filter on a joined (m1/11) relation was skipped by `$populate` with no explicit `$where` on it, on every driver. ** Now we enforced unconditionally, same as an explicit `$where` already was.
|
|
22
|
-
- **PostgreSQL/CockroachDB: `$size` misbound its value when it wasn't the first condition in `$where`.** `{ name: 'Acme', tags: { $size: 3 } }` reused placeholder `$1` for both conditions.
|
|
23
|
-
- **PostgreSQL/CockroachDB: `upsertOne`/`upsertMany` bound the wrong value to the 2nd+ auto-filled `onUpdate` column omitted from the payload.**
|
|
24
|
-
- **SQLite/MySQL/MariaDB: a nested `$elemMatch` on an array-of-arrays field could return zero rows instead of the matching ones** (only reachable by bypassing the type system - no typed query is affected).
|
|
25
|
-
|
|
26
|
-
## [0.20.0] - 2026-07-26
|
|
27
|
-
|
|
28
|
-
### `$merge` renamed to `$set` (breaking)
|
|
29
|
-
|
|
30
|
-
"Merge" was misleading: the operator is a *shallow*, non-recursive key assignment (`null` stores a null, unlike RFC 7396 merge patch), and UQL already used an actual merge function - `JSON_MERGE_PRESERVE` - for `$push`. `$set` now matches MongoDB's own update `$set` and the `$unset`/`$push`/`$pull` vocabulary around it. `JsonPushFields` is renamed `JsonArrayFields` to match.
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
querier.updateOneById(Company, id, { kind: { $merge: { public: 1 } } }); // before
|
|
34
|
-
querier.updateOneById(Company, id, { kind: { $set: { public: 1 } } }); // after
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### `$pull`: remove elements from a JSON array
|
|
38
|
-
|
|
39
|
-
The counterpart to `$push` - removes every element equal to the given value, on PostgreSQL, CockroachDB, MySQL, MariaDB, SQLite and MongoDB. A `$pull` on an absent key (or `NULL` column) is a no-op: it never creates the key or nulls the document. Operators apply in a fixed order - `$pull` -> `$set` -> `$push` -> `$unset` - so `$pull` and `$push` on the same key atomically replace an element:
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
await querier.updateOneById(Company, id, { kind: { $pull: { tags: 'old' }, $push: { tags: 'new' } } });
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### `$push` semantics unified (breaking)
|
|
46
|
-
|
|
47
|
-
Appending to a missing key now creates the array on every dialect. Previously MariaDB's `JSON_ARRAY_APPEND` returned `NULL` for a missing path and **wrote that `NULL` back, destroying the document**; MySQL silently no-opped. Both now use `JSON_MERGE_PRESERVE`, matching PostgreSQL and SQLite's existing behavior.
|
|
48
|
-
|
|
49
|
-
### MongoDB JSON operators (breaking)
|
|
50
|
-
|
|
51
|
-
`$set`/`$unset`/`$push`/`$pull` now map onto MongoDB's own update operators. Previously they were **written into the document as literal data** - `{ kind: { $push: { tags: 'x' } } }` stored the operator object itself. MongoDB rejects two operators on one path in a single update document, so a payload that needs it is emitted as an aggregation-pipeline update instead, composed in the same `$pull -> $set -> $push -> $unset` order the SQL dialects apply.
|
|
52
|
-
|
|
53
|
-
### Vector indexes must declare their metric (breaking)
|
|
54
|
-
|
|
55
|
-
`distance` is now required for `hnsw`/`ivfflat`/`vector` index types, and rejected for every other type:
|
|
56
|
-
|
|
57
|
-
```ts
|
|
58
|
-
@Index(['embedding'], { type: 'hnsw' }) // compile error: missing distance
|
|
59
|
-
@Index(['embedding'], { type: 'btree', distance: 'cosine' }) // compile error: distance on a non-vector index
|
|
60
|
-
@Index(['embedding'], { type: 'hnsw', distance: 'cosine' }) // ok
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Omitting it silently changed the generated DDL: MariaDB's `DISTANCE=` defaults to euclidean (a cosine query full-scans instead of using the index) and pgvector has no default operator class. MongoDB's `vectorSearch` is exempt (its generator emits no metric).
|
|
64
|
-
|
|
65
|
-
### JSON dot-path and `$elemMatch` querying (fixes)
|
|
66
|
-
|
|
67
|
-
Filtering/sorting by a JSON dot-path (`{ 'kind.tags': { $size: 2 } }`) and matching array elements (`$elemMatch`) now behave consistently across all 8 drivers:
|
|
68
|
-
|
|
69
|
-
- **MySQL/MariaDB dot-paths.** MySQL's `->`/`->>` need a full `'$.path'`, not a bare key (`` `kind`->>'public' `` raised "Invalid JSON path expression"). MariaDB's `$all`/`$size`/`$elemMatch` need `JSON_EXTRACT`, not `->` (a syntax error there).
|
|
70
|
-
- **Typed comparisons.** A JSON scalar now compares in the representation every engine agrees on: numbers numerically, booleans as JSON, strings as text - fixes silent MySQL boolean mismatches (`'true'` vs `1`) and `operator does not exist: text = integer` on typed-parameter drivers. Applies to `$eq`/`$ne`/`$in`/`$nin`, both on dot-paths and inside `$elemMatch`.
|
|
71
|
-
- **`$elemMatch: { count: 5 }` and `$elemMatch: { count: { $eq: 5 } }` are now identical.** The plain-value form used to skip the numeric cast and turn `{ field: null }` into `= NULL` (which never matches).
|
|
72
|
-
- **MongoDB's `$elemMatch`** now translates its inner UQL operators (`$startsWith`, `$ilike`, `$between`, ...) instead of passing them straight to the server, which rejected them as unknown.
|
|
73
|
-
|
|
74
|
-
### Fixes
|
|
75
|
-
|
|
76
|
-
- **`$includes` was case-insensitive on PostgreSQL and CockroachDB** - it rendered as `ILIKE` instead of `LIKE`, because the operator name happens to start with `$i`. `$iincludes` (the actually-case-insensitive one) is unaffected; MySQL/MariaDB/SQLite were never affected, since their `LIKE`/`ILIKE` render identically there.
|
|
77
|
-
- **PostgreSQL full-text search on multi-word queries**: `$text` now uses `websearch_to_tsquery` instead of `to_tsquery`, which raised `syntax error in tsquery` for input it couldn't parse (including a plain two-word search). `$text` also accepts an optional `$config` (e.g. `'english'`).
|
|
78
|
-
- **JSON operators on a `NOT NULL` column** no longer wrap it in `COALESCE`, keeping MySQL 9's partial in-place JSON update applicable.
|
|
79
|
-
- **`$unset` on PostgreSQL** removes all keys with one `- $N::text[]` (one bound parameter) instead of chaining one `-` per key.
|
|
80
|
-
- **`$unset` on an untyped `Json<unknown>` field** was typed `never[]` (no key could be named); it's now `string[]`.
|
|
81
|
-
- **JSON operators on an array payload** (`Json<T[]>`) are now a compile error - none of the four operators is meaningful on an array column (PostgreSQL's `||` would concatenate arrays, `JSON_SET(arr, '$.k', v)` is a no-op on MySQL/SQLite); replace the whole value instead.
|
|
82
|
-
|
|
83
|
-
## [0.19.0] - 2026-07-24
|
|
84
|
-
|
|
85
|
-
### Operators typed per field (breaking)
|
|
86
|
-
|
|
87
|
-
`$where` operators are now gated by field type: string ops (`$like`, `$regex`, `$startsWith`, ...) on strings, ordering ops (`$lt`, `$gt`, `$between`) on comparable types, array ops (`$all`, `$size`, `$elemMatch`) on arrays. Mismatches are compile errors:
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
{ age: { $like: '3%' } } // string op on a number
|
|
91
|
-
{ active: { $between: [0, 1] } } // ordering op on a boolean
|
|
92
|
-
{ name: { $size: 3 } } // array op on a string
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Typed JSON dot-paths (breaking)
|
|
96
|
-
|
|
97
|
-
`$where`/`$sort` dot-paths are restricted to real `Json<T>` fields and resolve each path's value type, so a typo'd path (`'settings.thme'`) or a mismatched value/operator is a compile error. `Json<unknown>` fields stay permissive. Previously any dotted key compiled with an `unknown` value.
|
|
98
|
-
|
|
99
|
-
### New
|
|
100
|
-
|
|
101
|
-
- **Raw `$select` projections** for computed columns (SQL dialects only): `$select: [raw('*'), raw('LOG10("votes" + 1)', 'hotness')]`.
|
|
102
|
-
|
|
103
|
-
## [0.18.0] - 2026-07-23
|
|
104
|
-
|
|
105
|
-
### DISTINCT aggregates
|
|
106
|
-
|
|
107
|
-
- **New `$countDistinct` / `$sumDistinct` / `$avgDistinct` aggregate ops**, e.g. `$agg: { uniques: { $countDistinct: 'email' } }` → `COUNT(DISTINCT "email")`. Identical across all SQL dialects and MongoDB (compiled to `$addToSet` + a `$project` reducer).
|
|
108
|
-
|
|
109
|
-
### Fixes
|
|
110
|
-
|
|
111
|
-
- **`$count: 'field'` now counts non-null values on MongoDB**, matching SQL `COUNT("field")`. Previously MongoDB counted every row regardless of the field.
|
|
112
|
-
|
|
113
|
-
### Stricter aggregate types
|
|
114
|
-
|
|
115
|
-
- `'*'` is accepted only by `$count` (not `$sum`/`$avg`/etc.), and each `$agg` entry must hold exactly one operation - both are now compile errors.
|
|
116
|
-
|
|
117
|
-
## [0.17.1] - 2026-07-20
|
|
118
|
-
|
|
119
|
-
### Simpler, more consistent logging options (breaking)
|
|
120
|
-
|
|
121
|
-
- **`slowQuery` is now a plain number**, not a wrapper object: `slowQuery: { threshold: 200 }` becomes `slowQuery: 200`.
|
|
122
|
-
- **`logParams` is renamed `logValues` and moved out of `slowQuery`.** It's a top-level option (`ExtraOptions`/`MigratorOptions`) that now applies to regular query logging too, not just slow-query alerts - previously there was no way to redact bound values from regular `query`-level logs at all.
|
|
123
|
-
- **`logValues` now defaults to `false`.** Bound values may hold PII, so they're no longer logged unless you opt in with `logValues: true`.
|
|
124
|
-
- **`QueryError.values` can now be attached too.** With `logValues: true`, a failing query's error carries its bound values, not just `.query` - 0.17.0 attached `.query` only, unconditionally never `.values`.
|
|
125
|
-
|
|
126
|
-
```ts
|
|
127
|
-
// before
|
|
128
|
-
{ logger: true, slowQuery: { threshold: 200, logParams: false } }
|
|
129
|
-
// after (values already omitted by default; only needed if you want them back)
|
|
130
|
-
{ logger: true, slowQuery: 200 }
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Fixes
|
|
134
|
-
|
|
135
|
-
- **`findManyStream` errors now carry the failing SQL too.** The `.query` enrichment added in 0.17.0 covered `all()`/`run()`/`findMany()`/etc., but streamed queries slipped through since they don't go through the same code path - a bad column or missing table in `findManyStream` now surfaces `.query` on the error just like every other method.
|
|
136
|
-
- **Transaction statements (`BEGIN`/`COMMIT`/`ROLLBACK`) also carry `.query` now.** Same gap as `findManyStream` - they call the driver directly rather than through `all()`/`run()`, so a failed isolation level or commit previously threw with no query context at all.
|
|
137
|
-
|
|
138
|
-
## [0.17.0] - 2026-07-19
|
|
139
|
-
|
|
140
|
-
### Stricter, simpler query types (breaking)
|
|
141
|
-
|
|
142
|
-
- **Typo'd query keys are now compile errors.** Find methods take a concrete query type, so an unknown key in `$select`/`$where`/`$populate`/`$sort` fails to compile - previously a typo sitting next to a valid field slipped through.
|
|
143
|
-
- **Find results are the plain entity.** `findMany`/`findOne`/etc. no longer auto-type the vector-search distance field; annotate the result with the exported `WithDistance<Article, 'distance'>` when you `$project` a score.
|
|
144
|
-
- **`$having` values are typed per column.** A `$min`/`$max` over a non-numeric column now compares against that column's own type instead of `number`, and a computed aggregate wrongly placed in `$group` (it belongs in `$agg`) is a compile error.
|
|
145
|
-
|
|
146
|
-
SQLite (and LibSQL/Turso, Cloudflare D1, Bun's native SQLite) now use `RETURNING` too, so `insertMany`/`upsertOne`/`upsertMany` return exact IDs there instead of guessed rowids or nothing at all. Also fixes a MySQL bug where `upsertMany` could return IDs that don't exist.
|
|
147
|
-
|
|
148
|
-
### Improvements
|
|
149
|
-
|
|
150
|
-
- **SQLite family native `RETURNING`** - better-sqlite3, LibSQL/Turso, Cloudflare D1, and Bun SQL's SQLite mode all get exact per-row IDs on `insertOne`/`insertMany`, and `upsertOne`/`upsertMany` now return real IDs where they previously returned nothing.
|
|
151
|
-
- **MongoDB `upsertMany` returns IDs** - `ids`/`firstId` now cover newly-inserted documents, matching `insertOne`/`insertMany`/`upsertOne`.
|
|
152
|
-
|
|
153
|
-
### Fixes
|
|
154
|
-
|
|
155
|
-
- **MySQL `upsertMany` could return IDs that don't exist.** A batch mixing an insert and an update reports `changes` as a weighted sum (1 for the insert, 2 for the update), which the old code mistook for a row count and used to guess sequential IDs - some of which were never real rows. `upsertMany` now reports only `changes` for a multi-row batch on MySQL; a single-row `upsertOne` is unaffected.
|
|
156
|
-
- **LibSQL: releasing with an open transaction now throws** instead of silently discarding it, matching every other SQL adapter.
|
|
157
|
-
- **Query errors now carry the failing SQL.** A thrown error from `all()`/`run()`/`findMany()`/etc. now has `.query` attached (the SQL text, or method name for non-SQL calls), even without a logger configured. Bound values are intentionally never attached, to avoid leaking sensitive parameters into error trackers.
|
|
158
|
-
|
|
159
|
-
## [0.16.0] - 2026-07-19
|
|
160
|
-
|
|
161
|
-
### Type-safe aggregate API: `$group` + `$agg` (breaking)
|
|
162
|
-
|
|
163
|
-
`aggregate()` now separates grouping from computed columns. `$group` lists the columns to group by (typed against the entity, like `$select`); `$agg` holds the aggregate functions. This makes the whole query typo-proof - a bad group-by column, aggregated field, or `$having`/`$sort` alias is a compile error instead of a runtime SQL failure.
|
|
164
|
-
|
|
165
|
-
```ts
|
|
166
|
-
// before
|
|
167
|
-
$group: { status: true, count: { $count: '*' } }
|
|
168
|
-
// after
|
|
169
|
-
$group: { status: true },
|
|
170
|
-
$agg: { count: { $count: '*' } }
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
`$having` and `$sort` keys are now restricted to the grouped columns and computed aliases. An aggregate with neither `$group` nor `$agg` throws a clear error instead of emitting invalid SQL.
|
|
174
|
-
|
|
175
|
-
## [0.15.6] - 2026-07-12
|
|
176
|
-
|
|
177
|
-
### Improvements in type-safety
|
|
178
|
-
|
|
179
|
-
- **`findOneById` result inference** - now infers projected vector-distance fields from `$sort`/`$project`, matching `findOne`/`findMany` (e.g. `$project: 'distance'` → `Entity & { distance: number }`).
|
|
180
|
-
|
|
181
|
-
### Fixes in types
|
|
182
|
-
|
|
183
|
-
- **`findOneById` no longer mutates the passed query object.**
|
|
184
|
-
- **Browser client `findManyAndCount`** - the response now guarantees a numeric `count`.
|
|
185
|
-
|
|
186
|
-
## [0.15.5] - 2026-07-12
|
|
187
|
-
|
|
188
|
-
### Performance
|
|
189
|
-
|
|
190
|
-
Query building is leaner on the paths that run for every query. Same SQL out, no behavior change, just pure optimizations while keeping code lean and maintainable.
|
|
191
|
-
|
|
192
|
-
## [0.15.4] - 2026-07-11
|
|
193
|
-
|
|
194
|
-
### Fixes
|
|
195
|
-
|
|
196
|
-
- **Stricter operator/sort/aggregate validation** - an unrecognized `$where`/`$having` operator or `$group` aggregate function now always throws a clear error instead of silently being ignored (or, for `$group`, ending up in the generated SQL). Affects all SQL dialects and MongoDB. Breaking: `$sort` direction must be the number `-1`/`1` or the string `'asc'`/`'desc'` - a numeric string like `'-1'` happened to work before and now throws.
|
|
197
|
-
- **MariaDB vector index distance** - creating a vector index with a distance metric MariaDB doesn't support silently built the index with `euclidean` instead of erroring. Now throws a clear error instead.
|
|
198
|
-
|
|
199
|
-
## [0.15.3] - 2026-07-11
|
|
200
|
-
|
|
201
|
-
CockroachDB integration tests added, fixing upsert, ID generation, and `$text` search, and adding full vector search support. Two related Bun SQL driver bugs (CockroachDB JSON updates, MariaDB upsert `created`) are also fixed.
|
|
202
|
-
|
|
203
|
-
### Features
|
|
204
|
-
|
|
205
|
-
- **CockroachDB vector search** - `$sort`/`$vector` uses the same pgvector-compatible distance operators as Postgres for `cosine`/`l2`/`inner` (`<=>`/`<->`/`<#>`), and schema generation emits CockroachDB's native `CREATE VECTOR INDEX` syntax. `l1`/`hamming` and the `halfvec`/`sparsevec` types aren't implemented by CockroachDB itself, so those now throw a clear error instead of failing at the database.
|
|
206
|
-
|
|
207
|
-
### Fixes
|
|
208
|
-
|
|
209
|
-
- **CockroachDB `upsertOne` / `upsertMany`** - previously errored with `column "xmax" does not exist`; now works, with `created` always `undefined` (CockroachDB has no insert-vs-update signal).
|
|
210
|
-
- **CockroachDB auto-generated IDs** - the default primary key used `SERIAL` (CockroachDB's `unique_rowid()`), producing values beyond `Number.MAX_SAFE_INTEGER` that get corrupted as JS numbers. Now uses a sequential `IDENTITY` column instead.
|
|
211
|
-
- **CockroachDB `$text` search** - now generates `to_tsvector`/`to_tsquery`, which CockroachDB supports.
|
|
212
|
-
- **CockroachDB via Bun SQL** - `$merge`/`$push` on a JSONB column could silently corrupt the value or throw, since it didn't get the same wire-encoding fix Postgres has on the Bun driver. Fixed.
|
|
213
|
-
- **MariaDB via Bun SQL** - upsert's `created` could report `false` on a fresh insert; now correctly `undefined`.
|
|
214
|
-
|
|
215
|
-
## [0.15.2] - 2026-07-10
|
|
216
|
-
|
|
217
|
-
`insertOne` / `insertMany` now return the right IDs on every database (and `undefined` instead of a made-up one when the driver reports none), a batch may mix records with different columns, and oversized batches are split automatically to stay under the driver's bind-parameter limit.
|
|
218
|
-
|
|
219
|
-
### Improvements / unifications
|
|
220
|
-
|
|
221
|
-
- **Heterogeneous batch inserts** - records may carry different columns; UQL inserts the union and fills each gap with the column default (`DEFAULT`, or `NULL` on SQLite). An explicit id is kept; an omitted one takes the default:
|
|
222
|
-
|
|
223
|
-
```ts
|
|
224
|
-
await querier.insertMany(User, [{ name: 'Ada', email: 'ada@uql-orm.dev' }, { name: 'Alan' }]);
|
|
225
|
-
// one INSERT; Alan's missing email uses its default → ids [1, 2]
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
- **Automatic chunking** - batches past the driver's bind limit (PostgreSQL/MySQL 65535, SQLite 32766, D1 100) split into several `INSERT`s, IDs still in input order. Wrap in a transaction for all-or-nothing across splits.
|
|
229
|
-
|
|
230
|
-
- **MariaDB native `INSERT ... RETURNING`** - an exact id per row, not the first-id-plus-offset guess other tools use on MariaDB.
|
|
231
|
-
|
|
232
|
-
- **Clustered MySQL `auto_increment_increment` detected automatically** - a stride > 1 stays correct (`[10, 12, 14]`, not `[10, 11, 12]`); probed once per connection, only when inferring batch IDs.
|
|
233
|
-
|
|
234
|
-
### Fixes
|
|
235
|
-
|
|
236
|
-
- **No fabricated IDs** - a DB-generated key with no `onInsert` (e.g. a `@Id()` string/UUID column) now returns `undefined` instead of invented `0, 1, 2…` / SQLite rowids. Supplied IDs and `@Id({ onInsert })` values are unchanged.
|
|
237
|
-
- **Mixed batches** - explicit and auto-increment IDs in one batch: provided IDs return as-is, generated ones exact on `RETURNING` dialects, `undefined` (never misaligned) elsewhere:
|
|
238
|
-
|
|
239
|
-
```ts
|
|
240
|
-
await querier.insertMany(User, [{ name: 'a' }, { id: 5000, name: 'b' }, { name: 'c' }]);
|
|
241
|
-
// PostgreSQL/MariaDB → [1, 5000, 2] · MySQL/SQLite → [undefined, 5000, undefined]
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
## [0.15.1] - 2026-07-09
|
|
245
|
-
|
|
246
|
-
Semantic-search reads no longer need a cast: the read methods now infer the distance field you project with `$sort` and hand it back on the result type.
|
|
247
|
-
|
|
248
|
-
### Features
|
|
249
|
-
|
|
250
|
-
- **`$project` distance is inferred into the result** - a vector `$sort` with `$project: 'distance'` now types the rows as `(Article & { distance: number })[]` straight from the call, so the old `as WithDistance<...>` cast is gone:
|
|
251
|
-
|
|
252
|
-
```ts
|
|
253
|
-
const results = await pool.findMany(Article, {
|
|
254
|
-
$sort: { embedding: { $vector: queryEmbedding, $project: 'distance' } },
|
|
255
|
-
});
|
|
256
|
-
results[0].distance; // number, inferred - no cast
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
This works on `findMany`, `findOne`, `findManyStream`, and `findManyAndCount`, on both the querier and the pool. It reads the `$project` string literal off the query with a `const` type parameter - the same trick `aggregate` already uses - so queries that don't project are untouched and still return plain `E[]`. Only top-level `$sort` projections are inferred, which is exactly what the SQL and Atlas builders emit. `WithDistance<E, K>` is still exported for the rare query whose `$project` key is computed at runtime instead of written as a literal.
|
|
260
|
-
|
|
261
|
-
## [0.15.0] - 2026-07-09
|
|
262
|
-
|
|
263
|
-
Pool-level query methods: each call acquires its own querier, runs the single operation, and releases it, so `Promise.all` fans out across connections without ceremony - the same default as Sequelize/TypeORM/Prisma. (Single-connection backends - better-sqlite3, Bun sqlite, D1 - stay correct but serialize on their one connection.)
|
|
264
|
-
|
|
265
|
-
### Breaking
|
|
266
|
-
|
|
267
|
-
- **Pool base-class generics are now querier-first**, matching the `QuerierPool<Q, D>` interface they implement: `AbstractQuerierPool<Q, D>` (was `<D, Q>`), `AbstractSqlQuerierPool<Q, D>`, and `AbstractPgQuerierPool<C, Q, D>` (was `<C, D, Q>`). Only custom pool subclasses and explicit type annotations are affected - swap the two arguments; runtime behavior is unchanged.
|
|
268
|
-
|
|
269
|
-
### Features
|
|
270
|
-
|
|
271
|
-
- **Read helpers on the pool** - `pool.findMany` / `pool.findOne` / `pool.findOneById` / `pool.findManyAndCount` / `pool.count` / `pool.aggregate`:
|
|
272
|
-
|
|
273
|
-
```ts
|
|
274
|
-
// Two connections, in parallel:
|
|
275
|
-
const [invoices, total] = await Promise.all([pool.findMany(Invoice, { $where: { paid: false } }), pool.count(Invoice, {})]);
|
|
276
|
-
|
|
277
|
-
// vs. one pinned connection (queries queue) - still the right tool for a unit of work:
|
|
278
|
-
await pool.withQuerier((q) => Promise.all([q.findMany(Invoice, {}), q.count(Invoice, {})]));
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
The ambient `withContext` still scopes these (so `security` filters apply). They take the entity-as-argument form; for the `{ $entity }` form, multi-statement work, or streaming, use `withQuerier` / `transaction`.
|
|
282
|
-
|
|
283
|
-
- **Raw SQL on SQL pools** - `pool.all(sql, values)` / `pool.run(sql, values)`, with the same connection-per-call semantics. Raw SQL bypasses query generation, so it is not scoped by `security` filters.
|
|
284
|
-
|
|
285
|
-
- **Types** - the pool surfaces are *derived* from the querier contracts (`QuerierPool extends Pick<UniversalQuerier, ...reads>`, `SqlQuerierPool extends Pick<SqlQuerier, 'all' | 'run'>`), so they cannot drift. To support this, `UniversalQuerier`'s read and update signatures gained the trailing `opts?: QueryOptions` that `Querier` already declared - a non-breaking widening.
|
|
286
|
-
|
|
287
|
-
### Fixes
|
|
288
|
-
|
|
289
|
-
- **`Sqlite3QuerierPool` hands out a querier per acquisition** (sharing the single database handle) instead of one memoized querier, so transaction state is per unit of work like every other pool. Previously, a pool-level unit of work started while a transaction was open (e.g. a pool read inside `pool.transaction(...)`) received the *same* querier, and its `release()` threw `pending transaction`, rolling back the outer transaction. Covered by new pool integration tests across all backends.
|
|
290
|
-
|
|
291
|
-
## [0.14.1] - 2026-07-09
|
|
292
|
-
|
|
293
|
-
Context ergonomics for event-driven apps (background pipelines, queue consumers, webhooks) - shaped by adopting the multi-tenancy filters in a real multimedia app.
|
|
294
|
-
|
|
295
|
-
### Features
|
|
296
|
-
|
|
297
|
-
- **`captureContext()`** - carry the ambient context across event boundaries. `AsyncLocalStorage` does not propagate into emitter callbacks, timers, or queued work, so capture it once and replay it where the callback fires:
|
|
298
|
-
|
|
299
|
-
```ts
|
|
300
|
-
const scoped = captureContext(); // e.g. when a session/queue item is created inside a scoped request
|
|
301
|
-
emitter.on('chunk', (chunk) => scoped(() => saveChunk(chunk))); // runs with the captured context
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
- **Context per unit of work** - `pool.withQuerier(callback, { context })` and `pool.transaction(callback, { context })` run one unit of work under the given context. Same mechanism as `withContext`, picked by scope: `withContext` scopes a span (a request, a whole job); `{ context }` scopes a single pool call - flat and explicit for pipeline code that knows its tenant locally:
|
|
305
|
-
|
|
306
|
-
```ts
|
|
307
|
-
await pool.withQuerier((q) => q.findMany(Invoice, {}), { context: { tenantId } });
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
- **Trusted cross-tenant work with security filters** - a filter condition may now return `{}` to mean "resolved: no restriction", so maintenance jobs that must span all tenants (startup recovery, cleanup sweeps) can run under an explicit system context. A missing context still fails closed, and previously a `{}` condition generated broken SQL:
|
|
311
|
-
|
|
312
|
-
```ts
|
|
313
|
-
condition: (ctx) => (ctx?.system ? {} : ctx?.tenantId != null ? { companyId: ctx.tenantId } : undefined),
|
|
314
|
-
|
|
315
|
-
await withContext({ system: true }, () => recoverStaleJobs()); // spans every tenant, deliberately
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
- **Auto-fill the tenant column on insert** (documented pattern, works out of the box): `@Field({ onInsert: () => getContext()?.tenantId })` fills the field from the ambient context when the payload does not provide it - explicit values still win.
|
|
319
|
-
|
|
320
|
-
## [0.14.0] - 2026-07-08
|
|
321
|
-
|
|
322
|
-
Query filters, multi-tenancy / row-level security, and soft-delete restore. Upgrade straight from 0.12.0 - 0.13.0 was pulled before anyone could install it (its root import dragged `node:async_hooks` into browser bundles), so 0.14.0 is the first published build of these features and bundles cleanly on the client again.
|
|
323
|
-
|
|
324
|
-
### Features
|
|
325
|
-
|
|
326
|
-
- **Query filters** - attach a named condition to an entity and it applies to every query automatically until you turn it off. Great for "active only" or visibility rules:
|
|
327
|
-
|
|
328
|
-
```ts
|
|
329
|
-
@Filter('active', { condition: { status: 'active' }, default: false })
|
|
330
|
-
@Entity()
|
|
331
|
-
class Task {}
|
|
332
|
-
|
|
333
|
-
querier.findMany(Task, {}, { filters: { active: true } }); // on for this call
|
|
334
|
-
querier.findMany(Task, {}, { filters: false }); // all filters off
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
- **Multi-tenancy / row-level security** - mark a filter `security` and resolve it from a per-request context. It applies to every query (relations and cascades included), can't be turned off, and a client can't widen it with their own `$where`:
|
|
338
|
-
|
|
339
|
-
```ts
|
|
340
|
-
@Filter('tenant', {
|
|
341
|
-
// no tenant in context -> the query throws instead of running unscoped
|
|
342
|
-
condition: (ctx) => (ctx?.tenantId != null ? { companyId: ctx.tenantId } : undefined),
|
|
343
|
-
security: true,
|
|
344
|
-
})
|
|
345
|
-
@Entity()
|
|
346
|
-
class Invoice {}
|
|
347
|
-
|
|
348
|
-
await withContext({ tenantId }, () => querier.findMany(Invoice, {}));
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
Set the context once at the HTTP boundary and every request is scoped automatically:
|
|
352
|
-
|
|
353
|
-
```ts
|
|
354
|
-
createRequestHandler({ getContext: (req) => ({ tenantId: req.user.tenantId }) });
|
|
355
|
-
// NestJS: UqlModule.forRoot({ pool, getContext: (req) => ({ tenantId: req.user.tenantId }) })
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
- **Restore soft-deleted rows** - `restoreOneById` / `restoreMany` bring rows back. Include trashed rows in any read with `withDeleted()`, or list only trashed ones with a plain query (`{ $where: { deletedAt: { $ne: null } } }`). Reads and updates take an options argument now too, so these toggles work on every operation, not just delete.
|
|
359
|
-
|
|
360
|
-
- **NestJS `forRootAsync`** - build the pool from injected providers such as `ConfigService`.
|
|
361
|
-
|
|
362
|
-
### Breaking Changes
|
|
363
|
-
|
|
364
|
-
- **Permanent deletes now use `hardDelete`** (was `{ softDelete: false }`). With a soft-delete field, delete soft-deletes by default; pass `{ hardDelete: true }` to remove rows for good. Over HTTP, `DELETE ?hardDelete=true` (was `?softDelete=true`):
|
|
365
|
-
|
|
366
|
-
```ts
|
|
367
|
-
await querier.deleteOneById(User, id); // soft delete
|
|
368
|
-
await querier.deleteOneById(User, id, { hardDelete: true }); // permanent
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### Bug Fixes
|
|
372
|
-
|
|
373
|
-
- Soft-delete now works on **subclasses** that inherit the soft-delete field from a base entity.
|
|
374
|
-
- A cascading delete no longer throws when a related entity isn't soft-deletable - it's removed instead; MongoDB delete behavior now matches SQL.
|
|
375
|
-
|
|
376
|
-
## [0.12.0] - 2026-07-06
|
|
377
|
-
|
|
378
|
-
### Breaking Changes
|
|
379
|
-
|
|
380
|
-
- **`softDelete` moves from `@Entity` to `@Field`.** Mark the field itself - `@Field({ softDelete: true })` - instead of naming it on the entity (`@Entity({ softDelete: 'deletedAt' })`). This makes the field reference typo-proof (it's the decorated property, not a string) and lets the marker carry the value stamped on delete: `true` stamps the current timestamp (`new Date()`), or pass a callback for anything else, e.g. `@Field({ softDelete: () => Date.now() })` for an epoch-millis column. The stamp goes through the same value formatter as `onInsert`/`onUpdate`, so a `QueryRaw` (e.g. `() => raw(() => 'NOW()')`) is emitted inline. At most one field per entity may be marked. Reads still filter deleted rows via `<field> IS NULL`, and the `deleteMany(..., { softDelete })` query option is unchanged.
|
|
381
|
-
|
|
382
|
-
## [0.11.0] - 2026-07-06
|
|
383
|
-
|
|
384
|
-
### Breaking Changes
|
|
385
|
-
|
|
386
|
-
- **`softDelete` is configured by field name instead of `boolean`**: use `@Entity({ softDelete: 'deletedAt' })` - naming the timestamp field - instead of `@Entity({ softDelete: true })` paired with `@Field({ onDelete: Date.now })`. On delete, the named field is stamped with `Date.now()`.
|
|
387
|
-
- **Removed `onDelete` and `foreignKey` from `@Field` options** (`FieldOptions`). `onDelete` was only a soft-delete marker, now superseded by the entity-level `softDelete` above; `foreignKey` was non-functional (never read) - foreign keys are derived from `references`/relations.
|
|
388
|
-
|
|
389
|
-
### Features
|
|
390
|
-
|
|
391
|
-
- **Foreign-key columns are auto-created from relations**: declaring an owning relation (e.g. `@ManyToOne({ entity: () => Company })`) without an explicit `@Field({ references })` now auto-generates the `<relation>Id` column in metadata, inheriting the referenced primary key's type (e.g. `UUID`) rather than defaulting to an integer. Declaring the FK field explicitly (needed to query/read it by name in typed code) still works and takes precedence.
|
|
392
|
-
|
|
393
|
-
## [0.10.2] - 2026-07-05
|
|
394
|
-
|
|
395
|
-
### Bug Fixes
|
|
396
|
-
|
|
397
|
-
- **Dropped idle connections no longer crash the process**: `pg`-based pools (Postgres, CockroachDB, Neon) now handle the pool's `'error'` event instead of leaving it unhandled. Postgres and CockroachDB also default to `keepAlive: true`, so idle connections drop less often to begin with.
|
|
398
|
-
- **Foreign key columns now match their referenced primary key type**: `@Field({ references: () => User })` with no explicit `type` fell back to the TypeScript property type (e.g. `string` -> TEXT) instead of `User`'s actual primary key type (e.g. `UUID`), which could fail inserts and joins. Explicit types are still respected.
|
|
399
|
-
|
|
400
|
-
## [0.10.1] - 2026-07-03
|
|
401
|
-
|
|
402
|
-
### Features
|
|
403
|
-
|
|
404
|
-
- **`UqlModule` ends the pool on application shutdown** (`onApplicationShutdown`), so Nest testing modules and SIGTERM-driven shutdowns release database connections; call `app.enableShutdownHooks()` to wire signals.
|
|
405
|
-
|
|
406
|
-
### Bug Fixes
|
|
407
|
-
|
|
408
|
-
- **`uql-orm@0.10.0` on npm shipped only the browser bundle** (5 files; `dist/index.js` missing, so every server-side import failed). The package build shared the repo root's `tsBuildInfoFile` (introduced 2026-06-29 in an unrelated config cleanup): after `clean` wiped `dist`, `tsc -b` trusted the stale build info and emitted nothing, and the release published the partial `dist`. The build info is now package-local and the errant root-level one has been removed entirely, restoring the isolation each package had before that cleanup. `prepack` no longer checks two hardcoded files (which would have missed this exact failure - neither covered `uql-orm/migrate`); it now verifies every path declared in `main`, `types`, `bin`, and `exports` exists in `dist` before packing, derived straight from `package.json` so the check can't go stale as exports are added. Use 0.10.1 instead of 0.10.0.
|
|
409
|
-
|
|
410
|
-
## [0.10.0] - 2026-07-02
|
|
411
|
-
|
|
412
|
-
### Breaking Changes
|
|
413
|
-
|
|
414
|
-
- **HTTP transport redesigned around a framework-agnostic core (`uql-orm/http`)**: the wire contract (routes, envelopes, query serialization) is defined once and shared by the server adapters and the browser client; `uql-orm/express` is now a thin adapter over it.
|
|
415
|
-
- **Hooks**: `pre`/`preSave`/`preFilter` receive a single `HookContext` (`{ meta, op, method, query, body, context }`) instead of `(req, meta)`, may be `async`, and abort by throwing (a numeric `status` on the error becomes the HTTP status). Migration is mechanical: `req.query` becomes `ctx.query`, `req.body` becomes `ctx.body`.
|
|
416
|
-
- **Error responses** are now `{ error: { message, code } }` (was `{ error: string }`).
|
|
417
|
-
- **`HttpQuerier.saveOne`** issues `PUT /<entity>` (server-side upsert) instead of client-side POST/PATCH branching.
|
|
418
|
-
- **Removed**: `buildQuerierRouter`, express `parseQuery` (use `parseQueryParams` from `uql-orm/http`), the `express.Request.query` type augmentation, and the browser re-exports of `stringifyQuery` and the envelope types (import them from `uql-orm/http`).
|
|
419
|
-
- **`uql-orm/browser` no longer loads `reflect-metadata`**: import it (or `uql-orm`) directly if you relied on that side effect.
|
|
420
|
-
|
|
421
|
-
### Features
|
|
422
|
-
|
|
423
|
-
- **`uql-orm/http`**: `createFetchHandler` mounts natively on Hono, Next.js route handlers, Bun.serve, Deno.serve, Cloudflare Workers, and SvelteKit; `createRequestHandler` bridges any other framework.
|
|
424
|
-
- **Extended wire protocol**: new routes for `insertMany`, `saveOne` (upsert), `saveMany`, and bulk `updateMany`, with matching `HttpQuerier` methods.
|
|
425
|
-
- **`uql-orm/nestjs`**: `UqlModule.forRoot({ pool })` registers the pool with Nest DI and as UQL's default pool.
|
|
426
|
-
- **HTTP QUERY method (RFC 10008)**: reads can send the JSON query in the request body, avoiding URL-length limits; the client opts in via `new HttpQuerier('/api', { readMethod: 'QUERY' })`.
|
|
427
|
-
- **Better client ergonomics**: per-call and per-instance `headers`, `AbortSignal` support, and non-2xx responses throw `RequestError` carrying the HTTP `status`.
|
|
428
|
-
- **`post` hook**: shape the success envelope before it is sent (strip secrets, derive presentation fields).
|
|
429
|
-
|
|
430
|
-
### Bug Fixes
|
|
431
|
-
|
|
432
|
-
- **The published browser bundle was broken** (it contained test helpers instead of the client); it is now a 4 KB bundle with no `reflect-metadata`.
|
|
433
|
-
- **The express middleware falls through** (`next()`) on unknown routes, so it composes with custom routes on the same prefix.
|
|
434
|
-
- Hooks can now enforce `softDelete`; malformed JSON returns `400` instead of `500`; `HEAD` is served as `GET`; query strings are percent-encoded; `GET /<entity>/:id` merges an array `$where` via `$and` instead of overwriting it.
|
|
435
|
-
|
|
436
|
-
## [0.9.5] - 2026-07-02
|
|
437
|
-
|
|
438
|
-
### Documentation
|
|
439
|
-
|
|
440
|
-
- **README**: Slimmed from 336 to 127 lines as a marketing quick-reference. Added "Why UQL" section, dark mode logo, value proposition, and a minimal 4-line query example aligned to the querier API. Completed the database support list, updated benchmark claims to July 2026, and cleaned up writing style. Updated and simplified entry example of the ORM.
|
|
441
|
-
- **Contributing**: Added `CONTRIBUTING.md` and `CODE_OF_CONDUCT.md`.
|
|
442
|
-
|
|
443
|
-
## [0.9.4] - 2026-06-29
|
|
444
|
-
|
|
445
|
-
### Bug Fixes
|
|
446
|
-
|
|
447
|
-
- **`$entity` dual-API restored**: Querier read/delete methods (`findOne`, `findMany`, `findManyAndCount`, `count`, `deleteMany`, `findManyStream`) now use TypeScript overloads instead of union types, enabling correct entity inference for both `(Entity, query)` and `({ $entity: Entity, ...query })` call patterns.
|
|
448
|
-
- **`$select` / `$exclude` overlap resolved**: Both are now structurally identical map types (`{ [K in FieldKey<E>]?: BooleanLike }`) - whitelist (`$select`) vs. blacklist (`$exclude`). `$exclude` reverted to map form (was incorrectly changed to array), matching runtime `Object.entries()` usage.
|
|
449
|
-
- **`$exclude` JSDoc**: Updated comment from "array of field names" to map syntax `{ name: true }`.
|
|
450
|
-
|
|
451
|
-
### Security
|
|
452
|
-
|
|
453
|
-
- **Comprehensive security tests** (`querySecurity.spec.ts`): 33+ tests covering prototype pollution via `$where`/`$select`/`$exclude`/`$populate`, SQL injection in WHERE values and identifiers, `$skip`/`$limit` coercion edge cases, `$ne`/`$or`/`$in` operator safety, relation field safety, and field validation across all entity types.
|
|
454
|
-
|
|
455
|
-
### [0.9.3] - 2026-06-26
|
|
456
|
-
|
|
457
|
-
### Bug Fixes
|
|
458
|
-
|
|
459
|
-
- **`snakeCase` null pass-through**: Restored `null`/`undefined` passthrough (was collapsed to `''`). `upperFirst`/`lowerFirst` now also guard early on falsy input.
|
|
460
|
-
|
|
461
|
-
### Improvements
|
|
462
|
-
|
|
463
|
-
- **`QueryPopulateRelationOptions` nullable fix**: Uses `NonNullable<E>` so nullable relations (`Profile | null`) correctly infer `QueryUnique<Profile>` rather than `QueryUnique<Profile | null>`.
|
|
464
|
-
- **`JsonFieldPaths` array support**: Now handles arrays of JSON (`Json<T>[]`) for MongoDB.
|
|
465
|
-
|
|
466
|
-
## [0.9.2] - 2026-06-10
|
|
467
|
-
|
|
468
|
-
### Bug Fixes
|
|
469
|
-
|
|
470
|
-
- **Express middleware**: `parseQuery` now correctly coerces `$limit` and `$skip` to numbers and parses JSON-encoded `$where` strings before route handlers run. Previously, Express's lazy `req.query` getter re-parsed the URL on every access, silently discarding the middleware's mutations.
|
|
471
|
-
|
|
472
|
-
### Dependencies
|
|
473
|
-
|
|
474
|
-
- Updated dev and prod dependencies.
|
|
475
|
-
- Docker images bumped: MySQL `9.6` -> `9.7`, MariaDB `12.3-rc` -> `12.3` (now stable).
|
|
476
|
-
|
|
477
|
-
## [0.8.5] - 2026-05-24
|
|
478
|
-
|
|
479
|
-
### Improvements
|
|
480
|
-
|
|
481
|
-
- **`tsconfig.json`**: Added `"strict": true` to the compiler options.
|
|
482
|
-
- **SQLite module**: Re-exported `AbstractSqliteQuerier` from the `uql-orm/sqlite` entry point (`abstractSqliteQuerier.js`).
|
|
483
|
-
|
|
484
|
-
### Dependencies
|
|
485
|
-
|
|
486
|
-
- Updated dev and prod dependencies and fully tested.
|
|
487
|
-
|
|
488
|
-
## [0.8.4] - 2026-04-11
|
|
489
|
-
|
|
490
|
-
### Features
|
|
491
|
-
|
|
492
|
-
- Added first-class `$populate` (relations) and `$exclude` (subtractive scalar projection), while keeping backward compatibility for legacy relation keys in `$select`.
|
|
493
|
-
|
|
494
|
-
### Breaking Changes (Public util surface)
|
|
495
|
-
|
|
496
|
-
- Removed support for specifying relations in `$select`; use `$populate` instead.
|
|
497
|
-
|
|
498
|
-
### Improvements
|
|
499
|
-
|
|
500
|
-
- Populate-only relation loading now works consistently in SQL dialects.
|
|
501
|
-
- Relation keys in `$select` now emit a deduplicated deprecation warning (use `$populate`).
|
|
502
|
-
- `$select` and `$exclude` conflicts are validated recursively, including nested relation queries.
|
|
503
|
-
- `findManyStream` now rejects unsupported relation loading early: **MongoDB** throws if any relation is requested in `$select` / `$populate` (streams use `find` only). **SQL** throws if **to-many** relations are requested (they are filled only after `findMany`, not while streaming).
|
|
504
|
-
|
|
505
|
-
### Documentation
|
|
506
|
-
|
|
507
|
-
- README and docs site clarify projection keys (`$select` / `$exclude` / `$populate`) and streaming behavior across SQL vs MongoDB.
|
|
508
|
-
|
|
509
|
-
## [0.8.3] - 2026-04-04
|
|
510
|
-
|
|
511
|
-
### Improvements
|
|
512
|
-
|
|
513
|
-
- **Robust SQL Statement Splitting**: Refactored the `splitSqlStatements` utility with a high-performance, declarative Master-Regex scanner. This production-grade implementation correctly handles complex SQL syntax across all supported dialects, including nested string literals, escaped quotes (`''`, `\'`), double-quoted identifiers, MySQL backticks, and PostgreSQL dollar-quoting (`$$` and `$tag$`). It also correctly preserves semicolons within single-line (`--`) and multi-line (`/* ... */`) comments while ensuring $O(n)$ performance and full backward compatibility. Covered with full test suite.
|
|
514
|
-
|
|
515
|
-
## [0.8.2] - 2026-04-04
|
|
516
|
-
|
|
517
|
-
### Bug Fixes
|
|
518
|
-
|
|
519
|
-
- **[#86](https://github.com/rogerpadilla/uql/issues/86) - Invalid generated migration TypeScript with LibSQL**: `uql-migrate generate:entities` embedded SQL inside a JS **template literal**; SQLite/LibSQL identifier quotes use **backticks**, which **terminated** the outer literal and produced invalid `.ts` (so `uql-migrate up` could not even load the migration). Generated files now use **`JSON.stringify`** for each `querier.run(...)` argument (double-quoted string literals), so SQL may contain backticks, `"`, newlines, `${` inside string data, etc., without breaking TypeScript.
|
|
520
|
-
|
|
521
|
-
- **[#87](https://github.com/rogerpadilla/uql/issues/87) - `uql-migrate` against libsql + sqld (HTTP) with multiple statements in one `run`**: **sqld** does not accept **multiple SQL statements** in a single `execute` / `run` call; a migration that bundled `CREATE TABLE ...;` and `CREATE INDEX ...;` in one string failed at runtime even when the TypeScript was valid. **Entity-generated migrations** now emit **one `await querier.run("...")` per statement**, and **`Migrator` / `syncForce` / `autoSync` / `MigrationBuilder`** apply create-table DDL **statement-by-statement**, matching sqld's behavior.
|
|
522
|
-
|
|
523
|
-
### Breaking Changes
|
|
524
|
-
|
|
525
|
-
- **`SchemaGenerator` create-table DDL** (supports the [#87](https://github.com/rogerpadilla/uql/issues/87) fix end-to-end): **`generateCreateTable`**, **`generateCreateTableFromNode`**, and **`generateCreateTableFromDefinition`** now return **`string[]`** - one string per logical statement (`CREATE EXTENSION` if needed, `CREATE TABLE`, each separate `CREATE INDEX`, ...). They used to return a **single** newline-joined `string`. **Migrate custom code** by taking the array and either calling `querier.run(stmt)` for each element or using **`.join('\n')`** when you need one script blob. **`MongoSchemaGenerator`** uses the same signatures; each method returns a **one-element** array containing the JSON sync command string.
|
|
526
|
-
|
|
527
|
-
## [0.8.0] - 2026-04-03
|
|
528
|
-
|
|
529
|
-
### Features
|
|
530
|
-
|
|
531
|
-
- **Decorator-free entities**: `defineEntity` accepts optional bulk `fields`, `relations`, `indexes`, and `hooks` on `EntityOptions` (same shapes as `@Field` / relations / `@Index` / hook decorators). Exported `defineEntity`, `defineField`, `defineId`, and `defineRelation` from `uql-orm` for imperative registration. Clarified `Config.entities` discovery comment and README guidance for non-decorator usage. **`EntityIndexMeta.unique`** is optional (omit = non-unique); schema building still normalizes with `?? false` where a strict boolean is required.
|
|
532
|
-
|
|
533
|
-
### Breaking Changes (Internal API)
|
|
534
|
-
|
|
535
|
-
- **Entity metadata registry**: Runtime storage uses `Symbol.for('uql-orm/entity/metadata')` (replaces `uql-orm/entity/decorator`). Code that reached into `globalThis` with the old symbol will not see entities registered under the new key. Deep imports of `.../entity/decorator/definition.js` should use `.../entity/metadata/definition.js`. **`getOrCreateMeta` removed** - use **`ensureMeta`** from the same module if you need imperative "get or init" behavior.
|
|
536
|
-
|
|
537
|
-
## [0.7.10] - 2026-04-02
|
|
538
|
-
|
|
539
|
-
### Bug Fixes
|
|
540
|
-
|
|
541
|
-
- **SQL JSON / JSONB read hydration**: `AbstractSqlQuerier` now parses string values for fields declared as `json` or `jsonb` after `find` results are unflattened, so drivers that return JSON columns as text (e.g. SQLite, some Bun SQL stacks) yield plain objects again. Already-parsed values are left unchanged; invalid JSON strings are kept as-is. Hydration runs for `findMany` / `findOne` paths and for streamed rows, and recurses into loaded relation objects with cycle protection (`WeakSet`).
|
|
542
|
-
|
|
543
|
-
### Tests
|
|
544
|
-
|
|
545
|
-
- **Regression**: JSONB `$merge` with boolean `true` and `false` on `Company.kind` (integration suite); Postgres dialect expectation for `$merge` with `isArchived: false`.
|
|
546
|
-
|
|
547
|
-
## [0.7.9] - 2026-03-31
|
|
548
|
-
|
|
549
|
-
### Breaking Changes
|
|
550
|
-
- **Dialect barrel**: **`MongoDialect`** is no longer re-exported from **`uql-orm/dialect`** or the root **`uql-orm`** package (it previously pulled the Mongo dialect graph into SQL-only apps). Import it from **`uql-orm/mongo`**.
|
|
551
|
-
- **Migrate and optional `mongodb` peer**: `createSchemaGenerator` is **SQL-only** (returns `undefined` for non-`AbstractSqlDialect`). For MongoDB use **`createSchemaGeneratorAsync`** from `uql-orm/migrate` (or the CLI re-export). **`MongoSchemaGenerator`** is exported from **`uql-orm/mongo`**, not from the `uql-orm/migrate` barrel, so importing migrate alone does not evaluate the Mongo generator graph. **`Migrator.findEntityForTable`** is now **async**. **`getSchemaGenerator`** (CLI) returns **`undefined`** for MongoDB; `uql-migrate` resolves the generator with **`createSchemaGeneratorAsync`**.
|
|
552
|
-
|
|
553
|
-
## [0.7.7] - 2026-03-31
|
|
554
|
-
|
|
555
|
-
### Breaking Changes (Internal API)
|
|
556
|
-
- **Pools and config**: `QuerierPool` exposes `dialect` (renamed from `dialectInstance`). The engine id string is `dialect.dialectName` (replacing the old `dialect` property on the dialect instance). Removed top-level `dialect` from `Config` and `MigratorOptions`-migrations and `uql-migrate` use **`pool.dialect.dialectName`** only.
|
|
557
|
-
- **Dialect API**: Removed `dialectConfig` / `DialectConfig` from the public dialect barrel. Configure behavior with `DialectOptions`, `DialectFeatures` on `AbstractDialect.features`, and **per-driver dialect classes** attached to each pool.
|
|
558
|
-
|
|
559
|
-
### Improvements
|
|
560
|
-
|
|
561
|
-
- **Per-driver dialect classes**: Pools use explicit dialect types (e.g. `PgDialect`, `NeonDialect`, `MySql2Dialect`, `BetterSqlite3Dialect`, `LibsqlDialect`, `D1SqliteDialect`, `MongodbNativeDialect`, `BunSqlPostgresDialect`). Migrator and schema generation read **`pool.dialect.dialectName`** instead of a separate config field.
|
|
562
|
-
- **PostgreSQL (`pg` vs Bun SQL)**: `PgDialect` uses base Postgres defaults (native JS arrays for `ANY`/`ALL`, `$n::jsonb` for JSON). Bun SQL Postgres uses `BunSqlPostgresDialect` with `POSTGRES_WIRE_DRIVER_CAPABILITIES` from `uql-orm/postgres/wireCapabilities` plus `explicitJsonCast` where Bun's bindings require `( $n::text )::jsonb` and array literal encoding.
|
|
563
|
-
- **Migrations CLI**: Exported **`assertCliConfig`** (`uql-orm/migrate`) validates the default-exported config shape before commands run.
|
|
564
|
-
- **Escaping**: Inlined **`escapeAnsiSqlLiteral`** for Postgres/SQLite literal escaping; dropped **`sqlstring-sqlite`** from those code paths. Prefer bound parameters for user input in production.
|
|
565
|
-
- **Types and tests**: `Config.pool` is typed as `QuerierPool<Querier, AbstractDialect>`. **`createMockQuerierPool`** is available from `uql-orm/test`.
|
|
566
|
-
|
|
567
|
-
## [0.7.6] - 2026-03-31
|
|
568
|
-
### Improvements
|
|
569
|
-
- **Bulletproof Postgres JSONB Serialization**: We've standardized how JSONB data travels to the database to ensure absolute reliability. By handling stringification at the ORM level and using explicit Postgres casts (`::text::jsonb`), we've eliminated subtle ambiguities between JSON arrays and native Postgres arrays. This ensures your data always arrives exactly as intended.
|
|
570
|
-
- **Unified Driver Experience**: Whether you're running on `node-postgres` or the high-performance `bun:sql`, the behavior is now identical. This refactor definitively resolves "double-stringification" and "invalid syntax" edge cases, providing a truly seamless experience across all supported environments.
|
|
571
|
-
- **Internal Architectural Polish**: Simplified the core normalization logic in the base SQL dialect, keeping the ORM engine lean while making the Postgres-specific implementation more declarative and easier to maintain.
|
|
572
|
-
|
|
573
|
-
## [0.7.5] - 2026-03-29
|
|
574
|
-
### New Features
|
|
575
|
-
- **Type-Safe Aggregate Inference**: Enhanced `querier.aggregate()` to automatically infer return types from the `$group` definition. Aggregate results (e.g. `$sum`, `$avg`, `$max`) are now precisely typed without requiring manual casts or `any`.
|
|
576
|
-
- **Centralized Dialect Features**: Introduced a declarative `DialectFeatures` system to manage database capabilities (e.g. `supportsJsonb`, `returning`, `ifNotExists`).
|
|
577
|
-
|
|
578
|
-
### Improvements
|
|
579
|
-
- **Dialect Architecture Hardening**: Replaced brittle runtime dialect-name checks with formal feature flags across the codebase.
|
|
580
|
-
- **Immutability**: Marked all dialect configuration and feature properties as `readonly` for increased runtime stability.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
## [0.7.4] - 2026-03-28
|
|
584
|
-
### Bug Fixes
|
|
585
|
-
- **Module Imports**: Fixed an issue where the `index.js` barrels incorrectly exported driver-specific querier pools (like `mariadbQuerierPool`), which caused the module bundler/runtime to attempt to load optional peer dependencies (like `mariadb`) when importing unrelated modules from `uql-orm`.
|
|
586
|
-
|
|
587
|
-
## [0.7.3] - 2026-03-26
|
|
588
|
-
### Bug Fixes
|
|
589
|
-
- **Bun SQL Dialect Inference**: Improved logic for detecting `sqlite` from URLs and handling custom schemes in `SQL.Options`.
|
|
590
|
-
- **Schema Synchronization**: Added null-safety check in `formatType` to prevent crashes when encountering specific user-defined column types.
|
|
591
|
-
|
|
592
|
-
## [0.7.2] - 2026-03-22
|
|
593
|
-
### Bug Fixes
|
|
594
|
-
- **MySQL/MariaDB Upsert Detection**: Fine-tuned the `created` flag detection by correctly interpreting the MySQL `affectedRows` convention (1 for insert, 2 for update, 0 for no-op).
|
|
595
|
-
- **Express Route ID Resolution**: Removed rigid `req.params.id` string-bindings in autogenerated API endpoints. Routes now correctly infer and map dynamic parameters utilizing the `meta.id` schema definition, increasing type-safety drastically.
|
|
596
|
-
|
|
597
|
-
## [0.7.1] - 2026-03-21
|
|
598
|
-
### Improvements
|
|
599
|
-
- **Standardized Architecture**: Unified `PrimaryKey` type and improved `buildUpdateResult` for precise batch-insert ID mapping.
|
|
600
|
-
- **Dialect parameter normalization**: `QueryDialect.normalizeValue` / `normalizeValues` centralize bound-parameter shaping (e.g. Postgres array literals and booleans, JSON stringify for text-JSON columns on SQLite/MySQL-like dialects, `Date` preserved for driver binding). Applied at the querier boundary and in `SqlQueryContext.pushValue` for consistency with Bun SQL and other drivers.
|
|
601
|
-
- **SQL dialect simplification**: Consolidated `$in` / `$nin` formatting via `formatIn` (including empty-array `IN (NULL)` handling), streamlined JSON field conditions (removed redundant config indirection), and unified null-safe `$ne` through `neExpr` / `havingCondition`.
|
|
602
|
-
- **Bun SQL Resilience**: SQLite uses an unpooled handle when Bun does not support `reserve()`; reserved connections use `await release()` where required.
|
|
603
|
-
- **Dialect inference**: Improved Bun URL handling (`:memory:`, `mysql2://`, `sqlite3://`, `postgresql://`, etc.).
|
|
604
|
-
|
|
605
|
-
## [0.7.0] - 2026-03-19
|
|
606
|
-
### New Features
|
|
607
|
-
- **Bun SQL Support**: Added a first-class adapter for Bun's unified `sql` driver (`uql-orm/bunSql`). A single `BunSqlQuerierPool` infers the UQL dialect from `SQL.Options` (URL, `adapter`, or `filename`) and routes SQL generation to PostgreSQL, MySQL, MariaDB, SQLite, or CockroachDB ASTs. Includes dialect-aware option normalization (`inferDialect`, `normalizeBunOpts`), row/insert-id normalization for Bun result shapes, and a minimal `pool.query` shim for pg-compatible consumers.
|
|
608
|
-
|
|
609
|
-
### Breaking Changes
|
|
610
|
-
- **`$ne` is null-safe everywhere**: Non-null `$ne` now uses dialect-native null-safe inequality so rows with `NULL` in the compared column are included when they differ from the bound value (PostgreSQL/CockroachDB: `IS DISTINCT FROM`; SQLite: `IS NOT`; MySQL/MariaDB: `NOT (col <=> ?)`). This matches typical ORM expectations and fixes subtle "missing rows" bugs versus plain `<>` SQL. Queries that relied on SQL's three-valued logic excluding `NULL` from `$ne` matches may return more rows; use `{$ne: null}` / `$isNull` / `$isNotNull` explicitly for null-only filters.
|
|
611
|
-
|
|
612
|
-
### Security
|
|
613
|
-
- **SQL Injection Prevention for JSON**: Hardened JSON-path operators across all SQL dialects with strict identifier and key escaping.
|
|
614
|
-
|
|
615
|
-
## [0.6.1] - 2026-03-18
|
|
616
|
-
### Chore
|
|
617
|
-
- **Documentation**: Improve intro of readme.md
|
|
618
|
-
|
|
619
|
-
## [0.6.0] - 2026-03-18
|
|
620
|
-
### Features
|
|
621
|
-
- **JSON update operators expanded**: Added `$push` for atomic JSON array append in update payloads across SQL dialects.
|
|
622
|
-
- **Unified JSON update API type**: Introduced `JsonUpdateOp` with type-safe `$merge`, `$unset`, and `$push` support for `Json<T>` fields.
|
|
623
|
-
|
|
624
|
-
### Bug Fixes
|
|
625
|
-
- **MariaDB JSON dot-notation correctness**: Fixed JSON path extraction for MariaDB by using `JSON_VALUE(...)` instead of MySQL-style `->` / `->>` operators.
|
|
626
|
-
- **PostgreSQL operator chaining semantics**: Fixed `$merge + $push` evaluation when targeting the same key so `$push` reads from the current intermediate expression (not stale column state).
|
|
627
|
-
|
|
628
|
-
### Testing
|
|
629
|
-
- Added multi-dialect regression tests for JSON update chaining (`$merge`, `$push`, `$unset`), including same-key `$merge + $push` behavior.
|
|
630
|
-
- Added MariaDB-specific regression tests for dot-notation filtering/sorting SQL generation (`JSON_VALUE` paths).
|
|
631
|
-
|
|
632
|
-
## [0.5.2] - 2026-03-17
|
|
633
|
-
### Testing
|
|
634
|
-
- **Suite reliability**: Ensured the full test suite runs without runtime errors across all dialects with coverage thresholds still met (>97% statements, >90% branches).
|
|
635
|
-
|
|
636
|
-
## [0.5.1] - 2026-03-15
|
|
637
|
-
### Chore
|
|
638
|
-
- **Documentation**: Unified documentation strategy using NPM lifecycle scripts across subpackages.
|
|
639
|
-
- **Maintenance**: Removed redundant `copyfiles` dependency and cleaned up build scripts.
|
|
640
|
-
- **README**: Refined technical copy and visual feedback sections for a better developer documentation experience.
|
|
641
|
-
|
|
642
|
-
## [0.5.0] - 2026-03-15
|
|
643
|
-
### Features
|
|
644
|
-
- **CockroachDB Support**: Full integration with a new dialect, querier, and Docker Compose configuration. Supports native upsert and mapped driver execution.
|
|
645
|
-
### New Features
|
|
646
|
-
- **CockroachDB Support**: Added first-class support for `cockroachdb` dialect, leveraging its PostgreSQL wire-compatibility. Includes native `upsert` support and seamlessly mapped driver execution.
|
|
647
|
-
|
|
648
|
-
### Testing
|
|
649
|
-
- **Vector search integration tests**: Added 7 end-to-end tests for `findMany` with `$sort: { $vector }` against a real Postgres+pgvector database - covers cosine/L2 similarity ordering, `$project` distance projection, filter+sort combo, `$limit`, and empty-table edge case.
|
|
650
|
-
- Docker Postgres image switched to `pgvector/pgvector:pg18` for pgvector extension support.
|
|
651
|
-
- Test DDL generator now handles `vector`, `halfvec`, and `sparsevec` column types.
|
|
652
|
-
|
|
653
|
-
## [0.4.4] - 2026-03-14
|
|
654
|
-
### Dependencies
|
|
655
|
-
- **Vite 7 -> 8**: Upgraded to Vite 8 (powered by Rolldown), replacing the `vite-tsconfig-paths` plugin with Vite's built-in `resolve.tsconfigPaths` option.
|
|
656
|
-
- **TypeScript 5.9 -> 6.0**: Upgraded to TypeScript 6.0.1-rc. Removed 6 redundant compiler options now default in TS6: `strict`, `strictNullChecks`, `noImplicitAny`, `esModuleInterop`, `allowSyntheticDefaultImports`, `useDefineForClassFields`.
|
|
657
|
-
- Removed `vite-tsconfig-paths` (replaced by built-in Vite 8 feature).
|
|
658
|
-
|
|
659
|
-
## [0.4.1] - 2026-03-13
|
|
660
|
-
### Documentation
|
|
661
|
-
- Removed Discord badge from README temporarily.
|
|
662
|
-
|
|
663
|
-
## [0.4.0] - 2026-03-13
|
|
664
|
-
### New Features
|
|
665
|
-
- **`findManyStream()` - Cursor-Based Async Iteration**: Stream query results row-by-row via `for await...of`. No relation-filling or lifecycle hooks - optimized for raw throughput on large result sets.
|
|
666
|
-
```ts
|
|
667
|
-
for await (const user of querier.findManyStream(User, { $where: { active: true } })) {
|
|
668
|
-
process.stdout.write(user.name + '\n');
|
|
669
|
-
}
|
|
670
|
-
```
|
|
671
|
-
Supports both the classic `(Entity, query)` and `$entity`-field dual-API patterns.
|
|
672
|
-
- **Native Streaming for All Major Drivers**: Each driver now uses its optimal streaming API instead of falling back to `internalAll()`:
|
|
673
|
-
- **SQLite** (`better-sqlite3`): `.iterate()` - sync, zero-copy row iteration.
|
|
674
|
-
- **MongoDB**: `FindCursor` async iterable - native driver cursor with `buildFindCursor` helper (extracted from `findMany` for DRY reuse).
|
|
675
|
-
- **MariaDB**: `queryStream()` - first-class streaming API since v3.0, with backpressure.
|
|
676
|
-
- **PostgreSQL**: `pg-query-stream` - server-side cursors via optional peer dependency.
|
|
677
|
-
- **MySQL2**: `Connection.query().stream()` - Readable stream from non-promise connection.
|
|
678
|
-
- **LibSQL / D1 / Neon**: Graceful fallback to `internalAll()` (HTTP-based, no streaming API).
|
|
679
|
-
|
|
680
|
-
### Breaking Changes
|
|
681
|
-
- **Removed deprecated `reference` field option**: Use `references` instead. The deprecated `FieldOptions.reference` property and its internal usage in `definition.ts` have been removed.
|
|
682
|
-
|
|
683
|
-
## [0.3.3] - 2026-03-12
|
|
684
|
-
### Bug Fixes
|
|
685
|
-
- **Upsert `onUpdate` Semantics**: `onUpdate`-only fields (e.g. `updatedAt`) are no longer included in the `INSERT VALUES` clause of upserts. They now use direct parameter values in the `UPDATE SET` clause, giving correct semantics: newly inserted rows have `updatedAt = NULL`, updated rows get a fresh timestamp.
|
|
686
|
-
|
|
687
|
-
### Improvements
|
|
688
|
-
- **Variadic `pushValue`**: `QueryContext.pushValue()` now accepts multiple values (`...values`), simplifying internal param collection and eliminating `forEach` loops.
|
|
689
|
-
|
|
690
|
-
## [0.3.2] - 2026-03-12
|
|
691
|
-
### Improvements
|
|
692
|
-
- **Upsert `created` Flag**: added `created?: boolean` to `QueryUpdateResult` - `true` when the record was inserted, `false` when updated. Supported on PostgreSQL, MySQL, and MongoDB. Returns `undefined` on SQLite and MariaDB where the driver cannot determine this.
|
|
693
|
-
|
|
694
|
-
### Bug Fixes
|
|
695
|
-
- **MongoDB `upsertOne`**: Fixed `firstId` always being `undefined` on insert by switching from `returnDocument: 'before'` to `returnDocument: 'after'`.
|
|
696
|
-
|
|
697
|
-
### Test Coverage
|
|
698
|
-
- Added dialect-specific `shouldUpsertOne` overrides for all 5 dialects asserting `created` and `firstId` behavior.
|
|
699
|
-
|
|
700
|
-
## [0.3.1] - 2026-03-12
|
|
701
|
-
### New Features
|
|
702
|
-
- **MongoDB Atlas Vector Search**: Semantic search now supports MongoDB via the [`$vectorSearch`](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/) aggregation pipeline stage. Same `$sort` API - UQL internally translates to Atlas's native vector search with optimal pre-filtering (`$where` -> `$vectorSearch.filter`), score projection via `$meta: 'vectorSearchScore'`, and secondary sort support. Configure with `@Index(['embedding'], { type: 'vectorSearch', name: 'my_index' })`.
|
|
703
|
-
|
|
704
|
-
## [0.3.0] - 2026-03-12
|
|
705
|
-
### New Features
|
|
706
|
-
- **Semantic Search**: First-class vector similarity search across PostgreSQL (pgvector), MariaDB, and SQLite. Query via `$sort` on vector fields:
|
|
707
|
-
```ts
|
|
708
|
-
const results = await querier.findMany(Article, {
|
|
709
|
-
$sort: { embedding: { $vector: queryVec, $distance: 'cosine' } },
|
|
710
|
-
$limit: 10,
|
|
711
|
-
});
|
|
712
|
-
```
|
|
713
|
-
Supports 5 distance metrics (`cosine`, `l2`, `inner`, `l1`, `hamming`), distance projection via `$project`, and the `WithDistance<E>` utility type. Each dialect generates native SQL: Postgres operators (`<=>`, `<->`), MariaDB (`VEC_DISTANCE_COSINE()`), SQLite (`vec_distance_cosine()`).
|
|
714
|
-
- **Vector Field Types**: `@Field({ type: 'vector', dimensions: 1536 })` for standard 32-bit embeddings, plus Postgres-specific `'halfvec'` (16-bit, 50% storage savings) and `'sparsevec'` (for SPLADE-style sparse embeddings). Automatic SQL mapping across dialects.
|
|
715
|
-
- **Vector Indexes**: `@Index()` supports HNSW and IVFFlat index types with `distance`, `m`, `efConstruction`, and `lists` options. Generates pgvector operator classes for Postgres, inline `VECTOR INDEX` for MariaDB, and standard indexes for SQLite.
|
|
716
|
-
- **Auto Extension Creation**: Schema generator automatically emits `CREATE EXTENSION IF NOT EXISTS vector` for Postgres tables containing vector columns.
|
|
717
|
-
|
|
718
|
-
### Architecture
|
|
719
|
-
- **Schema Generator Dialect Config Refactor**: Eliminated all `this.dialect ===` branches from `schemaGenerator.ts` by adding new declarative `dialectConfig` properties (`columnComment`, `vectorIndexStyle`, `dropIndexSyntax`, `renameTableSyntax`, `booleanLiteral`, `alterColumnStrategy`, `vectorOpsClass`, `vectorExtension`). All dialect-specific behavior is now config-driven.
|
|
720
|
-
- **Unified CREATE INDEX**: `generateCreateIndexFromNode` now delegates to `generateCreateIndex`, eliminating duplicated SQL assembly and ensuring consistent vector index handling across both code paths.
|
|
721
|
-
|
|
722
|
-
## [0.2.7] - 2026-03-11
|
|
723
|
-
### New Features
|
|
724
|
-
- **More `$size` Comparison Operators**: `$size` now accepts comparison operator objects in addition to exact numbers - e.g. `{ $size: { $gte: 2 } }`, `{ $size: { $gt: 0, $lte: 5 } }`, `{ $size: { $between: [1, 10] } }`. Supported operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$between`.
|
|
725
|
-
- **Relation Count Filtering**: `$size` on to-many relations (OneToMany, ManyToMany) now generates efficient `COUNT(*)` subqueries. E.g. `{ tags: { $size: { $gte: 2 } } }` produces `WHERE (SELECT COUNT(*) FROM ...) >= $1`.
|
|
726
|
-
|
|
727
|
-
### Test Coverage
|
|
728
|
-
- Added 22 new test cases across all SQL dialects: exact match, every comparison operator, multi-op ranges, `$between`, error paths (unsupported operator, missing references). All coverage thresholds met.
|
|
729
|
-
|
|
730
|
-
## [0.2.6] - 2026-03-11
|
|
731
|
-
### Documentation
|
|
732
|
-
- **README - Migrations & Synchronization**: Rewrote the section with an entity-first intro explaining that UQL auto-generates migrations from entities. Reordered CLI commands to lead with `generate:entities`, renumbered usage examples, and added a concrete quick-start snippet.
|
|
733
|
-
|
|
734
|
-
## [0.2.5] - 2026-03-11
|
|
735
|
-
### Branding
|
|
736
|
-
- **New Logo**: Introduced a new cursive "U" logo in indigo (`#4F46E5`). Available in SVG, PNG, and JPG formats under `assets/`.
|
|
737
|
-
|
|
738
|
-
## [0.2.4] - 2026-03-10
|
|
739
|
-
### Bug Fixes
|
|
740
|
-
- **ManyToOne / OneToOne relation filtering**: `$where` clauses referencing `m1` or `11` relations (e.g., `{ item: { name: 'Widget' } }`) now correctly generate `EXISTS` subqueries. Previously, these cardinalities were unhandled and fell through to `compareFieldOperator`, throwing an "unknown operator" error. The `compareRelation` method now supports all four cardinalities (`mm`, `1m`, `m1`, `11`) with direction-aware join resolution.
|
|
741
|
-
|
|
742
|
-
### Test Coverage
|
|
743
|
-
- Added tests for ManyToOne relation filtering: simple equality, operator filter (`$like`), and combined with regular fields.
|
|
744
|
-
|
|
745
|
-
## [0.2.3] - 2026-03-09
|
|
746
|
-
### Documentation
|
|
747
|
-
- **Aggregate Queries guide**: Added dedicated [aggregate documentation page](https://uql-orm.dev/querying/aggregate) covering `$group`, `$having`, `$where` vs `$having`, sorting/pagination, and `$distinct`.
|
|
748
|
-
- **README**: Added Aggregate Queries to features table, new §4 subsection with code examples and generated SQL, and "Learn more" link.
|
|
749
|
-
- **Querier methods table**: Added `aggregate()` to the website's querier reference.
|
|
750
|
-
- **Simplified tsconfig**: Removed `module`/`target` from recommended config - only decorator flags are UQL-specific. Added Pure ESM note.
|
|
751
|
-
|
|
752
|
-
## [0.2.2] - 2026-03-09
|
|
753
|
-
### New Features
|
|
754
|
-
- **Aggregate Query API**: Added `querier.aggregate()` with full support across all SQL dialects and MongoDB. Includes typed `QueryAggregate<E>`, `QueryGroupMap`, `QueryHavingMap`, and `QueryAggregateOp` types. Supports `$group` (with `$count`, `$sum`, `$avg`, `$min`, `$max`), `$having` (post-aggregation filtering with operator support), `$where` (pre-aggregation filtering), `$sort`, `$skip`, and `$limit`.
|
|
755
|
-
```ts
|
|
756
|
-
const results = await querier.aggregate(Order, {
|
|
757
|
-
$group: { status: true, total: { $sum: 'amount' }, count: { $count: '*' } },
|
|
758
|
-
$having: { count: { $gt: 5 } },
|
|
759
|
-
$sort: { total: -1 },
|
|
760
|
-
});
|
|
761
|
-
```
|
|
762
|
-
- **SQL**: Generates `SELECT ... GROUP BY ... HAVING ... ORDER BY` with proper escaping and parameterization.
|
|
763
|
-
- **MongoDB**: Generates a full aggregation pipeline (`$match -> $group -> $project -> $match -> $sort -> $skip -> $limit`).
|
|
764
|
-
- **`$distinct` support**: Added `$distinct` option to `Query<E>` for `SELECT DISTINCT` queries.
|
|
765
|
-
|
|
766
|
-
### Bug Fixes
|
|
767
|
-
- **Sort direction with numeric `-1`**: `SORT_DIRECTION_MAP` only had the string key `'-1'`, not the numeric `-1` from `QuerySortDirection`. Queries using `$sort: { field: -1 }` silently produced ascending order. Now both numeric and string forms work correctly.
|
|
768
|
-
- **MongoDB sort normalization**: Unified sort direction normalization into `sort()` method, ensuring all callers (find queries and aggregate pipelines) normalize string directions (`'asc'`/`'desc'`) to numeric `1`/`-1` for the MongoDB server.
|
|
769
|
-
|
|
770
|
-
### Type Safety
|
|
771
|
-
- **`QueryAggregateFn` enforces single operation**: Changed from a mapped type (which allowed invalid `{ $count: '*', $sum: 'amount' }`) to a discriminated union that enforces exactly one aggregate op per entry.
|
|
772
|
-
- **HAVING `$in`/`$nin` support**: `havingCondition` now supports `$in` and `$nin` operators (e.g., `HAVING COUNT(*) IN (5, 10)`).
|
|
773
|
-
- **HAVING `$isNull`/`$isNotNull` support**: `havingCondition` now supports null-checking operators (e.g., `HAVING MAX(score) IS NULL`).
|
|
774
|
-
|
|
775
|
-
### Code Quality
|
|
776
|
-
- **`compareFieldOperator` compaction**: Reduced from 142 to 85 lines (−40%) by extracting `COMPARE_OP_MAP` (simple comparison operators), `LIKE_OP_MAP` (8 string/LIKE operators), and unifying `$in`/`$nin` into a single code path.
|
|
777
|
-
- **`saveRelation` split**: Decomposed the 61-line monolith into a dispatcher + 3 focused helpers by cardinality: `saveToMany` (1:M + M:M), `saveOneToOne` (1:1), `saveManyToOne` (M:1).
|
|
778
|
-
- **`buildAggregateStages` complexity reduction**: Extracted `buildHavingFilter()` helper from the MongoDB aggregation pipeline builder, bringing cognitive complexity under the linter threshold.
|
|
779
|
-
- **`deleteMany` DRY**: Eliminated duplicated `emitHook -> internalDeleteMany -> deleteRelations` logic by reusing the `resolveEntityAndQuery()` pattern.
|
|
780
|
-
- **`directionMap` deduplication**: Extracted the `asc/desc -> 1/-1` mapping into a static `SORT_DIRECTION_MAP` constant shared by `sort()` and `aggregateSort()`.
|
|
781
|
-
- **`parseGroupMap` shared utility**: Eliminated `$group` parsing duplication between SQL and MongoDB dialects with a single generator function in `dialect.util.ts`.
|
|
782
|
-
- **`transformOperators` compaction**: Replaced verbose `if/else if` chains with a static `MONGO_COMPARISON_OP_MAP` lookup, and absorbed `$like`/`$ilike` into `REGEX_OP_MAP`.
|
|
783
|
-
- **`putChildrenInParents` simplification**: Simplified child-grouping loop using explicit initialization pattern.
|
|
784
|
-
- **`findManyAndCount` cleanup**: Replaced spread + triple-delete mutation with clean destructuring.
|
|
785
|
-
- **`insertRelations` cleanup**: Replaced `.map()` with implicit undefined return with `.filter().map()` pattern.
|
|
786
|
-
- **Dead code removal**: Removed dead `Array.isArray` branch in `fillToManyRelations` (array-based `$select` was removed in 3.14.0), dead `Promise.resolve()` in async context, unused generic type parameter.
|
|
787
|
-
- **`havingCondition` visibility**: Changed from `private` to `protected` to allow dialect subclass overrides.
|
|
788
|
-
- **`insertRelations` DRY**: Eliminated double `filterPersistableRelationKeys` call per item using a single `.reduce()` pass.
|
|
789
|
-
- **`where()` loop**: Replaced `.reduce()` accumulator in MongoDB `where()` with a cleaner `for...of` loop.
|
|
790
|
-
- **`_id` constant**: Extracted repeated `'_id'` string literal to `MongoDialect.ID_KEY` class constant.
|
|
791
|
-
- **`negateOperatorMap` static**: Promoted per-call `negateOperatorMap` allocation in `compareLogicalOperator` to `static readonly NEGATE_OP_MAP`.
|
|
792
|
-
- **`AGGREGATE_OP_MAP` class-level**: Moved module-level `MONGO_AGGREGATE_OP_MAP` to `MongoDialect.AGGREGATE_OP_MAP` static, consistent with `REGEX_OP_MAP` and `NATIVE_OPS`.
|
|
793
|
-
|
|
794
|
-
### Test Coverage
|
|
795
|
-
- Added comprehensive tests for `aggregate()` (all SQL dialects + MongoDB pipeline stages), HAVING `$in`/`$nin`/`$isNull`/`$isNotNull`, sort with numeric `-1`, mixed sort directions, MongoDB string-to-numeric sort normalization, aggregate pagination, `parseGroupMap` (edge cases), and `deleteMany` dual-API pattern. All coverage thresholds met.
|
|
796
|
-
|
|
797
|
-
## [0.2.1] - 2026-03-08
|
|
798
|
-
### New Features
|
|
799
|
-
- **`@Transactional({ isolationLevel })` support**: The decorator now accepts an `isolationLevel` option, forwarded to `beginTransaction()`.
|
|
800
|
-
- **`pool.transaction(callback, opts?)` support**: `TransactionOptions` (including `isolationLevel`) are now forwarded through the pool to `querier.transaction()`.
|
|
801
|
-
- **Transaction reuse (nesting)**: `querier.transaction()` and `@Transactional()` now reuse the active transaction when called inside an existing one, enabling composable service methods. `beginTransaction()` remains strict (throws if already in a transaction).
|
|
802
|
-
|
|
803
|
-
## [0.2.0] - 2026-03-08
|
|
804
|
-
### New Features
|
|
805
|
-
- **Transaction Isolation Levels**: `beginTransaction()` and `transaction()` now accept an optional `TransactionOptions` object with an `isolationLevel` property. Supports all standard SQL isolation levels: `read uncommitted`, `read committed`, `repeatable read`, and `serializable`.
|
|
806
|
-
- **PostgreSQL**: Uses inline syntax (`BEGIN TRANSACTION ISOLATION LEVEL ...`).
|
|
807
|
-
- **MySQL / MariaDB**: Uses the `SET TRANSACTION ISOLATION LEVEL` + `START TRANSACTION` two-statement pattern.
|
|
808
|
-
- **SQLite / LibSQL / MongoDB**: Isolation level is silently ignored (these databases do not support configurable isolation levels).
|
|
809
|
-
```ts
|
|
810
|
-
await querier.beginTransaction({ isolationLevel: 'serializable' });
|
|
811
|
-
// or with the callback API
|
|
812
|
-
const result = await querier.transaction(async () => {
|
|
813
|
-
return querier.findMany(User, {});
|
|
814
|
-
}, { isolationLevel: 'read committed' });
|
|
815
|
-
```
|
|
816
|
-
- **Config-Driven Dialect Strategy**: Added `isolationLevelStrategy` to `DialectConfig` (`'inline'` | `'set-before'` | `'none'`), enabling declarative per-dialect SQL generation without dialect-name branching.
|
|
817
|
-
|
|
818
|
-
## [0.1.5] - 2026-03-08
|
|
819
|
-
### Type Safety
|
|
820
|
-
- **Eliminated `any` Types**: Replaced `any` with proper types across decorators (`serialized.ts`, `log.ts`, `transactional.ts`), Express middleware (`querierMiddleware.ts`), MongoDB dialect pipeline types, SQLite querier pool, and migrator. Remaining `any` usages are documented and justified (generic variance, `Reflect.getMetadata`).
|
|
821
|
-
- **Typed `raw()` Return**: `raw()` now returns `QueryRaw` instead of `any`, enabling IDE autocompletion and compile-time validation.
|
|
822
|
-
|
|
823
|
-
### Bug Fixes
|
|
824
|
-
- **Fixed `IsolationLevel` Typo**: Corrected `'repeteable read'` -> `'repeatable read'` in the `IsolationLevel` type.
|
|
825
|
-
|
|
826
|
-
### Security
|
|
827
|
-
- **`raw()` Safety Documentation**: Added JSDoc warning that `raw()` bypasses SQL parameterization, with guidance to use `$where` operators for user-supplied data.
|
|
828
|
-
|
|
829
|
-
## [0.1.4] - 2026-03-08
|
|
830
|
-
### Bug Fixes
|
|
831
|
-
- **Fixed Virtual Field Alias in Relations**: `getRawValue` was missing a dot separator in prefixed aliases and had a stale dot->underscore replacement from the old convention. Added tests to prevent regressions.
|
|
832
|
-
|
|
833
|
-
## [0.1.3] - 2026-03-08
|
|
834
|
-
### Code Quality
|
|
835
|
-
- **Internal Code Cleanup**: Eliminated unnecessary allocations and simplified utility functions across the codebase. Removed dead code and redundant variables.
|
|
836
|
-
|
|
837
|
-
## [0.1.1] - 2026-03-08
|
|
838
|
-
### Bug Fixes
|
|
839
|
-
- **Fixed Row Parsing for Underscore Columns**: Columns containing underscores (e.g., `user_id`) were incorrectly unflattened into nested objects (`{ user: { id: value } }`). SQL JOIN aliases now use quoted dot-notation (e.g., `` `profile.pk` `` instead of `` `profile_pk` ``), eliminating the ambiguity. Dot-delimited aliases are safe because they are always quoted identifiers. Updated tests to prevent regressions.
|
|
840
|
-
|
|
841
|
-
### Performance
|
|
842
|
-
- **Faster SQL Query Generation**: Optimized the internal SQL generation pipeline to reduce overhead on every query. Identifier escaping now reuses pre-compiled regex patterns instead of creating new ones per call. Relation detection short-circuits without intermediate array allocations. The query context tracks SQL length incrementally, avoiding repeated string joins. These changes reduce per-query CPU and memory cost, improving throughput for high-volume workloads.
|
|
843
|
-
- **Zero-Allocation Row Parsing**: `unflatObjects` now uses index-based path traversal instead of `slice().reduce()`, eliminating an array allocation per nested column per row.
|
|
844
|
-
|
|
845
|
-
## [0.1.0] - 2026-03-08
|
|
846
|
-
### Package Rename
|
|
847
|
-
- **Renamed `@uql/core` -> `uql-orm`**: The package is now published as an unscoped name for better SEO, discoverability, and simpler install commands (`npm install uql-orm`).
|
|
848
|
-
- **Version Reset to `0.1.0`**: Fresh start to reflect UQL's modern, fast-moving nature. All functionality from `@uql/core@3.15.0` is preserved - this is a rename, not a rewrite.
|
|
849
|
-
- **New Homepage**: [uql-orm.dev](https://uql-orm.dev)
|
|
850
|
-
- **Migration**: Update your imports from `@uql/core` -> `uql-orm` (e.g., `import { Entity } from 'uql-orm'`). Sub-path imports follow the same pattern (e.g., `uql-orm/postgres`, `uql-orm/migrate`).
|
|
851
|
-
|
|
852
|
-
## [3.15.0] - 2026-03-07
|
|
853
|
-
### New Features
|
|
854
|
-
- **Lifecycle Hooks**: Added entity-level lifecycle hook decorators for domain-specific logic. Seven decorators are available: `@BeforeInsert()`, `@AfterInsert()`, `@BeforeUpdate()`, `@AfterUpdate()`, `@BeforeDelete()`, `@AfterDelete()`, and `@AfterLoad()`. Hooks receive a `HookContext` with access to the active `querier` for transactional DB operations.
|
|
855
|
-
```ts
|
|
856
|
-
@Entity()
|
|
857
|
-
class Article {
|
|
858
|
-
@BeforeInsert()
|
|
859
|
-
generateSlug() {
|
|
860
|
-
this.slug = this.title.toLowerCase().replace(/\s+/g, '-');
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
@AfterLoad()
|
|
864
|
-
maskSensitiveData() {
|
|
865
|
-
this.internalCode = '***';
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
```
|
|
869
|
-
- **Global Querier Listeners**: Added `QuerierListener` interface and `listeners` option on `ExtraOptions` for cross-cutting concerns (audit logging, automatic timestamps, cache invalidation). Listeners fire before entity-level hooks.
|
|
870
|
-
```ts
|
|
871
|
-
const pool = new PgQuerierPool(connectionConfig, {
|
|
872
|
-
listeners: [{
|
|
873
|
-
beforeInsert: ({ entity, payloads }) => { /* audit log */ },
|
|
874
|
-
afterUpdate: ({ entity, querier }) => { /* invalidate cache */ },
|
|
875
|
-
}],
|
|
876
|
-
});
|
|
877
|
-
```
|
|
878
|
-
|
|
879
|
-
### Architecture
|
|
880
|
-
- **Renamed Internal Methods**: `insertMany`/`updateMany` in `AbstractSqlQuerier` and `MongodbQuerier` are now `internalInsertMany`/`internalUpdateMany` (protected). Public `insertMany`/`updateMany` in `AbstractQuerier` wrap them with hook emission.
|
|
881
|
-
- **New Utility**: `runHooks()` in `util/hook.util.ts` - lightweight hook invocation engine using `entity.prototype[method].call(payload, ctx)`.
|
|
882
|
-
- **Hook Inheritance**: Entity hooks are inherited from parent classes (parent hooks execute first).
|
|
883
|
-
|
|
884
|
-
### Test Coverage
|
|
885
|
-
- **22 new tests** (11 for decorators, 11 for `runHooks`). Total: **1602 tests passing**. Coverage: Statements 97.2%, Branches 90.1%, Functions 98.4%, Lines 98.0%.
|
|
886
|
-
|
|
887
|
-
## [3.14.0] - 2026-03-07
|
|
888
|
-
### Type Safety
|
|
889
|
-
- **Map-Only `$select`**: `$select` now only accepts the map form (e.g., `{ id: true, name: true }`), removing the less type-safe array form. Relation selections are now additive in map form.
|
|
890
|
-
- **Stricter `$and`/`$or`/`$not`/`$nor`**: Logical operators now only accept `QueryWhereMap | QueryRaw` elements - bare ID values (e.g., `$or: [5]`) must use the explicit form `$or: [{ id: 5 }]`. This restores TypeScript's excess property checking inside logical clauses.
|
|
891
|
-
- **Wider JSON Array Operators**: `$elemMatch` and `$all` now accept JSON fields without requiring `as any` casts, thanks to widened fallback types for non-array field types. Removed 6 unnecessary `as any` casts from tests.
|
|
892
|
-
|
|
893
|
-
### Refactoring
|
|
894
|
-
- **Simplified Express Middleware**: `$where` ID injection in `querierMiddleware` now always uses map form, properly converting array `$where` from query strings to `{ id: { $in: [...] } }`.
|
|
895
|
-
- **Removed `QueryWhereSingle`**: Consolidated into a flattened `QueryWhere<E>` union. Introduced reusable `QueryWhereArray<E>` type alias.
|
|
896
|
-
|
|
897
|
-
## [3.13.1] - 2026-03-07
|
|
898
|
-
### Type Safety
|
|
899
|
-
- **Fully Typed Querier Returns**: Remaining querier methods now return proper types instead of `unknown`, enabling IDE autocompletion and compile-time validation on query results for all methods.
|
|
900
|
-
- **Semantic `RawRow` Type**: Introduced `RawRow` as a reusable semantic alias for raw database result rows, replacing scattered `Record<string, unknown>` and `any` across queriers, introspection, and SQL utilities.
|
|
901
|
-
- **Typed MySQL Driver**: Replaced `any` in MySQL2 querier with proper `ResultSetHeader` type from the driver.
|
|
902
|
-
- **Smarter `$select` Validation**: Field and relation selections are now validated simultaneously, catching invalid property names at compile time.
|
|
903
|
-
- **Stricter Null Comparisons**: `null` is now only accepted in `$eq` and `$ne` operators - invalid comparisons like `$gt: null` are caught at compile time.
|
|
904
|
-
- **Typed `defaultValue`**: Entity field defaults are now type-checked instead of accepting `any`.
|
|
905
|
-
|
|
906
|
-
### API Surface & DX
|
|
907
|
-
- **Cleaner Querier Interfaces**: `ClientQuerier` and `UniversalQuerier` are now properly separated with documented contracts, preventing confusing type mismatches.
|
|
908
|
-
- **Reduced Public API**: Removed unused/redundant type exports (`QuerySearchOne`, `QueryConflictPathsMap`), making the API surface smaller and easier to navigate.
|
|
909
|
-
- **Improved JSDoc**: Added cross-references between related operators (`$not` root vs field) for better discoverability.
|
|
910
|
-
|
|
911
|
-
### Refactoring
|
|
912
|
-
- **DRY Relation Iteration**: Consolidated duplicated relation iteration logic into `forEachJoinableRelation`, eliminating ~35 duplicated lines.
|
|
913
|
-
- **DRY `compareJsonPath`**: Simplified from 6 parameters to 3, removing redundant internal calls.
|
|
914
|
-
- **DRY `extractInsertResult`**: Shared utility for INSERT result ID extraction across all RETURNING-based drivers (pg, neon, maria), eliminating duplicated logic.
|
|
915
|
-
- **Eliminated Type Casts**: Replaced `Record<string, unknown>` casts with proper type guards across the dialect layer.
|
|
916
|
-
- **Typo Fix**: Renamed `buldQueryWhereAsMap` -> `buildQueryWhereAsMap`.
|
|
917
|
-
|
|
918
|
-
## [3.13.0] - 2026-03-07
|
|
919
|
-
### New Features
|
|
920
|
-
- **`QueryRaw` Class Refactoring**: Replaced the opaque type + type-guard pattern with a proper `class` using `Symbol`-keyed properties (`RAW_VALUE`, `RAW_ALIAS`). Enables `instanceof QueryRaw` checks, eliminates autocomplete pollution, and prevents accidental structural matches.
|
|
921
|
-
- **JSON `$merge`/`$unset` Operators**: Restored type-safe partial update of JSONB fields via `$merge` (shallow merge) and `$unset` (key removal) in `update()` payloads. Works across PostgreSQL (`||`/`-`), MySQL (`JSON_MERGE_PATCH`/`JSON_REMOVE`), and SQLite (`json_patch`/`json_remove`).
|
|
922
|
-
```ts
|
|
923
|
-
await querier.updateMany(Company, { $where: { id: 1 } }, {
|
|
924
|
-
kind: { $merge: { theme: 'dark' }, $unset: ['deprecated'] },
|
|
925
|
-
});
|
|
926
|
-
```
|
|
927
|
-
- **JSON Dot-Notation Sorting**: `$sort` now supports JSONB dot-notation paths (e.g. `{ 'kind.priority': 'desc' }`), sharing the `resolveJsonDotPath` helper with `$where` for DRY consistency.
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
## [3.12.1] - 2026-03-05
|
|
931
|
-
### Bug Fixes
|
|
932
|
-
- **Null-Safe JSONB `$ne`**: JSONB dot-notation `$ne` now uses null-safe operators (`IS DISTINCT FROM` on PostgreSQL, `IS NOT` on SQLite) so that absent keys (which return SQL `NULL`) are correctly included in results. Previously, `{ 'settings.isArchived': { $ne: true } }` would silently exclude rows where the key didn't exist.
|
|
933
|
-
- **JSONB `$eq`/`$ne` with `null`**: `$eq: null` and `$ne: null` on JSONB paths now correctly generate `IS NULL` / `IS NOT NULL` instead of `= NULL` / `<> NULL`.
|
|
934
|
-
|
|
935
|
-
### Improvements & Refactoring
|
|
936
|
-
- **`QueryWhereMap` Type Safety**: Replaced the overly permissive `Record<string, ...>` catch-all with explicit typed unions: template literal `` `${string}.${string}` `` for dot-paths, `RelationKey<E>` for relation filtering, and `JsonFieldPaths<E>` for IDE autocompletion.
|
|
937
|
-
- **`DeepJsonKeys` Recursive Type**: `JsonFieldPaths<E>` now derives dot-notation paths up to 5 levels deep (previously only 1 level), enabling autocompletion for nested JSONB structures like `'kind.theme.color'`.
|
|
938
|
-
- **DRY `compare()` Signature**: Simplified `compare()` from `<E, K extends keyof QueryWhereMap<E>>(key: K, val: QueryWhereMap<E>[K])` to `<E>(key: string, val: unknown)` across all dialect overrides, removing redundant generic constraints.
|
|
939
|
-
- **DRY SQLite Config**: SQLite's `getBaseJsonConfig()` now spreads from `super` instead of duplicating 4 identical fields.
|
|
940
|
-
|
|
941
|
-
### Test Coverage
|
|
942
|
-
- Removed ~20 `as any` casts from tests (now unnecessary with improved types). Added null-safe `$ne` tests across all dialects. Total: **1,563 tests passing**.
|
|
943
|
-
|
|
944
|
-
## [3.12.0] - 2026-03-05
|
|
945
|
-
### New Features
|
|
946
|
-
- **JSONB Dot-Notation Operators**: Filter by nested JSON field paths directly in `$where` with full operator support (`$eq`, `$ne`, `$gt`, `$lt`, `$like`, `$ilike`, `$in`, `$nin`, `$regex`, etc.). Works across PostgreSQL, MySQL, and SQLite.
|
|
947
|
-
```ts
|
|
948
|
-
await querier.findMany(User, {
|
|
949
|
-
$where: { 'settings.isArchived': { $ne: true } },
|
|
950
|
-
});
|
|
951
|
-
```
|
|
952
|
-
- **Relation Filtering**: Filter by ManyToMany and OneToMany relations using automatic EXISTS subqueries. No more manual `raw()` joins.
|
|
953
|
-
```ts
|
|
954
|
-
await querier.findMany(Item, {
|
|
955
|
-
$where: { tags: { name: 'important' } },
|
|
956
|
-
});
|
|
957
|
-
```
|
|
958
|
-
- **`Json<T>` Marker Type**: Wrap JSONB field types with `Json<T>` to ensure they are classified as `FieldKey` (not `RelationKey`), enabling type-safe usage in `$where`, `$select`, and `$sort`.
|
|
959
|
-
```ts
|
|
960
|
-
@Field({ type: 'jsonb' })
|
|
961
|
-
settings?: Json<{ isArchived?: boolean }>;
|
|
962
|
-
```
|
|
963
|
-
- **`JsonFieldPaths<E>` Autocompletion**: Template literal type that derives valid dot-notation paths from `Json<T>` fields (e.g., `'kind.public' | 'kind.private'`). Provides IDE autocompletion for JSONB `$where` queries without restricting arbitrary string paths.
|
|
964
|
-
|
|
965
|
-
### Bug Fixes
|
|
966
|
-
- **raw() String Prefix Fix**: String-based `raw()` values in `$and`/`$or` are no longer incorrectly table-prefixed (e.g., `raw("kind IS NOT NULL")` previously produced `resource.kind IS NOT NULL` instead of `kind IS NOT NULL`).
|
|
967
|
-
|
|
968
|
-
### Improvements & Refactoring
|
|
969
|
-
- **DRY JSON Config**: Extracted `getBaseJsonConfig()` in each dialect - `$elemMatch` and dot-notation now compose from a single config source, eliminating ~20 lines of duplication.
|
|
970
|
-
- **Extracted `normalizeWhereValue()`**: Deduplicated the `Array->$in / object->passthrough / scalar->$eq` normalization used by both regular field and JSON path comparisons.
|
|
971
|
-
- **Cleaner Dot-Notation Detection**: Uses `indexOf`+`slice` instead of two `split('.')` calls for efficient dot-path parsing.
|
|
972
|
-
- **Relation Safety Guard**: `compareRelation()` now throws a descriptive `TypeError` if `rel.references` is missing, instead of a cryptic undefined crash.
|
|
973
|
-
- **TypeScript 6 Compatibility**: Fixed `QueryWhereMap` circular type reference and expanded `QueryWhereOptions.clause` union.
|
|
974
|
-
|
|
975
|
-
### Test Coverage
|
|
976
|
-
- **46 new tests** across 3 dialects (base, PostgreSQL, SQLite) covering all new features and edge cases. Total: **1561 tests passing**.
|
|
977
|
-
|
|
978
|
-
## [3.11.1] - 2026-02-26
|
|
979
|
-
### Improvements
|
|
980
|
-
- **Expanded ColumnType Aliases**: Added `integer`, `tinyint`, `bool`, `datetime`, and `smallserial` as first-class `ColumnType` values (aliases for `int`, `boolean`, `timestamp`, `smallserial`, and `serial` respectively). Users can now use standard SQL keywords interchangeably (e.g., `integer` or `int`, `bool` or `boolean`, `datetime` or `timestamp`).
|
|
981
|
-
- **Auto-Increment Fix**: `smallserial` columns are now correctly detected as auto-incrementing, consistent with `serial` and `bigserial`.
|
|
982
|
-
|
|
983
|
-
## [3.11.0] - 2026-02-21
|
|
984
|
-
### New Features
|
|
985
|
-
- **Scoped Querier**: Added `pool.withQuerier(callback)` - the non-transactional counterpart to `pool.transaction()`. Acquires a querier, runs the callback, and guarantees release via `try/finally`. Useful for scoping connection lifetime without transaction overhead.
|
|
986
|
-
|
|
987
|
-
```ts
|
|
988
|
-
const users = await pool.withQuerier(async (querier) => {
|
|
989
|
-
return querier.findMany(User, { $limit: 10 });
|
|
990
|
-
});
|
|
991
|
-
// querier is automatically released here
|
|
992
|
-
```
|
|
993
|
-
|
|
994
|
-
## [3.10.0] - 2026-02-18
|
|
995
|
-
### New Features
|
|
996
|
-
- **Bulk Upsert**: Added `upsertMany` operation to the `Querier` and `UniversalQuerier` interfaces, enabling efficient bulk insert-or-update across all supported databases.
|
|
997
|
-
- **SQL** (PostgreSQL, MySQL, MariaDB, SQLite): Uses a single `INSERT ... ON CONFLICT/ON DUPLICATE KEY UPDATE` statement with array payloads.
|
|
998
|
-
- **MongoDB**: Uses `bulkWrite` with `updateOne` + `upsert: true` operations.
|
|
999
|
-
- `upsertOne` now delegates to `upsertMany` in SQL dialects for DRY internals; MongoDB retains independent `findOneAndUpdate` for optimal single-document behavior.
|
|
1000
|
-
|
|
1001
|
-
### Test Coverage
|
|
1002
|
-
- **Branch coverage improved from ~88% to 90%** with targeted tests across `schemaAST`, `entityMerger`, `driftDetector`, `canonicalType`, and `tableBuilder`.
|
|
1003
|
-
|
|
1004
|
-
### Dependencies
|
|
1005
|
-
- `@biomejs/biome` 2.3.15 -> 2.4.2
|
|
1006
|
-
- `rimraf` 6.1.2 -> 6.1.3
|
|
1007
|
-
- `mariadb` 3.4.5 -> 3.5.1
|
|
1008
|
-
- `mysql2` 3.17.1 -> 3.17.2
|
|
1009
|
-
|
|
1010
|
-
## [3.9.2] - 2026-02-13
|
|
1011
|
-
### Improvements & Refactoring
|
|
1012
|
-
- **Reduced Cognitive Complexity**: Extracted `compareLogicalOperator` from `AbstractSqlDialect.compare` and `countBraces` helper from `EntityMerger.findInsertPosition`, bringing both functions under the biome complexity threshold.
|
|
1013
|
-
- **Tighter Type Safety**: Replaced `any` with `unknown` across the logger interface, field utilities, and D1 bindings. Typed all DB querier constructors with `ExtraOptions` instead of `any`.
|
|
1014
|
-
|
|
1015
|
-
## [3.9.1] - 2026-02-13
|
|
1016
|
-
### Improvements & Refactoring
|
|
1017
|
-
- **TypeScript Upgrade**: Upgraded to TypeScript ^5.9.3 and hardened `tsconfig.json` with strict flags (`noPropertyAccessFromIndexSignature`, `verbatimModuleSyntax`, etc.).
|
|
1018
|
-
- **Type Safety Polish**: Propagated `E extends object` constraint across the `Querier` hierarchy and refined driver signatures to eliminate type casts (`as any`).
|
|
1019
|
-
|
|
1020
|
-
### Bug Fixes
|
|
1021
|
-
- **MySQL Introspection Fix**: Fixed a bug where string default values were returned with surrounding quotes (e.g., `'active'`) during schema discovery in MySQL and MariaDB.
|
|
1022
|
-
|
|
1023
|
-
## [3.9.0] - 2026-02-13
|
|
1024
|
-
### New Features
|
|
1025
|
-
- **New Query Operators**: Added `$between`, `$isNull`, `$isNotNull`, `$all`, `$size`, and `$elemMatch` operators with full support across PostgreSQL, MySQL, SQLite, and MongoDB.
|
|
1026
|
-
- **Dual-API Pattern**: Querier read and delete methods (`findOne`, `findMany`, `findManyAndCount`, `count`, `deleteMany`) now accept either the classic `(Entity, query)` call or an RPC-friendly `({ $entity: Entity, ...query })` call. This enables cleaner serialization for RPC/REST endpoints.
|
|
1027
|
-
|
|
1028
|
-
### Improvements & Refactoring
|
|
1029
|
-
- **Structured Slow-Query Config**: Replaced flat `slowQueryThreshold: number` with a `slowQuery: { threshold, logParams? }` object. Use `logParams: false` to suppress sensitive query parameters from slow-query logs.
|
|
1030
|
-
- **DRY Dialect Refactor**: Extracted shared `$elemMatch` field-condition logic into `buildJsonFieldCondition` in `AbstractSqlDialect` with a `JsonFieldConfig` type. Each SQL dialect now passes a small config object (~10 lines) instead of duplicating a ~60-line switch across MySQL, PostgreSQL, and SQLite.
|
|
1031
|
-
- **Safer Abstract Base**: `$all`, `$size`, and `$elemMatch` now throw in the abstract SQL dialect base class, forcing each dialect subclass to provide its own implementation. This prevents silent inheritance of dialect-specific syntax.
|
|
1032
|
-
|
|
1033
|
-
### Bug Fixes
|
|
1034
|
-
- **SQLite `$in`/`$nin` Fix**: Fixed a critical bug where `buildJsonFieldOperator` used `vals.shift()` inside `.map()`, mutating the input array and only processing half the values.
|
|
1035
|
-
- **Accurate Slow-Query Logging**: The `@Log()` timer now excludes connection establishment (TCP/SSL handshake) time. Previously, the first query on a new connection could trigger false slow-query alerts. Connection setup (`lazyConnect()`) is now centralized in `all()`/`run()` outside the `@Log()` scope.
|
|
1036
|
-
|
|
1037
|
-
## [3.8.4] - 2026-01-09
|
|
1038
|
-
### Improvements
|
|
1039
|
-
- **Strict Type Polish**: Replaced remaining `any` type usage with `unknown` in the SQL introspection layer for improved safety. Refactored `toNumber` to handle more robustly various database numeric results during schema crawling.
|
|
1040
|
-
|
|
1041
|
-
## [3.8.3] - 2026-01-09
|
|
1042
|
-
### Improvements & Refactoring
|
|
1043
|
-
- **Unified SQL Introspectors**: Refactored the database introspection layer using a template-method pattern via `AbstractSqlSchemaIntrospector`. This consolidated shared logic for **PostgreSQL**, **MySQL**, **MariaDB**, and **SQLite**, reducing code duplication by ~280 lines while ensuring consistent behavior across all SQL dialects.
|
|
1044
|
-
- **Enhanced `@Index` Decorator**: Completed the implementation for composite and customized indexes. Developers can now define multi-column indexes with support for custom `name`, `unique` constraints, and dialect-specific `type` (e.g., `btree`, `hash`, `gin`, `gist`) and `where` clauses.
|
|
1045
|
-
- **Reliable Schema Generation**: Synced `SqlSchemaGenerator` with the **Schema AST** for initial `CREATE TABLE` operations. This ensures that manually defined composite indexes and complex constraints are automatically included in new migrations and `autoSync` actions.
|
|
1046
|
-
- **Robust SQLite Introspection**: Optimized SQLite-specific PRAGMA handling to correctly manage non-standard placeholder support, resolving "Too many parameters" errors and improving stability for **LibSQL** and **Cloudflare D1**.
|
|
1047
|
-
- **Refined Type Safety**: Fixed TypeScript compilation issues related to `override` modifiers and corrected internal type mismatches in `SchemaASTBuilder`, achieving a perfectly clean `tsc` output and 100% test coverage for all introspector modules.
|
|
1048
|
-
|
|
1049
|
-
## [3.8.2] - 2026-01-08
|
|
1050
|
-
### Improvements & Refactoring
|
|
1051
|
-
- **Refactored Dialect Configuration**: Grouped dialect-specific flags into a cohesive `features` object within `DialectConfig`. Introduced a new `foreignKeyAlter` flag to explicitly manage support for post-creation foreign key constraints, improving architectural clarity.
|
|
1052
|
-
- **Enhanced Table Builder**: Foreign key definitions created via the fluent `.references()` API are now automatically promoted to table-level constraints during the build process. This ensures full compatibility with **SQLite** and other dialects that require foreign keys to be defined within the `CREATE TABLE` statement.
|
|
1053
|
-
- **Predictable SQL Expressions**: Removed brittle string auto-detection in `formatDefaultValue`. Developers are now encouraged to use the explicit `raw()` helper or the `t.now()` shortcut for SQL expressions like `CURRENT_TIMESTAMP`, ensuring deterministic behavior across all databases.
|
|
1054
|
-
- **Robust Introspection Tests**: Refactored the integration test suite to use explicit SQL expression helpers and non-shadowed callback parameters. Standardized timestamp type assertions for MySQL and MariaDB, achieving 100% pass rate across the entire test suite (1,383 tests).
|
|
1055
|
-
|
|
1056
|
-
## [3.8.0] - 2026-01-08
|
|
1057
|
-
### Schema Sync System & AST Engine
|
|
1058
|
-
- **Schema AST Feature**: Introduced a revolutionary **Schema AST (Abstract Syntax Tree)** engine that treats the database schema as a graph. This enables features like **Circular Dependency Detection** and automatic topological sorting for `CREATE`/`DROP` operations, solving complex schema edge cases that simple list-based approaches cannot handle.
|
|
1059
|
-
- **Smart Relation Detection**: When scaffolding entities from an existing database (`generate:from-db`), UQL now automatically infers **OneToOne** and **ManyToMany** relationships by analyzing foreign key structures and naming conventions (e.g., `user_id` -> `User` entity), significantly reducing manual boilerplate.
|
|
1060
|
-
- **Drift Detection**: Added the `drift:check` command to detect discrepancies between your TypeScript entities and the actual database schema. It reports critical issues (missing tables, risk of data truncation) and warnings (missing indexes) to ensure production safety.
|
|
1061
|
-
- **Bidirectional Index Sync**: Indexes are now fully synchronized in both directions. `@Field({ index: true })` definitions are pushed to the database, and existing database indexes are reflected in generated entity files.
|
|
1062
|
-
- **Unified Migration Builder API**: Refactored the migration builder to use a cohesive **Options Object** API (e.g., `t.string('email', { length: 255, unique: true })`). This replaces the old positional argument style, aligning strictly with the `@Field` decorator options for a consistent developer experience.
|
|
1063
|
-
- **Refactored Generators**: Consolidated `SqlSchemaGenerator` and `MongoSchemaGenerator` into a unified architecture, sharing core logic for simpler maintenance and better type safety.
|
|
1064
|
-
|
|
1065
|
-
## [3.7.14] - 2026-01-06
|
|
1066
|
-
### Documentation
|
|
1067
|
-
- **README Refinement**: Improved docs about new Migrations feature.
|
|
1068
|
-
|
|
1069
|
-
## [3.7.12] - 2026-01-06
|
|
1070
|
-
### Improvements
|
|
1071
|
-
- **Expanded Float Support**: Added `float4`, `float8`, and `double precision` to `ColumnType`, with proper mapping across PostgreSQL, MySQL, and SQLite.
|
|
1072
|
-
- **Type Grouping & Safety**: Introduced specialized union types (`NumericColumnType`, `StringColumnType`, `DateColumnType`, etc.) for better internal organization and exhaustive type checking.
|
|
1073
|
-
- **Optimized Type Helpers**: Refactored `field.util.ts` to use `as const satisfies Record<T, true>` for all column type groups, ensuring compile-time verification when adding new types.
|
|
1074
|
-
- **Dialect Refactoring**: Standardized SQL dialects to use centralized type helpers (`isNumericType`, `isJsonType`), improving code reuse and consistency.
|
|
1075
|
-
|
|
1076
|
-
## [3.7.11] - 2026-01-04
|
|
1077
|
-
### Improvements
|
|
1078
|
-
- **Enhanced Down Migrations**: `generateAlterTableDown` now generates complete reversals for column alterations (restores original type) and index additions (drops them). For dropped columns/indexes, a TODO comment is added since the original schema isn't stored.
|
|
1079
|
-
- **Bun Documentation**: Added note in README for Bun users with TypeScript path aliases to use `--bun` flag for proper resolution.
|
|
1080
|
-
|
|
1081
|
-
## [3.7.10] - 2026-01-04
|
|
1082
|
-
### Improvements
|
|
1083
|
-
- **Robust Config Loading**: Integrated `jiti` into the CLI configuration loader. This allows `uql-migrate` to natively support TypeScript configuration files (`uql.config.ts`) and properly resolve ESM/CJS interop logic across all node environments (Node.js, Bun, etc.) without requiring custom runtime flags.
|
|
1084
|
-
|
|
1085
|
-
## [3.7.9] - 2026-01-04
|
|
1086
|
-
- **Manual Migrations**: Updated the root README to explicitly document the `generate` command for creating manual incremental migrations (`npx uql-migrate generate <name>`), ensuring developers know how to create empty migration files efficiently.
|
|
1087
|
-
|
|
1088
|
-
### Bug Fixes
|
|
1089
|
-
- **CLI Entry Point**: Fixed a critical issue where the `uql-migrate` command would silently fail in certain environments (e.g., when run via `npx` or symlinks) due to brittle entry point detection. The CLI now reliably executes regardless of how it is invoked.
|
|
1090
|
-
|
|
1091
|
-
## [3.7.7] - 2026-01-04
|
|
1092
|
-
### Refined Foreign Key Handling & Control
|
|
1093
|
-
- **Recursive Type Inheritance**: Foreign key columns now automatically inherit the exact SQL type of their referenced primary keys (e.g., `UUID` -> `UUID`), ensuring perfect compatibility even in complex inheritance or self-referencing relationships.
|
|
1094
|
-
- **Custom Foreign Key Control**: Introduced the `foreignKey` option in `@Field` and `@Id` to allow specifying custom semantic names for constraints or disabling physical constraints (`false`) while maintaining logical references.
|
|
1095
|
-
- **Deterministic Constraint Naming**: Standardized default foreign key naming to `` `fk_${tableName}_${columnName}` ``, ensuring uniqueness and predictability across the database.
|
|
1096
|
-
- **Enhanced Schema Robustness**: Improved the schema generator's resilience against entities using circular dependencies or deep inheritance chains.
|
|
1097
|
-
- **Express Middleware Fix**: Resolved an issue in `query.util.ts` where the query parser could crash when receiving array-based query parameters (e.g., `$where[]=1`), preventing correct filtering in Express applications.
|
|
1098
|
-
- **Field Utility Optimization**: Refactored `isNumericType` to use a `Set` for O(1) lookups and resolved strict type checking issues in `field.util.ts`.
|
|
1099
|
-
|
|
1100
|
-
## [3.7.5] - 2026-01-04
|
|
1101
|
-
### Enhanced Type Inference & Default Value Comparison
|
|
1102
|
-
- **Strict Field Type Safety**: Standardized the `type` property in `@Field` and `@Id` to use a strict union of global constructors (`String`, `Number`, etc.) and verified `ColumnType` strings.
|
|
1103
|
-
- **Removed String Aliases**: Deprecated and removed support for informal string aliases like `'string'`, `'number'`, `'boolean'`, and `'date'` in the `type` property. Developers should use the corresponding TypeScript constructors for logical mapping.
|
|
1104
|
-
- **Semantic Type Inference**: Added robust support for `'uuid'`, `'json'`, `'jsonb'`, and `'vector'` as valid semantic values for the `type` property. This ensures correct cross-database SQL mapping even when specified as semantic strings.
|
|
1105
|
-
|
|
1106
|
-
## [3.7.4] - 2026-01-04
|
|
1107
|
-
### Enhanced Schema Generation & Type Safety
|
|
1108
|
-
- **Fixed Foreign Key Type Mismatch**: Resolved an issue where foreign key columns could default to incompatible types (e.g., `TEXT`) when referencing primary keys of a different type (e.g., `UUID`). Foreign keys now automatically inherit the exact SQL type of the column they reference.
|
|
1109
|
-
- **Improved Default Value Comparison**: Standardized default value normalization to handle complex PostgreSQL type casts (e.g., `'[]'::jsonb[]`) and accurately compare object/array defaults using `JSON.stringify`, effectively eliminating "phantom diffs."
|
|
1110
|
-
- **Improved Primary Key Inference**: String-based primary keys (including UUIDs) no longer incorrectly default to `BIGINT` auto-incrementing serials. The ORM now only applies auto-increment logic to numeric types (`number`, `BigInt`) unless explicitly configured via `@Id({ autoIncrement: true })`.
|
|
1111
|
-
- **Architectural Refactor**: Consolidated schema generation to use a unified `fieldToColumnSchema` path for both initial creation and synchronization, ensuring perfect structural consistency and eliminating "phantom diffs".
|
|
1112
|
-
- **Reusable Field Utilities**: Created `field.util.ts` for centralized logic regarding auto-increment and numeric type checks, improving maintainability across the ORM.
|
|
1113
|
-
- **Safety Fix**: Refined `generateColumnDefinitionFromSchema` to safely strip redundant `PRIMARY KEY` constraints during `ALTER TABLE` operations, avoiding "Duplicate Primary Key" errors while maintaining auto-incrementing properties.
|
|
1114
|
-
- **Expanded Unit Tests**: Added comprehensive branch testing for field properties and type inference to ensure long-term stability across all 8 supported databases.
|
|
1115
|
-
|
|
1116
|
-
## [3.7.3] - 2026-01-04
|
|
1117
|
-
### Robust Schema Synchronization
|
|
1118
|
-
- **Safe AutoSync**: Primary keys are now immune to automated alterations, preventing dangerous schema changes and ensuring database stability.
|
|
1119
|
-
- **Modern Primary Keys**: Standardized on **64-bit** auto-increment primary keys across all SQL dialects to align with TypeScript's `number` type:
|
|
1120
|
-
- **PostgreSQL**: Now uses `BIGINT GENERATED BY DEFAULT AS IDENTITY` (SQL Standard).
|
|
1121
|
-
- **MySQL / MariaDB**: Now uses `BIGINT UNSIGNED AUTO_INCREMENT`.
|
|
1122
|
-
- **SQLite / LibSQL / D1**: Consistently uses 64-bit `INTEGER PRIMARY KEY`.
|
|
1123
|
-
- **SQLite `STRICT` Mode**: Tables generated for SQLite, LibSQL, and Cloudflare D1 now use **`STRICT` mode** by default, enforcing type integrity at the database level.
|
|
1124
|
-
- **Polymorphic Type Resolution**: Refactored `getSqlType` to be dialect-aware for all core types (Numbers, Strings, Booleans, Dates), preventing dialect-specific types from leaking into incompatible databases.
|
|
1125
|
-
- **Semantic Type Comparison**: Implemented intelligent type normalization that understands dialect-specific aliases (e.g., `INTEGER` vs `INT`) and ignores implementation details like MySQL display widths (`BIGINT(20)`).
|
|
1126
|
-
- **Fixed ALTER Syntax**: Resolved "Duplicate primary key" errors in MySQL/MariaDB by ensuring `MODIFY COLUMN` statements omit existing constraints during type or nullability updates.
|
|
1127
|
-
- **Improved Postgres Introspection**: Enhanced default value comparison to correctly handle complex Postgres type casts (e.g., `::timestamp without time zone`) and quoted strings.
|
|
1128
|
-
- **Expanded Testing**: Added **SQLite**, **LibSQL**, and **Cloudflare D1** scenarios to the integration test suite, ensuring 100% behavioral consistency across all 8 supported databases.
|
|
1129
|
-
- **Predictable Test Assertions**: Refactored all schema synchronization and introspection tests to use direct, non-conditional assertions, improving test reliability and failure clarity by removing optional chaining and non-null assertions.
|
|
1130
|
-
- **Clean Test Logic**: Removed imperative conditionals from test generators, replacing them with declarative mapping objects for dialect-specific type verification.
|
|
1131
|
-
|
|
1132
|
-
## [3.7.2] - 2026-01-04
|
|
1133
|
-
### Improve documentation
|
|
1134
|
-
- **AutoSync**: Clarified that entities must be imported/loaded before calling `autoSync()`. Added examples for both explicit entity passing (recommended) and auto-discovery approaches, plus debugging tips
|
|
1135
|
-
|
|
1136
|
-
## [3.7.1] - 2026-01-04
|
|
1137
|
-
### Improve documentation
|
|
1138
|
-
- Update examples in docs and improve formatting of README
|
|
1139
|
-
|
|
1140
|
-
## [3.7.0] - 2026-01-04
|
|
1141
|
-
### Improvements
|
|
1142
|
-
- **Repository Pattern Removal**: Removed the built-in Repository pattern implementation (`GenericRepository`, etc.) to simplify the framework architecture (KISS). Users should rely on the `Querier` interface or implement custom layers if needed.
|
|
1143
|
-
- **Testing**: Added comprehensive tests for `HttpQuerier` and integration tests for the CLI entry point (`bin.ts`), achieving >99% code coverage.
|
|
1144
|
-
|
|
1145
|
-
## [3.6.1] - 2026-01-04
|
|
1146
|
-
### New Features
|
|
1147
|
-
- **CLI**: Added `--config` / `-c` flag to `uql-migrate` to load a custom configuration file.
|
|
1148
|
-
- **CLI**: Improved error handling when loading configuration files (syntax errors are no longer swallowed).
|
|
1149
|
-
|
|
1150
|
-
## [3.6.0] - 2026-01-04
|
|
1151
|
-
### New Features
|
|
1152
|
-
- **CLI**: Added default logger, support to log slow-queries in a parameterized way, and ability to define custom loggers.
|
|
1153
|
-
|
|
1154
|
-
## [3.5.0] - 2026-01-03
|
|
1155
|
-
### Refactor
|
|
1156
|
-
- **Dialect-Aware String Defaults**: Optimized default column types for TypeScript `string` fields across all supported databases.
|
|
1157
|
-
- **PostgreSQL**: Defaults to `TEXT` (idiomatic, no length limits, slightly faster).
|
|
1158
|
-
- **SQLite**: Defaults to `TEXT` (matches internal type affinity).
|
|
1159
|
-
- **MySQL / MariaDB**: Defaults to `VARCHAR(255)` (ensures out-of-the-box compatibility for indices and unique constraints).
|
|
1160
|
-
- Automatically transitions to `VARCHAR(n)` when an explicit `length` is provided in the `@Field()` decorator.
|
|
1161
|
-
|
|
1162
|
-
## [3.4.1]
|
|
1163
|
-
### Improve documentation
|
|
1164
|
-
|
|
1165
|
-
- Update examples in docs
|
|
1166
|
-
|
|
1167
|
-
## [3.1.1](https://github.com/rogerpadilla/uql/compare/uql-orm@3.1.0...uql-orm@3.1.1) (2025-12-30)
|
|
1168
|
-
### Bug Fixes
|
|
1169
|
-
* adjust relative paths for README and CHANGELOG in copyfiles script ([741c2ee](https://github.com/rogerpadilla/uql/commit/741c2ee8839376ca89a860a53950ef6b6d234596))
|
|
1170
|
-
|
|
1171
|
-
## [3.1.0](https://github.com/rogerpadilla/uql/compare/uql-orm@3.0.0...uql-orm@3.1.0) (2025-12-30)
|
|
1172
|
-
### Bug Fixes
|
|
1173
|
-
|
|
1174
|
-
* adjust relative paths for README and CHANGELOG in copyfiles script ([7a61a01](https://github.com/rogerpadilla/uql/commit/7a61a0135da2d0459e588cda7d94f324bb9eebca))
|
|
1175
|
-
|
|
1176
|
-
## [3.0.0](https://github.com/rogerpadilla/uql/compare/uql-orm@2.0.0...uql-orm@3.0.0) (2025-12-30)
|
|
1177
|
-
Reflect major changes in the package structure and dependencies.
|
|
1178
|
-
|
|
1179
|
-
## [2.0.0] - 2025-12-29
|
|
1180
|
-
- **Major Rebranding**: Rebranded the project from **Nukak** to **UQL** (Universal Query Language - back to its original name!).
|
|
1181
|
-
- New Slogan: **"One Language. Frontend to Backend."**
|
|
1182
|
-
- Project homepage: [uql-orm.dev](https://uql-orm.dev).
|
|
1183
|
-
- **Package Unification**: Unified all database adapters (`mysql`, `postgres`, `maria`, `sqlite`, `mongo`) and `express` middleware into a single core package: `uql-orm`.
|
|
1184
|
-
- **Scoped Naming**:
|
|
1185
|
-
- `uql-orm`: The main ORM engine and all database adapters.
|
|
1186
|
-
- `uql-orm/migrate`: The database migration system (formerly `nukak-migrate`).
|
|
1187
|
-
- **Improved API Surface**:
|
|
1188
|
-
- Database-specific logic is now accessible via sub-paths (e.g., `import { ... } from 'uql-orm/postgres'`).
|
|
1189
|
-
- Unified `NamingStrategy` and `QueryContext` across all unified adapters.
|
|
1190
|
-
- **Build & Distribution**:
|
|
1191
|
-
- Integrated `bunchee` for high-performance browser bundle generation (`uql-orm/browser`).
|
|
1192
|
-
- Minimized core dependency footprint by moving database drivers to optional `peerDependencies`.
|
|
1193
|
-
- **Enhanced Type Safety**: Fully updated internal type resolution to support the unified package structure.
|
|
1194
|
-
|
|
1195
|
-
## [1.8.0] - 2025-12-29
|
|
1196
|
-
- **New Feature**: Added support for **Naming Strategies**.
|
|
1197
|
-
- Automatically translate TypeScript entity and property names to database-specific identifiers (e.g., camelCase to snake_case).
|
|
1198
|
-
- Built-in `DefaultNamingStrategy` and `SnakeCaseNamingStrategy`.
|
|
1199
|
-
- Comprehensive support across all SQL dialects and MongoDB.
|
|
1200
|
-
- **Refactoring**:
|
|
1201
|
-
- Unified naming and metadata resolution logic into a new `AbstractDialect` base class shared by both DML (Dialects) and DDL (Schema Generators).
|
|
1202
|
-
- Improved `MongoDialect` to respect naming strategies for collection and field names on both read and write operations.
|
|
1203
|
-
|
|
1204
|
-
## [1.7.0] - 2025-12-29
|
|
1205
|
-
- **New Package**: Introduced `nukak-migrate` for database migrations.
|
|
1206
|
-
- Supports version-controlled schema changes via local migration files.
|
|
1207
|
-
- Automatic migration generation from entity definitions using schema introspection.
|
|
1208
|
-
- Full support for PostgreSQL, MySQL, MariaDB, and SQLite.
|
|
1209
|
-
- CLI tool for managing migrations (`up`, `down`, `status`, `generate`, `sync`).
|
|
1210
|
-
- Database-backed migration tracking (Database or JSON storage).
|
|
1211
|
-
- **Core Improvements**:
|
|
1212
|
-
- Expanded `@Field()` decorator with schema metadata: `length`, `precision`, `scale`, `unique`, `index`, `columnType`, `defaultValue`, and `comment`.
|
|
1213
|
-
- Added schema generation and introspection capabilities to SQL dialects.
|
|
1214
|
-
|
|
1215
|
-
## [1.6.0] - 2025-12-28
|
|
1216
|
-
- **Architectural Change**: Migrated from "Values as Parameter" to "Context Object" pattern for SQL generation.
|
|
1217
|
-
- This pattern centralizes query parameters and SQL fragments into a `QueryContext`, ensuring robust placeholder management and preventing out-of-sync parameter indices.
|
|
1218
|
-
- Improved compatibility with PostgreSQL's indexed placeholders ($1, $2, etc.) and complex sub-queries.
|
|
1219
|
-
- Standardized dialect interfaces to operate directly on the `QueryContext` for higher performance and cleaner code.
|
|
1220
|
-
- Fixed linter issues and unified type safety for `raw()` SQL snippets across all drivers.
|
|
1221
|
-
|
|
1222
|
-
## [1.5.0] - 2025-12-28
|
|
1223
|
-
- **BREAKING CHANGE**: Implemented "Sticky Connections" for performance. `Querier` instances now hold their connection until `release()` is explicitly called.
|
|
1224
|
-
- If you manually retrieve a querier via `pool.getQuerier()`, you **MUST** call `await querier.release()` when finished, otherwise connections will leak.
|
|
1225
|
-
- `Repositories` and `pool.transaction(...)` callbacks automatically handle this, so high-level usage remains unchanged.
|
|
1226
|
-
- Unified serialization logic: `@Serialized()` decorator is now centralized in `AbstractSqlQuerier`, removing redundant overrides in drivers.
|
|
1227
|
-
- Fixed MongoDB consistency: `beginTransaction`, `commitTransaction`, and `rollbackTransaction` are now serialized to prevent race conditions.
|
|
1228
|
-
- Fix Cross-Dialect SQL JSON bug by moving PostgreSQL-specific casts to the appropriate dialect.
|
|
1229
|
-
- Fix transaction race conditions by serializing transaction lifecycle methods and implementing an internal execution pattern.
|
|
1230
|
-
|
|
1231
|
-
## [1.4.16] - 2025-12-28
|
|
1232
|
-
|
|
1233
|
-
- Implement a "Serialized Task Queue" at the core of the framework to ensure database connections are thread-safe and race-condition free.
|
|
1234
|
-
- Introduce `@Serialized()` decorator to simplify the serialization of database operations across all drivers.
|
|
1235
|
-
|
|
1236
|
-
## [1.4.14] - 2025-12-28
|
|
1237
|
-
|
|
1238
|
-
- Robust `upsert` implementation across all SQL dialects (PostgreSQL, MySQL, MariaDB, SQLite).
|
|
1239
|
-
|
|
1240
|
-
## [1.4.10] - 2025-12-27
|
|
1241
|
-
|
|
1242
|
-
- Improve types, tests, migrate from EsLint/Prettier to Biome, and update dependencies.
|
|
1243
|
-
|
|
1244
|
-
## [1.4.6] - 2024-11-06
|
|
1245
|
-
|
|
1246
|
-
- Update dependencies and improve readme.
|
|
1247
|
-
|
|
1248
|
-
## [1.4.5] - 2024-09-26
|
|
1249
|
-
|
|
1250
|
-
- Imperative transactions have to be closed manually.
|
|
1251
|
-
|
|
1252
|
-
## [1.4.4] - 2024-09-26
|
|
1253
|
-
|
|
1254
|
-
- Ensure own connection is always released even if exception occurs.
|
|
1255
|
-
- Correct issue when empty or null list is passed to `insertMany` operations.
|
|
1256
|
-
|
|
1257
|
-
## [1.4.3] - 2024-09-25
|
|
1258
|
-
|
|
1259
|
-
- Ensure the connection is auto-released after `commit` or `rollback` runs.
|
|
1260
|
-
- Update dependencies.
|
|
1261
|
-
|
|
1262
|
-
## [1.4.2] - 2024-09-20
|
|
1263
|
-
|
|
1264
|
-
- Fix projection of `@OneToMany` field when the 'one' side produces empty result.
|
|
1265
|
-
- Update dependencies.
|
|
1266
|
-
|
|
1267
|
-
## [1.4.1] - 2024-08-21
|
|
1268
|
-
|
|
1269
|
-
- Add nukak-maku logo.
|
|
1270
|
-
- Update dependencies (functionality keeps the same in this release).
|
|
1271
|
-
|
|
1272
|
-
## [1.4.0] - 2024-08-15
|
|
1273
|
-
|
|
1274
|
-
- Automatically release the querier unless it is inside a current transaction.
|
|
1275
|
-
- Remove unnecessary wrapper for transactions from `AbstractQuerierPool` class.
|
|
1276
|
-
|
|
1277
|
-
## [1.3.3] - 2024-08-13
|
|
1278
|
-
|
|
1279
|
-
- Improve typings of first inserted ID.
|
|
1280
|
-
|
|
1281
|
-
## [1.3.2] - 2024-08-13
|
|
1282
|
-
|
|
1283
|
-
- Return the inserted IDs in the response of the queriers' `run` function.
|
|
1284
|
-
|
|
1285
|
-
## [1.3.1] - 2024-08-13
|
|
1286
|
-
|
|
1287
|
-
- Fix an issue related to the `$where` condition of selected relations missed in the final criteria for `@OneToMany` and `@ManyToMany` relationships.
|
|
1288
|
-
|
|
1289
|
-
## [1.3.0] - 2024-08-13
|
|
1290
|
-
|
|
1291
|
-
- Add support for `json` and `jsonb` fields. Automatically parse the JSON values when persisting with `JSON.parse` function.
|
|
1292
|
-
- Improve type-safety in general.
|
|
1293
|
-
- Move `getPersistables` inside dialect for higher reusability.
|
|
1294
|
-
- Add support for `vector` fields.
|
|
1295
|
-
|
|
1296
|
-
## [1.2.0] - 2024-08-12
|
|
1297
|
-
|
|
1298
|
-
- Add support for `raw` in values (previously, it was only supported by `$select` and `$where` operators). Allows safe use of any SQL query/clause as the value in an insert or update operation that shouldn't be automatically escaped by the ORM.
|
|
1299
|
-
|
|
1300
|
-
## [1.1.0] - 2024-08-11
|
|
1301
|
-
|
|
1302
|
-
- Add support for `upsert` operations.
|
|
1303
|
-
- Migrate SQLite package driver from `sqlite3` to `better-sqlite3` for better performance.
|
|
1304
|
-
- Make Maria package to use the `RETURNING id` clause to get the inserted IDs.
|
|
1305
|
-
|
|
1306
|
-
## [1.0.1] - 2024-08-10
|
|
1307
|
-
|
|
1308
|
-
- Rename `$project` operator to `$select` for consistency with most established frameworks so far.
|
|
1309
|
-
- Rename `$filter` operator to `$where` for consistency with most established frameworks so far.
|
|
1310
|
-
|
|
1311
|
-
## [1.0.0] - 2024-08-10
|
|
1312
|
-
|
|
1313
|
-
- Allow to set a field as non-eager (i.e. lazy) with `eager: false` (by default fields are `eager: true`).
|
|
1314
|
-
- Allow to set a field as non-updatable (i.e. insertable and read-only) with `updatable: false` (by default fields are `updatable: true`).
|
|
1315
|
-
|
|
1316
|
-
## [0.4.0] - 2023-11-06
|
|
1317
|
-
|
|
1318
|
-
- Move project inside query parameter [#63](https://github.com/rogerpadilla/nukak/pull/63)
|
|
1319
|
-
|
|
1320
|
-
## [0.3.3] - 2023-10-25
|
|
1321
|
-
|
|
1322
|
-
- Update usage example in the README.md.
|
|
1323
|
-
|
|
1324
|
-
## [0.3.2] - 2023-10-24
|
|
1325
|
-
|
|
1326
|
-
- Improve usage examples in the README.md, and make the overview section more concise.
|
|
1327
|
-
|
|
1328
|
-
## [0.3.1] - 2023-10-19
|
|
1329
|
-
|
|
1330
|
-
1. Remove `$group` and `$having` as they detriment type safety as currently implemented (support may be redesigned later if required).
|
|
1331
|
-
2. Improve type safety of `$project` operator.
|
|
1332
|
-
3. Improve type safety of `$filter` operator.
|
|
1333
|
-
4. Remove projection operators (`$count`, `$min`, `$max`, `$min`, and `$sum`) as they detriment type safety as currently implemented. This can be done via Virtual fields instead as currently supported for better type safety.
|
|
1334
|
-
|
|
1335
|
-
## [0.3.0] - 2023-10-18
|
|
1336
|
-
|
|
1337
|
-
- Add support for `transaction` operations using a QuerierPool.
|
|
1338
|
-
Automatically wraps the code of the callback inside a transaction, and auto-releases the querier after running.
|
|
1339
|
-
- Update dependencies.
|
|
1340
|
-
|
|
1341
|
-
```ts
|
|
1342
|
-
const ids = await pool.transaction(async (querier) => {
|
|
1343
|
-
const data = await querier.findMany(...);
|
|
1344
|
-
const ids = await querier.insertMany(...);
|
|
1345
|
-
return ids;
|
|
1346
|
-
});
|
|
1347
|
-
```
|
|
1348
|
-
|
|
1349
|
-
## [0.2.21] 2023-04-15
|
|
1350
|
-
|
|
1351
|
-
- fix(nukak-browser): check if ids are returned before use $in to delete them.
|
|
1352
|
-
|
|
1353
|
-
- Reuse community open-source npm packages to escape literal-values according to each DB vendor.
|
|
1354
|
-
|
|
1355
|
-
## [0.2.0] 2023-01-02
|
|
1356
|
-
|
|
1357
|
-
- Move projection to a new parameter to improve type inference of the results.
|
|
1358
|
-
|
|
1359
|
-
- Support dynamic operations while projecting fields, and move `$project` as an independent parameter in the `find*` functions [#55](https://github.com/rogerpadilla/nukak/pull/55).
|