@zeroxsolutions/db 10.4.0 → 10.4.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
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 10.4.1 (2026-10-29)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **db:** hand runOnBackend's work a transaction of the db's own driver ([6aee510](https://github.com/zeroxsolutions/zeroxsolutions/commit/6aee510))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- luongvantuit
|
|
10
|
+
|
|
1
11
|
## 10.4.0 (2026-10-28)
|
|
2
12
|
|
|
3
13
|
### 🚀 Features
|
|
@@ -17,11 +17,14 @@ export interface BlockedWaitOptions {
|
|
|
17
17
|
/**
|
|
18
18
|
* Opens a transaction on `db`, reads the backend it runs on, then runs `work` inside it.
|
|
19
19
|
*
|
|
20
|
+
* `work` is handed a transaction of `db`'s own driver, so it can pass that transaction on to code
|
|
21
|
+
* typed on the driver, such as this package's postgres `Executor`.
|
|
22
|
+
*
|
|
20
23
|
* The transaction holds one pooled connection until `work` settles, so a spec can hold a lock on one
|
|
21
24
|
* backend and queue a second backend behind it. `pid` rejects with `result` when the transaction
|
|
22
25
|
* cannot start.
|
|
23
26
|
*/
|
|
24
|
-
export declare function runOnBackend<TSchema extends Record<string, unknown>, T>(db: PgDatabase<
|
|
27
|
+
export declare function runOnBackend<TQueryResult extends PgQueryResultHKT, TSchema extends Record<string, unknown>, T>(db: PgDatabase<TQueryResult, TSchema>, work: (tx: PgTransaction<TQueryResult, TSchema, ExtractTablesWithRelations<TSchema>>) => Promise<T>): BackendRun<T>;
|
|
25
28
|
/**
|
|
26
29
|
* Resolves once backend `holder` is among the backends `waiter` waits on for a lock.
|
|
27
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocking-backend.d.ts","sourceRoot":"","sources":["../../src/testing/blocking-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAO,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEvF,wFAAwF;AACxF,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4EAA4E;IAC5E,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,6BAA6B;IAC7B,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"blocking-backend.d.ts","sourceRoot":"","sources":["../../src/testing/blocking-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAO,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEvF,wFAAwF;AACxF,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4EAA4E;IAC5E,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,6BAA6B;IAC7B,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,YAAY,SAAS,gBAAgB,EAAE,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAC5G,EAAE,EAAE,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,EACrC,IAAI,EAAE,CAAC,EAAE,EAAE,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAClG,UAAU,CAAC,CAAC,CAAC,CAkBf;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzD,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,EACpC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,EACpC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -2,6 +2,9 @@ import { sql } from 'drizzle-orm';
|
|
|
2
2
|
/**
|
|
3
3
|
* Opens a transaction on `db`, reads the backend it runs on, then runs `work` inside it.
|
|
4
4
|
*
|
|
5
|
+
* `work` is handed a transaction of `db`'s own driver, so it can pass that transaction on to code
|
|
6
|
+
* typed on the driver, such as this package's postgres `Executor`.
|
|
7
|
+
*
|
|
5
8
|
* The transaction holds one pooled connection until `work` settles, so a spec can hold a lock on one
|
|
6
9
|
* backend and queue a second backend behind it. `pid` rejects with `result` when the transaction
|
|
7
10
|
* cannot start.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeroxsolutions/db",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.1",
|
|
4
4
|
"description": "Generic Drizzle toolkit - the id column and audit timestamps a table takes, a base repository, the unit-of-work and transactional outbox impls, and the filter/sort/pagination query helpers, for PostgreSQL (postgres-js) and Cloudflare D1; ships no domain schema. Shared across ZeroXSolutions services.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|