uql-orm 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -15
- package/dist/browser/uql-browser.min.js +1 -1
- package/dist/browser/uql-browser.min.js.map +1 -1
- package/dist/dialect/abstractSqlDialect.d.ts +2 -1
- package/dist/dialect/abstractSqlDialect.d.ts.map +1 -1
- package/dist/dialect/abstractSqlDialect.js +14 -5
- package/dist/dialect/abstractSqlDialect.js.map +1 -1
- package/dist/dialect/dialectConfig.d.ts +2 -0
- package/dist/dialect/dialectConfig.d.ts.map +1 -1
- package/dist/dialect/dialectConfig.js +5 -0
- package/dist/dialect/dialectConfig.js.map +1 -1
- package/dist/entity/decorator/definition.d.ts +1 -0
- package/dist/entity/decorator/definition.d.ts.map +1 -1
- package/dist/entity/decorator/definition.js +13 -3
- package/dist/entity/decorator/definition.js.map +1 -1
- package/dist/entity/decorator/index-decorator.d.ts.map +1 -1
- package/dist/entity/decorator/index-decorator.js +1 -14
- package/dist/entity/decorator/index-decorator.js.map +1 -1
- package/dist/express/querierMiddleware.d.ts +1 -1
- package/dist/express/querierMiddleware.d.ts.map +1 -1
- package/dist/express/querierMiddleware.js +3 -3
- package/dist/express/querierMiddleware.js.map +1 -1
- package/dist/libsql/libsqlQuerier.d.ts +2 -2
- package/dist/libsql/libsqlQuerier.d.ts.map +1 -1
- package/dist/libsql/libsqlQuerier.js +2 -2
- package/dist/libsql/libsqlQuerier.js.map +1 -1
- package/dist/maria/mariadbQuerierPool.d.ts +3 -1
- package/dist/maria/mariadbQuerierPool.d.ts.map +1 -1
- package/dist/maria/mariadbQuerierPool.js.map +1 -1
- package/dist/mongo/mongoDialect.d.ts +1 -1
- package/dist/mongo/mongoDialect.d.ts.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 +2 -2
- package/dist/mongo/mongodbQuerier.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 +2 -2
- 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 +6 -3
- package/dist/querier/abstractSqlQuerier.js.map +1 -1
- package/dist/querier/decorator/log.d.ts.map +1 -1
- package/dist/querier/decorator/log.js.map +1 -1
- package/dist/querier/decorator/serialized.js.map +1 -1
- package/dist/querier/decorator/transactional.js.map +1 -1
- package/dist/sqlite/sqliteQuerierPool.d.ts.map +1 -1
- package/dist/sqlite/sqliteQuerierPool.js +6 -5
- package/dist/sqlite/sqliteQuerierPool.js.map +1 -1
- package/dist/type/querier.d.ts +9 -3
- package/dist/type/querier.d.ts.map +1 -1
- package/dist/type/querier.js.map +1 -1
- package/dist/util/raw.d.ts +14 -5
- package/dist/util/raw.d.ts.map +1 -1
- package/dist/util/raw.js +12 -3
- package/dist/util/raw.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [0.1.3](https://github.com/rogerpadilla/uql/compare/uql-orm@0.1.2...uql-orm@0.1.3) (2026-03-08)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Performance Improvements
|
|
10
|
-
|
|
11
|
-
* Reduce allocations and simplify logic in utility functions and SQL query generation. ([5bc1ed5](https://github.com/rogerpadilla/uql/commit/5bc1ed5d85b91ba4af96075a91c93c923a204e76))
|
|
1
|
+
# Changelog
|
|
12
2
|
|
|
3
|
+
All notable changes to this project will be documented in this file. Please add new changes to the top.
|
|
13
4
|
|
|
5
|
+
date format is [yyyy-mm-dd]
|
|
14
6
|
|
|
7
|
+
## [0.2.0] - 2026-03-08
|
|
8
|
+
### New Features
|
|
9
|
+
- **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`.
|
|
10
|
+
- **PostgreSQL**: Uses inline syntax (`BEGIN TRANSACTION ISOLATION LEVEL ...`).
|
|
11
|
+
- **MySQL / MariaDB**: Uses the `SET TRANSACTION ISOLATION LEVEL` + `START TRANSACTION` two-statement pattern.
|
|
12
|
+
- **SQLite / LibSQL / MongoDB**: Isolation level is silently ignored (these databases do not support configurable isolation levels).
|
|
13
|
+
```ts
|
|
14
|
+
await querier.beginTransaction({ isolationLevel: 'serializable' });
|
|
15
|
+
// or with the callback API
|
|
16
|
+
const result = await querier.transaction(async () => {
|
|
17
|
+
return querier.findMany(User, {});
|
|
18
|
+
}, { isolationLevel: 'read committed' });
|
|
19
|
+
```
|
|
20
|
+
- **Config-Driven Dialect Strategy**: Added `isolationLevelStrategy` to `DialectConfig` (`'inline'` | `'set-before'` | `'none'`), enabling declarative per-dialect SQL generation without dialect-name branching.
|
|
15
21
|
|
|
22
|
+
## [0.1.5] - 2026-03-08
|
|
23
|
+
### Type Safety
|
|
24
|
+
- **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`).
|
|
25
|
+
- **Typed `raw()` Return**: `raw()` now returns `QueryRaw` instead of `any`, enabling IDE autocompletion and compile-time validation.
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
- **Fixed `IsolationLevel` Typo**: Corrected `'repeteable read'` → `'repeatable read'` in the `IsolationLevel` type.
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
### Security
|
|
31
|
+
- **`raw()` Safety Documentation**: Added JSDoc warning that `raw()` bypasses SQL parameterization, with guidance to use `$where` operators for user-supplied data.
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
## [0.1.4] - 2026-03-08
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
- **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.
|
|
22
36
|
|
|
23
37
|
## [0.1.3] - 2026-03-08
|
|
24
38
|
### Code Quality
|
|
@@ -26,7 +40,7 @@ date format is [yyyy-mm-dd]
|
|
|
26
40
|
|
|
27
41
|
## [0.1.1] - 2026-03-08
|
|
28
42
|
### Bug Fixes
|
|
29
|
-
- **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.
|
|
43
|
+
- **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.
|
|
30
44
|
|
|
31
45
|
### Performance
|
|
32
46
|
- **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.
|
|
@@ -774,7 +774,7 @@ class ItemAdjustment extends (_BaseEntity12 = BaseEntity) {
|
|
|
774
774
|
}
|
|
775
775
|
|
|
776
776
|
const holder = globalThis;
|
|
777
|
-
const metaKey = 'uql-orm/entity/decorator';
|
|
777
|
+
const metaKey = Symbol.for('uql-orm/entity/decorator');
|
|
778
778
|
const metas = holder[metaKey] ?? new Map();
|
|
779
779
|
holder[metaKey] = metas;
|
|
780
780
|
function getEntities() {
|