uql-orm 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/browser/uql-browser.min.js +12 -10
- package/dist/browser/uql-browser.min.js.map +1 -1
- package/dist/bunSql/bunSql.util.d.ts.map +1 -1
- package/dist/bunSql/bunSql.util.js +4 -1
- package/dist/bunSql/bunSql.util.js.map +1 -1
- package/dist/dialect/abstractDialect.d.ts +1 -0
- package/dist/dialect/abstractDialect.d.ts.map +1 -1
- package/dist/dialect/abstractDialect.js +3 -0
- package/dist/dialect/abstractDialect.js.map +1 -1
- package/dist/dialect/abstractSqlDialect.d.ts +1 -0
- package/dist/dialect/abstractSqlDialect.d.ts.map +1 -1
- package/dist/dialect/abstractSqlDialect.js +5 -2
- package/dist/dialect/abstractSqlDialect.js.map +1 -1
- package/dist/dialect/dialectConfig.d.ts +18 -36
- package/dist/dialect/dialectConfig.d.ts.map +1 -1
- package/dist/dialect/dialectConfig.js +6 -0
- package/dist/dialect/dialectConfig.js.map +1 -1
- package/dist/maria/mariaDialect.d.ts +2 -0
- package/dist/maria/mariaDialect.d.ts.map +1 -1
- package/dist/maria/mariaDialect.js +4 -0
- package/dist/maria/mariaDialect.js.map +1 -1
- package/dist/migrate/schemaGenerator.js +6 -6
- package/dist/migrate/schemaGenerator.js.map +1 -1
- package/dist/mongo/mongodbQuerier.d.ts +2 -2
- package/dist/mongo/mongodbQuerier.d.ts.map +1 -1
- package/dist/mongo/mongodbQuerier.js +3 -3
- package/dist/mongo/mongodbQuerier.js.map +1 -1
- package/dist/postgres/postgresDialect.js +6 -6
- package/dist/postgres/postgresDialect.js.map +1 -1
- package/dist/querier/abstractQuerier.d.ts +3 -3
- package/dist/querier/abstractQuerier.d.ts.map +1 -1
- package/dist/querier/abstractQuerier.js.map +1 -1
- package/dist/querier/abstractSqlQuerier.d.ts +2 -2
- package/dist/querier/abstractSqlQuerier.d.ts.map +1 -1
- package/dist/querier/abstractSqlQuerier.js.map +1 -1
- package/dist/type/querier.d.ts +2 -2
- package/dist/type/querier.d.ts.map +1 -1
- package/dist/type/querier.js.map +1 -1
- package/dist/type/query.d.ts +41 -1
- package/dist/type/query.d.ts.map +1 -1
- package/dist/type/universalQuerier.d.ts +2 -2
- package/dist/type/universalQuerier.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. Please add
|
|
|
4
4
|
|
|
5
5
|
date format is [yyyy-mm-dd]
|
|
6
6
|
|
|
7
|
+
## [0.7.5] - 2026-03-29
|
|
8
|
+
### New Features
|
|
9
|
+
- **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`.
|
|
10
|
+
- **Centralized Dialect Features**: Introduced a declarative `DialectFeatures` system to manage database capabilities (e.g. `supportsJsonb`, `returning`, `ifNotExists`).
|
|
11
|
+
|
|
12
|
+
### Improvements
|
|
13
|
+
- **Dialect Architecture Hardening**: Replaced brittle runtime dialect-name checks with formal feature flags across the codebase.
|
|
14
|
+
- **Immutability**: Marked all dialect configuration and feature properties as `readonly` for increased runtime stability.
|
|
15
|
+
|
|
16
|
+
|
|
7
17
|
## [0.7.4] - 2026-03-28
|
|
8
18
|
### Bug Fixes
|
|
9
19
|
- **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`.
|
|
@@ -965,30 +965,30 @@ function getRelationKeyMap(meta) {
|
|
|
965
965
|
|
|
966
966
|
async function createTables(querier, primaryKeyType) {
|
|
967
967
|
const entities = getEntities();
|
|
968
|
-
|
|
968
|
+
for (const entity of entities){
|
|
969
969
|
const sql = getDdlForTable(entity, querier, primaryKeyType);
|
|
970
|
-
|
|
971
|
-
}
|
|
970
|
+
await querier.run(sql);
|
|
971
|
+
}
|
|
972
972
|
}
|
|
973
973
|
async function dropTables(querier) {
|
|
974
974
|
const entities = getEntities();
|
|
975
|
-
|
|
975
|
+
for (const entity of entities){
|
|
976
976
|
const meta = getMeta(entity);
|
|
977
977
|
const sql = `DROP TABLE IF EXISTS ${querier.dialect.escapeId(meta.name)}`;
|
|
978
|
-
|
|
979
|
-
}
|
|
978
|
+
await querier.run(sql);
|
|
979
|
+
}
|
|
980
980
|
}
|
|
981
981
|
async function clearTables(querier) {
|
|
982
982
|
const entities = getEntities();
|
|
983
|
-
|
|
983
|
+
for (const entity of entities){
|
|
984
984
|
const ctx = querier.dialect.createContext();
|
|
985
985
|
querier.dialect.delete(ctx, entity, {});
|
|
986
|
-
|
|
987
|
-
}
|
|
986
|
+
await querier.run(ctx.sql, ctx.values);
|
|
987
|
+
}
|
|
988
988
|
}
|
|
989
989
|
function getDdlForTable(entity, querier, primaryKeyType) {
|
|
990
990
|
const meta = getMeta(entity);
|
|
991
|
-
let sql = `CREATE TABLE ${querier.dialect.escapeId(meta.name)} (\n\t`;
|
|
991
|
+
let sql = `CREATE TABLE IF NOT EXISTS ${querier.dialect.escapeId(meta.name)} (\n\t`;
|
|
992
992
|
const insertableIdType = 'VARCHAR(36)';
|
|
993
993
|
const defaultType = querier.dialect.escapeIdChar === '"' ? 'TEXT' : 'VARCHAR(255)';
|
|
994
994
|
const columns = getKeys(meta.fields).map((key)=>{
|
|
@@ -1002,6 +1002,8 @@ function getDdlForTable(entity, querier, primaryKeyType) {
|
|
|
1002
1002
|
propSql += 'BIGINT';
|
|
1003
1003
|
} else if (field.type === Date) {
|
|
1004
1004
|
propSql += 'TIMESTAMP';
|
|
1005
|
+
} else if (field.type === 'json' || field.type === 'jsonb') {
|
|
1006
|
+
propSql += field.type === 'jsonb' && querier.dialect.features.supportsJsonb ? 'JSONB' : 'JSON';
|
|
1005
1007
|
} else {
|
|
1006
1008
|
propSql += defaultType;
|
|
1007
1009
|
}
|