uql-orm 0.1.4 → 0.2.1
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 +39 -2
- 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 +12 -0
- 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 +5 -2
- package/dist/querier/abstractQuerier.js.map +1 -1
- package/dist/querier/abstractQuerierPool.d.ts +2 -2
- package/dist/querier/abstractQuerierPool.d.ts.map +1 -1
- package/dist/querier/abstractQuerierPool.js +2 -2
- package/dist/querier/abstractQuerierPool.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.d.ts +3 -2
- package/dist/querier/decorator/transactional.d.ts.map +1 -1
- package/dist/querier/decorator/transactional.js +2 -2
- 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/type/querierPool.d.ts +2 -2
- package/dist/type/querierPool.d.ts.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
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [0.1
|
|
6
|
+
## [0.2.1](https://github.com/rogerpadilla/uql/compare/uql-orm@0.2.0...uql-orm@0.2.1) (2026-03-08)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
*
|
|
11
|
+
* update changelog version from 0.3.0 to 0.2.1. ([3768858](https://github.com/rogerpadilla/uql/commit/3768858b532454bae5a28777b4313e2bea52aa31))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Add isolation level support to `@Transactional` and `pool.transaction`, and enable transaction reuse for nested calls. ([4c0bad5](https://github.com/rogerpadilla/uql/commit/4c0bad5265509e60a742982da2606b1c56024484))
|
|
12
17
|
|
|
13
18
|
|
|
14
19
|
|
|
@@ -20,6 +25,38 @@ All notable changes to this project will be documented in this file. Please add
|
|
|
20
25
|
|
|
21
26
|
date format is [yyyy-mm-dd]
|
|
22
27
|
|
|
28
|
+
## [0.2.1] - 2026-03-08
|
|
29
|
+
### New Features
|
|
30
|
+
- **`@Transactional({ isolationLevel })` support**: The decorator now accepts an `isolationLevel` option, forwarded to `beginTransaction()`.
|
|
31
|
+
- **`pool.transaction(callback, opts?)` support**: `TransactionOptions` (including `isolationLevel`) are now forwarded through the pool to `querier.transaction()`.
|
|
32
|
+
- **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).
|
|
33
|
+
|
|
34
|
+
## [0.2.0] - 2026-03-08
|
|
35
|
+
### New Features
|
|
36
|
+
- **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`.
|
|
37
|
+
- **PostgreSQL**: Uses inline syntax (`BEGIN TRANSACTION ISOLATION LEVEL ...`).
|
|
38
|
+
- **MySQL / MariaDB**: Uses the `SET TRANSACTION ISOLATION LEVEL` + `START TRANSACTION` two-statement pattern.
|
|
39
|
+
- **SQLite / LibSQL / MongoDB**: Isolation level is silently ignored (these databases do not support configurable isolation levels).
|
|
40
|
+
```ts
|
|
41
|
+
await querier.beginTransaction({ isolationLevel: 'serializable' });
|
|
42
|
+
// or with the callback API
|
|
43
|
+
const result = await querier.transaction(async () => {
|
|
44
|
+
return querier.findMany(User, {});
|
|
45
|
+
}, { isolationLevel: 'read committed' });
|
|
46
|
+
```
|
|
47
|
+
- **Config-Driven Dialect Strategy**: Added `isolationLevelStrategy` to `DialectConfig` (`'inline'` | `'set-before'` | `'none'`), enabling declarative per-dialect SQL generation without dialect-name branching.
|
|
48
|
+
|
|
49
|
+
## [0.1.5] - 2026-03-08
|
|
50
|
+
### Type Safety
|
|
51
|
+
- **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`).
|
|
52
|
+
- **Typed `raw()` Return**: `raw()` now returns `QueryRaw` instead of `any`, enabling IDE autocompletion and compile-time validation.
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
- **Fixed `IsolationLevel` Typo**: Corrected `'repeteable read'` → `'repeatable read'` in the `IsolationLevel` type.
|
|
56
|
+
|
|
57
|
+
### Security
|
|
58
|
+
- **`raw()` Safety Documentation**: Added JSDoc warning that `raw()` bypasses SQL parameterization, with guidance to use `$where` operators for user-supplied data.
|
|
59
|
+
|
|
23
60
|
## [0.1.4] - 2026-03-08
|
|
24
61
|
### Bug Fixes
|
|
25
62
|
- **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.
|
|
@@ -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() {
|