pipework 0.7.21 → 0.7.22
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 +20 -0
- package/REFERENCE.md +66 -2
- package/dist/REFERENCE.md +66 -2
- package/dist/data/db/advisory-lock.d.ts +6 -1
- package/dist/data/db/advisory-lock.d.ts.map +1 -1
- package/dist/data/db/advisory-lock.js +20 -7
- package/dist/data/db/advisory-lock.js.map +1 -1
- package/dist/data/db/bulk-set.d.ts.map +1 -1
- package/dist/data/db/bulk-set.js +12 -20
- package/dist/data/db/bulk-set.js.map +1 -1
- package/dist/data/db/composed.d.ts +23 -0
- package/dist/data/db/composed.d.ts.map +1 -0
- package/dist/data/db/composed.js +42 -0
- package/dist/data/db/composed.js.map +1 -0
- package/dist/data/db/expressions.d.ts +32 -0
- package/dist/data/db/expressions.d.ts.map +1 -1
- package/dist/data/db/expressions.js +67 -0
- package/dist/data/db/expressions.js.map +1 -1
- package/dist/data/db/filter.d.ts +22 -1
- package/dist/data/db/filter.d.ts.map +1 -1
- package/dist/data/db/filter.js +22 -1
- package/dist/data/db/filter.js.map +1 -1
- package/dist/data/db/namespace.d.ts +26 -0
- package/dist/data/db/namespace.d.ts.map +1 -1
- package/dist/data/db/namespace.js +6 -0
- package/dist/data/db/namespace.js.map +1 -1
- package/dist/data/db/serializable.d.ts +8 -0
- package/dist/data/db/serializable.d.ts.map +1 -0
- package/dist/data/db/serializable.js +44 -0
- package/dist/data/db/serializable.js.map +1 -0
- package/dist/data/db/values.d.ts +10 -0
- package/dist/data/db/values.d.ts.map +1 -0
- package/dist/data/db/values.js +20 -0
- package/dist/data/db/values.js.map +1 -0
- package/dist/data/jsonb/composed.d.ts +8 -0
- package/dist/data/jsonb/composed.d.ts.map +1 -0
- package/dist/data/jsonb/composed.js +15 -0
- package/dist/data/jsonb/composed.js.map +1 -0
- package/dist/data/jsonb/namespace.d.ts +12 -1
- package/dist/data/jsonb/namespace.d.ts.map +1 -1
- package/dist/data/jsonb/namespace.js +12 -1
- package/dist/data/jsonb/namespace.js.map +1 -1
- package/dist/data/jsonb/query.d.ts +4 -0
- package/dist/data/jsonb/query.d.ts.map +1 -1
- package/dist/data/jsonb/query.js +21 -0
- package/dist/data/jsonb/query.js.map +1 -1
- package/dist/data/temporal/close.d.ts.map +1 -1
- package/dist/data/temporal/close.js +3 -2
- package/dist/data/temporal/close.js.map +1 -1
- package/dist/data/temporal/get-current.d.ts.map +1 -1
- package/dist/data/temporal/get-current.js +2 -1
- package/dist/data/temporal/get-current.js.map +1 -1
- package/dist/data/temporal/revise.d.ts.map +1 -1
- package/dist/data/temporal/revise.js +8 -11
- package/dist/data/temporal/revise.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.22
|
|
4
|
+
|
|
5
|
+
- **`pipe.filter.cast()`** — PostgreSQL type cast: `cast(expr, 'uuid')` produces `(expr)::uuid`. Generic return type follows the target type (#247).
|
|
6
|
+
- **`pipe.filter.interval()`** — interval literal: `interval(5, 'minutes')` produces `interval '5 minutes'` (#247).
|
|
7
|
+
- **`pipe.filter.dateTrunc()`** — truncates a timestamp to the given precision: `dateTrunc('day', col)` produces `date_trunc('day', col)` (#247).
|
|
8
|
+
- **`pipe.filter.add()` / `subtract()`** — binary arithmetic for two SQL expressions. For column ± literal, use `increment`/`decrement` (#247).
|
|
9
|
+
- **`pipe.filter.rowNumber()` / `rank()` / `denseRank()`** — window functions. Use with `pipe.filter.over(fn, { partitionBy, orderBy })` to apply a window specification (#247).
|
|
10
|
+
- **`pipe.filter.over()`** — applies `PARTITION BY` / `ORDER BY` to any window function or aggregate (#247).
|
|
11
|
+
- **`pipe.filter.identifier()`** — quoted PostgreSQL identifier. Promotes the internal `sql.identifier()` to a composable primitive (#247).
|
|
12
|
+
- **`pipe.filter.withRecursive()`** — recursive CTE: `withRecursive(alias, seed, step, finalQuery?)` produces `WITH RECURSIVE alias AS (seed UNION ALL step) finalQuery` (#248).
|
|
13
|
+
- **`pipe.filter.ago()`** — composed helper: `ago(5, 'minutes')` produces `now() - interval '5 minutes'` (#247).
|
|
14
|
+
- **`pipe.filter.castUuid()` / `castJsonb()` / `castTimestamp()` / `castBoolean()` / `castNumeric()` / `castInteger()` / `castText()`** — shorthand cast helpers (#247).
|
|
15
|
+
- **`pipe.filter.nextSequence()`** — composed helper: `nextSequence(db, col, where?)` produces `COALESCE((SELECT MAX(col) FROM table WHERE ...), 0) + 1`. Zero raw SQL — composes from `scalar`, `coalesce`, `max`, `increment` (#252).
|
|
16
|
+
- **`pipe.serializable()`** — runs a function in a `SERIALIZABLE` transaction with automatic retry on serialization failures (`40001`) and deadlocks (`40P01`). Configurable `maxAttempts` and `backoffMs` with exponential jitter (#250).
|
|
17
|
+
- **`pipe.values()`** — typed `VALUES` clause for bulk operations. Base primitive for `bulkSet` and composable in raw SQL (#247).
|
|
18
|
+
- **`pipe.advisoryLock()` — numeric namespace overload** — `advisoryLock(db, 1001, 'key')` uses a literal integer namespace instead of hashing. Existing string-key signatures unchanged (#247).
|
|
19
|
+
- **`jsonb.path()` / `pathText()`** — nested JSONB extraction: `path(col, 'a', 'b')` produces `col->'a'->'b'`; `pathText` uses `->>` on the final key (#247).
|
|
20
|
+
- **`jsonb.boolean()` / `number()` / `integer()`** — typed JSONB field extraction with automatic cast (#247).
|
|
21
|
+
- **Type exports** — `WindowSpec`, `ValueColumnDef`, `SerializableOptions` exported from `pipework` (#247).
|
|
22
|
+
|
|
3
23
|
## 0.7.21
|
|
4
24
|
|
|
5
25
|
- **Fix: vitest workspace TS resolution** — `resolveVitestWorkspace()` now registers `.js` → `.ts` resolve hooks before importing `pipework.config.ts`, matching what `discoverInstance()` already does (#225).
|
package/REFERENCE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Pipework API Reference
|
|
2
2
|
|
|
3
3
|
> Auto-generated from source JSDoc. Do not edit manually.
|
|
4
|
-
> Generated: 2026-05-
|
|
4
|
+
> Generated: 2026-05-13
|
|
5
5
|
|
|
6
6
|
## Contents
|
|
7
7
|
|
|
@@ -460,6 +460,22 @@ Runs migrations for a single named database.
|
|
|
460
460
|
|
|
461
461
|
Returns excluded-column references for onConflictDoUpdate set clauses.
|
|
462
462
|
|
|
463
|
+
### `pipe.advisoryLock`
|
|
464
|
+
|
|
465
|
+
Acquires a transaction-scoped advisory lock. Released at commit/rollback.
|
|
466
|
+
|
|
467
|
+
### `pipe.serializable`
|
|
468
|
+
|
|
469
|
+
Runs a function in a SERIALIZABLE transaction with automatic retry on serialization failures and deadlocks.
|
|
470
|
+
|
|
471
|
+
### `pipe.bulkSet`
|
|
472
|
+
|
|
473
|
+
Bulk UPDATE ... FROM (VALUES ...) — updates multiple rows with per-row values in a single statement.
|
|
474
|
+
|
|
475
|
+
### `pipe.values`
|
|
476
|
+
|
|
477
|
+
Produces a typed VALUES clause for bulk operations — the base primitive for bulkSet and bulkUpsert.
|
|
478
|
+
|
|
463
479
|
### `pipe.field`
|
|
464
480
|
|
|
465
481
|
Field builders for domain definitions — uuid(), text(), integer(), etc.
|
|
@@ -472,9 +488,29 @@ Registers a domain definition with table, validators, and factory projections.
|
|
|
472
488
|
|
|
473
489
|
Returns the global registry of all domain definitions.
|
|
474
490
|
|
|
491
|
+
### Types
|
|
492
|
+
|
|
493
|
+
**`WindowSpec`**
|
|
494
|
+
|
|
495
|
+
```typescript
|
|
496
|
+
interface WindowSpec
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
**`ValueColumnDef`**
|
|
500
|
+
|
|
501
|
+
```typescript
|
|
502
|
+
interface ValueColumnDef
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**`SerializableOptions`**
|
|
506
|
+
|
|
507
|
+
```typescript
|
|
508
|
+
interface SerializableOptions
|
|
509
|
+
```
|
|
510
|
+
|
|
475
511
|
## jsonb — JSONB Column Helpers
|
|
476
512
|
|
|
477
|
-
JSONB query operators — typed helpers for PostgreSQL JSONB containment and
|
|
513
|
+
JSONB query operators — typed helpers for PostgreSQL JSONB containment, key checks, and field extraction.
|
|
478
514
|
|
|
479
515
|
### `jsonb.contains`
|
|
480
516
|
|
|
@@ -488,6 +524,34 @@ The <@ contained-by operator — tests whether a JSONB column is contained by th
|
|
|
488
524
|
|
|
489
525
|
The ? key-existence operator — tests whether a JSONB column has the given top-level key.
|
|
490
526
|
|
|
527
|
+
### `jsonb.text`
|
|
528
|
+
|
|
529
|
+
Extracts a text value: `column->>'key'`. Composable with pipe.filter operators.
|
|
530
|
+
|
|
531
|
+
### `jsonb.json`
|
|
532
|
+
|
|
533
|
+
Extracts a JSONB value: `column->'key'`. Returns JSONB — use with jsonb.contains() etc.
|
|
534
|
+
|
|
535
|
+
### `jsonb.path`
|
|
536
|
+
|
|
537
|
+
Extracts a nested JSONB value: `column->'a'->'b'`. Returns JSONB.
|
|
538
|
+
|
|
539
|
+
### `jsonb.pathText`
|
|
540
|
+
|
|
541
|
+
Extracts a nested text value: `column->'a'->>'b'`. Intermediate keys use `->`, final uses `->>`.
|
|
542
|
+
|
|
543
|
+
### `jsonb.boolean`
|
|
544
|
+
|
|
545
|
+
Extracts a boolean: `(column->>'key')::boolean`. Supports nested paths.
|
|
546
|
+
|
|
547
|
+
### `jsonb.number`
|
|
548
|
+
|
|
549
|
+
Extracts a number: `(column->>'key')::numeric`. Supports nested paths.
|
|
550
|
+
|
|
551
|
+
### `jsonb.integer`
|
|
552
|
+
|
|
553
|
+
Extracts an integer: `(column->>'key')::integer`. Supports nested paths.
|
|
554
|
+
|
|
491
555
|
## schema — Validation & Schema
|
|
492
556
|
|
|
493
557
|
Schema definition and validation namespace — wraps zod for validation, drizzle for table/column/index definitions.
|
package/dist/REFERENCE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Pipework API Reference
|
|
2
2
|
|
|
3
3
|
> Auto-generated from source JSDoc. Do not edit manually.
|
|
4
|
-
> Generated: 2026-05-
|
|
4
|
+
> Generated: 2026-05-13
|
|
5
5
|
|
|
6
6
|
## Contents
|
|
7
7
|
|
|
@@ -460,6 +460,22 @@ Runs migrations for a single named database.
|
|
|
460
460
|
|
|
461
461
|
Returns excluded-column references for onConflictDoUpdate set clauses.
|
|
462
462
|
|
|
463
|
+
### `pipe.advisoryLock`
|
|
464
|
+
|
|
465
|
+
Acquires a transaction-scoped advisory lock. Released at commit/rollback.
|
|
466
|
+
|
|
467
|
+
### `pipe.serializable`
|
|
468
|
+
|
|
469
|
+
Runs a function in a SERIALIZABLE transaction with automatic retry on serialization failures and deadlocks.
|
|
470
|
+
|
|
471
|
+
### `pipe.bulkSet`
|
|
472
|
+
|
|
473
|
+
Bulk UPDATE ... FROM (VALUES ...) — updates multiple rows with per-row values in a single statement.
|
|
474
|
+
|
|
475
|
+
### `pipe.values`
|
|
476
|
+
|
|
477
|
+
Produces a typed VALUES clause for bulk operations — the base primitive for bulkSet and bulkUpsert.
|
|
478
|
+
|
|
463
479
|
### `pipe.field`
|
|
464
480
|
|
|
465
481
|
Field builders for domain definitions — uuid(), text(), integer(), etc.
|
|
@@ -472,9 +488,29 @@ Registers a domain definition with table, validators, and factory projections.
|
|
|
472
488
|
|
|
473
489
|
Returns the global registry of all domain definitions.
|
|
474
490
|
|
|
491
|
+
### Types
|
|
492
|
+
|
|
493
|
+
**`WindowSpec`**
|
|
494
|
+
|
|
495
|
+
```typescript
|
|
496
|
+
interface WindowSpec
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
**`ValueColumnDef`**
|
|
500
|
+
|
|
501
|
+
```typescript
|
|
502
|
+
interface ValueColumnDef
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**`SerializableOptions`**
|
|
506
|
+
|
|
507
|
+
```typescript
|
|
508
|
+
interface SerializableOptions
|
|
509
|
+
```
|
|
510
|
+
|
|
475
511
|
## jsonb — JSONB Column Helpers
|
|
476
512
|
|
|
477
|
-
JSONB query operators — typed helpers for PostgreSQL JSONB containment and
|
|
513
|
+
JSONB query operators — typed helpers for PostgreSQL JSONB containment, key checks, and field extraction.
|
|
478
514
|
|
|
479
515
|
### `jsonb.contains`
|
|
480
516
|
|
|
@@ -488,6 +524,34 @@ The <@ contained-by operator — tests whether a JSONB column is contained by th
|
|
|
488
524
|
|
|
489
525
|
The ? key-existence operator — tests whether a JSONB column has the given top-level key.
|
|
490
526
|
|
|
527
|
+
### `jsonb.text`
|
|
528
|
+
|
|
529
|
+
Extracts a text value: `column->>'key'`. Composable with pipe.filter operators.
|
|
530
|
+
|
|
531
|
+
### `jsonb.json`
|
|
532
|
+
|
|
533
|
+
Extracts a JSONB value: `column->'key'`. Returns JSONB — use with jsonb.contains() etc.
|
|
534
|
+
|
|
535
|
+
### `jsonb.path`
|
|
536
|
+
|
|
537
|
+
Extracts a nested JSONB value: `column->'a'->'b'`. Returns JSONB.
|
|
538
|
+
|
|
539
|
+
### `jsonb.pathText`
|
|
540
|
+
|
|
541
|
+
Extracts a nested text value: `column->'a'->>'b'`. Intermediate keys use `->`, final uses `->>`.
|
|
542
|
+
|
|
543
|
+
### `jsonb.boolean`
|
|
544
|
+
|
|
545
|
+
Extracts a boolean: `(column->>'key')::boolean`. Supports nested paths.
|
|
546
|
+
|
|
547
|
+
### `jsonb.number`
|
|
548
|
+
|
|
549
|
+
Extracts a number: `(column->>'key')::numeric`. Supports nested paths.
|
|
550
|
+
|
|
551
|
+
### `jsonb.integer`
|
|
552
|
+
|
|
553
|
+
Extracts an integer: `(column->>'key')::integer`. Supports nested paths.
|
|
554
|
+
|
|
491
555
|
## schema — Validation & Schema
|
|
492
556
|
|
|
493
557
|
Schema definition and validation namespace — wraps zod for validation, drizzle for table/column/index definitions.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { DB } from './types.js';
|
|
2
|
-
/** Acquires a transaction-scoped advisory lock. Released automatically at commit/rollback.
|
|
2
|
+
/** Acquires a transaction-scoped advisory lock. Released automatically at commit/rollback.
|
|
3
|
+
*
|
|
4
|
+
* String keys: hashed independently into the int4 arguments of pg_advisory_xact_lock.
|
|
5
|
+
* Numeric namespace: `advisoryLock(db, 1001, 'key')` → `pg_advisory_xact_lock(1001, hashtext('key'))`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function advisoryLock(db: DB, namespace: number, key: string): Promise<void>;
|
|
3
8
|
export declare function advisoryLock(db: DB, ...keys: string[]): Promise<void>;
|
|
4
9
|
//# sourceMappingURL=advisory-lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advisory-lock.d.ts","sourceRoot":"","sources":["../../../src/data/db/advisory-lock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAEpC,
|
|
1
|
+
{"version":3,"file":"advisory-lock.d.ts","sourceRoot":"","sources":["../../../src/data/db/advisory-lock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAEpC;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACzF,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { sql } from './sql.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export async function advisoryLock(db, first, ...rest) {
|
|
3
|
+
if (typeof first === 'number') {
|
|
4
|
+
const key = rest[0];
|
|
5
|
+
if (key === undefined) {
|
|
6
|
+
throw new Error('[pipework] advisoryLock(db, namespace, key) requires a key string.\n\n' +
|
|
7
|
+
' advisoryLock(db, 1001, \'my-entity\') — numeric namespace + string key\n' +
|
|
8
|
+
' advisoryLock(db, \'key1\', \'key2\') — two hashed string keys\n');
|
|
9
|
+
}
|
|
10
|
+
await db.execute(sql `SELECT pg_advisory_xact_lock(${first}, hashtext(${key}))`);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (first === undefined) {
|
|
14
|
+
throw new Error('[pipework] advisoryLock requires at least one key.\n\n' +
|
|
15
|
+
' advisoryLock(db, \'my-lock\') — single hashed key\n' +
|
|
16
|
+
' advisoryLock(db, \'key1\', \'key2\') — two hashed keys\n' +
|
|
17
|
+
' advisoryLock(db, 1001, \'my-entity\') — numeric namespace + hashed key\n');
|
|
18
|
+
}
|
|
19
|
+
if (rest.length === 0) {
|
|
20
|
+
await db.execute(sql `SELECT pg_advisory_xact_lock(hashtext(${first}))`);
|
|
8
21
|
}
|
|
9
22
|
else {
|
|
10
|
-
await db.execute(sql `SELECT pg_advisory_xact_lock(hashtext(${
|
|
23
|
+
await db.execute(sql `SELECT pg_advisory_xact_lock(hashtext(${first}), hashtext(${rest[0]}))`);
|
|
11
24
|
}
|
|
12
25
|
}
|
|
13
26
|
//# sourceMappingURL=advisory-lock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advisory-lock.js","sourceRoot":"","sources":["../../../src/data/db/advisory-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"advisory-lock.js","sourceRoot":"","sources":["../../../src/data/db/advisory-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAU9B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAM,EAAE,KAAuB,EAAE,GAAG,IAAc;IACnF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACnB,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,wEAAwE;gBACxE,6EAA6E;gBAC7E,wEAAwE,CACzE,CAAA;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAA,gCAAgC,KAAK,cAAc,GAAG,IAAI,CAAC,CAAA;QAC/E,OAAM;IACR,CAAC;IAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,wDAAwD;YACxD,mEAAmE;YACnE,mEAAmE;YACnE,+EAA+E,CAChF,CAAA;IACH,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAA,yCAAyC,KAAK,IAAI,CAAC,CAAA;IACzE,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAA,yCAAyC,KAAK,eAAe,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,CAAA;IAChG,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-set.d.ts","sourceRoot":"","sources":["../../../src/data/db/bulk-set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bulk-set.d.ts","sourceRoot":"","sources":["../../../src/data/db/bulk-set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAO3C,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAA;AAEzL,UAAU,cAAc,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,MAAM,CAAA;IACnC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,CAAA;IAChD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;CAClE;AAED,4FAA4F;AAC5F,wBAAsB,OAAO,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,IAAI,EAAE,EACrB,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAC5B,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
package/dist/data/db/bulk-set.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { sql } from './sql.js';
|
|
2
1
|
import { getTableName, getTableColumns } from './generated/drizzle-orm/introspection.js';
|
|
2
|
+
import { values } from './values.js';
|
|
3
|
+
import { identifier } from './expressions.js';
|
|
4
|
+
import { sql } from './sql.js';
|
|
3
5
|
/** Executes UPDATE ... FROM (VALUES ...) for bulk per-row updates in a single statement. */
|
|
4
6
|
export async function bulkSet(db, table, rows, options) {
|
|
5
7
|
if (rows.length === 0)
|
|
@@ -7,28 +9,18 @@ export async function bulkSet(db, table, rows, options) {
|
|
|
7
9
|
const tableName = getTableName(table);
|
|
8
10
|
const columns = getTableColumns(table);
|
|
9
11
|
const allKeys = [options.match, ...options.set];
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return sql `${val}::${sql.raw(cast)}`;
|
|
18
|
-
});
|
|
19
|
-
return sql `(${sql.join(cols, sql `, `)})`;
|
|
20
|
-
});
|
|
21
|
-
const valuesClause = sql.join(valueRows, sql `, `);
|
|
22
|
-
const colNames = allKeys.map(k => {
|
|
23
|
-
const col = columns[k];
|
|
24
|
-
return col ? col.name : k;
|
|
25
|
-
});
|
|
26
|
-
const valsDef = colNames.join(', ');
|
|
12
|
+
const columnDefs = allKeys.map(key => ({
|
|
13
|
+
name: columns[key]?.name ?? key,
|
|
14
|
+
type: options.types[key],
|
|
15
|
+
}));
|
|
16
|
+
const rowArrays = rows.map(row => allKeys.map(key => row[key]));
|
|
17
|
+
const valuesClause = values(rowArrays, columnDefs);
|
|
18
|
+
const colNames = columnDefs.map(c => c.name);
|
|
27
19
|
const matchCol = columns[options.match]?.name ?? options.match;
|
|
28
20
|
const setClauses = options.set.map(key => {
|
|
29
21
|
const colName = columns[key]?.name ?? key;
|
|
30
|
-
return sql `${
|
|
22
|
+
return sql `${identifier(colName)} = ${sql.raw('_vals.' + '"' + colName + '"')}`;
|
|
31
23
|
});
|
|
32
|
-
await db.execute(sql `UPDATE ${
|
|
24
|
+
await db.execute(sql `UPDATE ${identifier(tableName)} SET ${sql.join(setClauses, sql `, `)} FROM ${valuesClause} AS _vals(${sql.raw(colNames.join(', '))}) WHERE ${identifier(tableName)}.${identifier(matchCol)} = ${sql.raw('_vals.' + '"' + matchCol + '"')}`);
|
|
33
25
|
}
|
|
34
26
|
//# sourceMappingURL=bulk-set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-set.js","sourceRoot":"","sources":["../../../src/data/db/bulk-set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bulk-set.js","sourceRoot":"","sources":["../../../src/data/db/bulk-set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,G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CAAA,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,GAAG,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC,EAAE,CAAA;IACjF,CAAC,CAAC,CAAA;IAEF,MAAM,EAAE,CAAC,OAAO,CACd,GAAG,CAAA,UAAU,UAAU,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAA,IAAI,CAAC,SAAS,YAAY,aAAa,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,UAAU,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,GAAG,CAAC,EAAE,CAC9O,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SQL, Column, DB } from './types.js';
|
|
2
|
+
import type { SQLWrapper } from '../query/sql/sql.js';
|
|
3
|
+
type IntervalUnit = 'microseconds' | 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years';
|
|
4
|
+
/** `now() - interval '5 minutes'`. Composes `now`, `subtract`, and `interval`. */
|
|
5
|
+
export declare function ago(amount: number, unit: IntervalUnit): SQL<Date>;
|
|
6
|
+
/** Shorthand for `cast(expr, 'uuid')`. */
|
|
7
|
+
export declare function castUuid(expression: SQL | Column | SQLWrapper): SQL<string>;
|
|
8
|
+
/** Shorthand for `cast(expr, 'jsonb')`. */
|
|
9
|
+
export declare function castJsonb(expression: SQL | Column | SQLWrapper): SQL;
|
|
10
|
+
/** Shorthand for `cast(expr, 'timestamptz')`. */
|
|
11
|
+
export declare function castTimestamp(expression: SQL | Column | SQLWrapper): SQL<Date>;
|
|
12
|
+
/** Shorthand for `cast(expr, 'boolean')`. */
|
|
13
|
+
export declare function castBoolean(expression: SQL | Column | SQLWrapper): SQL<boolean>;
|
|
14
|
+
/** Shorthand for `cast(expr, 'numeric')`. */
|
|
15
|
+
export declare function castNumeric(expression: SQL | Column | SQLWrapper): SQL<number>;
|
|
16
|
+
/** Shorthand for `cast(expr, 'integer')`. */
|
|
17
|
+
export declare function castInteger(expression: SQL | Column | SQLWrapper): SQL<number>;
|
|
18
|
+
/** Shorthand for `cast(expr, 'text')`. */
|
|
19
|
+
export declare function castText(expression: SQL | Column | SQLWrapper): SQL<string>;
|
|
20
|
+
/** `COALESCE((SELECT MAX(column) FROM table WHERE condition), 0) + 1`. Composes scalar, coalesce, max, increment. */
|
|
21
|
+
export declare function nextSequence(db: DB, column: Column, where?: SQL): SQL<number>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=composed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composed.d.ts","sourceRoot":"","sources":["../../../src/data/db/composed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,KAAK,YAAY,GAAG,cAAc,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE7H,kFAAkF;AAClF,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,CAEjE;AAED,0CAA0C;AAC1C,wBAAgB,QAAQ,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3E;AAED,2CAA2C;AAC3C,wBAAgB,SAAS,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAEpE;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,CAE9E;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,CAE/E;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAE9E;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAE9E;AAED,0CAA0C;AAC1C,wBAAgB,QAAQ,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3E;AAED,qHAAqH;AACrH,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAK7E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { now, subtract, interval, cast, scalar, coalesce, increment } from './expressions.js';
|
|
2
|
+
import { max } from './generated/drizzle-orm/aggregate.js';
|
|
3
|
+
/** `now() - interval '5 minutes'`. Composes `now`, `subtract`, and `interval`. */
|
|
4
|
+
export function ago(amount, unit) {
|
|
5
|
+
return subtract(now(), interval(amount, unit));
|
|
6
|
+
}
|
|
7
|
+
/** Shorthand for `cast(expr, 'uuid')`. */
|
|
8
|
+
export function castUuid(expression) {
|
|
9
|
+
return cast(expression, 'uuid');
|
|
10
|
+
}
|
|
11
|
+
/** Shorthand for `cast(expr, 'jsonb')`. */
|
|
12
|
+
export function castJsonb(expression) {
|
|
13
|
+
return cast(expression, 'jsonb');
|
|
14
|
+
}
|
|
15
|
+
/** Shorthand for `cast(expr, 'timestamptz')`. */
|
|
16
|
+
export function castTimestamp(expression) {
|
|
17
|
+
return cast(expression, 'timestamptz');
|
|
18
|
+
}
|
|
19
|
+
/** Shorthand for `cast(expr, 'boolean')`. */
|
|
20
|
+
export function castBoolean(expression) {
|
|
21
|
+
return cast(expression, 'boolean');
|
|
22
|
+
}
|
|
23
|
+
/** Shorthand for `cast(expr, 'numeric')`. */
|
|
24
|
+
export function castNumeric(expression) {
|
|
25
|
+
return cast(expression, 'numeric');
|
|
26
|
+
}
|
|
27
|
+
/** Shorthand for `cast(expr, 'integer')`. */
|
|
28
|
+
export function castInteger(expression) {
|
|
29
|
+
return cast(expression, 'integer');
|
|
30
|
+
}
|
|
31
|
+
/** Shorthand for `cast(expr, 'text')`. */
|
|
32
|
+
export function castText(expression) {
|
|
33
|
+
return cast(expression, 'text');
|
|
34
|
+
}
|
|
35
|
+
/** `COALESCE((SELECT MAX(column) FROM table WHERE condition), 0) + 1`. Composes scalar, coalesce, max, increment. */
|
|
36
|
+
export function nextSequence(db, column, where) {
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- drizzle's select/from generics require concrete schema types
|
|
38
|
+
const base = db.select({ v: max(column) }).from(column.table);
|
|
39
|
+
const subquery = where !== undefined ? base.where(where) : base;
|
|
40
|
+
return increment(coalesce(scalar(subquery), 0), 1);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=composed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composed.js","sourceRoot":"","sources":["../../../src/data/db/composed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAA;AAK1D,kFAAkF;AAClF,MAAM,UAAU,GAAG,CAAC,MAAc,EA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SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC/D,OAAO,SAAS,CAAC,QAAQ,CAAS,MAAM,CAAS,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACpE,CAAC"}
|
|
@@ -4,10 +4,42 @@ import type { SQLWrapper } from '../query/sql/sql.js';
|
|
|
4
4
|
export declare function increment(column: Column | SQL, amount: number): SQL<number>;
|
|
5
5
|
/** Returns `column - amount`. Convenience wrapper — equivalent to `increment(column, -amount)`. */
|
|
6
6
|
export declare function decrement(column: Column | SQL, amount: number): SQL<number>;
|
|
7
|
+
/** Returns `left + right` for two SQL expressions. For column + literal number, use `increment`. */
|
|
8
|
+
export declare function add<T = unknown>(left: Column | SQL, right: Column | SQL): SQL<T>;
|
|
9
|
+
/** Returns `left - right` for two SQL expressions. For column - literal number, use `decrement`. */
|
|
10
|
+
export declare function subtract<T = unknown>(left: Column | SQL, right: Column | SQL): SQL<T>;
|
|
7
11
|
/** Wraps an expression with COALESCE — returns `defaultValue` when the expression is NULL. */
|
|
8
12
|
export declare function coalesce<T>(expression: SQL | Column, defaultValue: T): SQL<T>;
|
|
9
13
|
/** Returns a SQL expression for PostgreSQL `now()` — the current transaction timestamp. */
|
|
10
14
|
export declare function now(): SQL<Date>;
|
|
11
15
|
/** Wraps a select query as a scalar subquery expression, usable in `.values()` and `.set()`. */
|
|
12
16
|
export declare function scalar<T>(subquery: SQLWrapper): SQL<T>;
|
|
17
|
+
type IntervalUnit = 'microseconds' | 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years';
|
|
18
|
+
/** PostgreSQL type cast: `expression::pgType`. */
|
|
19
|
+
export declare function cast<T = unknown>(expression: SQL | Column | SQLWrapper, pgType: string): SQL<T>;
|
|
20
|
+
/** PostgreSQL interval literal: `interval '5 minutes'`. */
|
|
21
|
+
export declare function interval(amount: number, unit: IntervalUnit): SQL;
|
|
22
|
+
/** PostgreSQL `date_trunc('unit', column)` — truncates a timestamp to the given precision. */
|
|
23
|
+
export declare function dateTrunc(unit: 'microseconds' | 'milliseconds' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year' | 'decade' | 'century' | 'millennium', column: Column | SQL): SQL<Date>;
|
|
24
|
+
/** PostgreSQL `ROW_NUMBER()` window function. Use with `over()` to apply a window specification. */
|
|
25
|
+
export declare function rowNumber(): SQL<number>;
|
|
26
|
+
/** PostgreSQL `RANK()` window function. Use with `over()` to apply a window specification. */
|
|
27
|
+
export declare function rank(): SQL<number>;
|
|
28
|
+
/** PostgreSQL `DENSE_RANK()` window function. Use with `over()` to apply a window specification. */
|
|
29
|
+
export declare function denseRank(): SQL<number>;
|
|
30
|
+
export interface WindowSpec {
|
|
31
|
+
readonly partitionBy?: Column | SQL | ReadonlyArray<Column | SQL>;
|
|
32
|
+
readonly orderBy?: SQL | ReadonlyArray<SQL>;
|
|
33
|
+
}
|
|
34
|
+
/** Applies a window specification to a window function or aggregate: `fn OVER (PARTITION BY ... ORDER BY ...)`. */
|
|
35
|
+
export declare function over<T>(fn: SQL<T>, spec: WindowSpec): SQL<T>;
|
|
36
|
+
/** PostgreSQL quoted identifier: `"name"`. Promotes `sql.identifier` to a base primitive. */
|
|
37
|
+
export declare function identifier(name: string): SQL;
|
|
38
|
+
/** PostgreSQL `WITH RECURSIVE alias AS (seed UNION ALL step) finalQuery`. If `finalQuery` is omitted, defaults to `SELECT * FROM alias`. */
|
|
39
|
+
export declare function withRecursive(alias: string, seed: SQL, step: SQL, finalQuery?: SQL): SQL;
|
|
40
|
+
/** PostgreSQL `pg_current_wal_lsn()` — returns the current WAL write position on the primary. Internal primitive for replica-aware job execution. */
|
|
41
|
+
export declare function walCurrentLsn(): SQL<string>;
|
|
42
|
+
/** PostgreSQL `pg_last_wal_replay_lsn()` — returns the last replayed WAL position on a replica. Returns NULL on the primary. Internal primitive for replica-aware job execution. */
|
|
43
|
+
export declare function walReplayLsn(): SQL<string>;
|
|
44
|
+
export {};
|
|
13
45
|
//# sourceMappingURL=expressions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../../src/data/db/expressions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3E;AAED,mGAAmG;AACnG,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAE3E;AAED,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAE7E;AAED,2FAA2F;AAC3F,wBAAgB,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAE/B;AAED,gGAAgG;AAChG,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,CAEtD"}
|
|
1
|
+
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../../src/data/db/expressions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,GA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|
@@ -7,6 +7,14 @@ export function increment(column, amount) {
|
|
|
7
7
|
export function decrement(column, amount) {
|
|
8
8
|
return sql `${column} - ${amount}`;
|
|
9
9
|
}
|
|
10
|
+
/** Returns `left + right` for two SQL expressions. For column + literal number, use `increment`. */
|
|
11
|
+
export function add(left, right) {
|
|
12
|
+
return sql `${left} + ${right}`;
|
|
13
|
+
}
|
|
14
|
+
/** Returns `left - right` for two SQL expressions. For column - literal number, use `decrement`. */
|
|
15
|
+
export function subtract(left, right) {
|
|
16
|
+
return sql `${left} - ${right}`;
|
|
17
|
+
}
|
|
10
18
|
/** Wraps an expression with COALESCE — returns `defaultValue` when the expression is NULL. */
|
|
11
19
|
export function coalesce(expression, defaultValue) {
|
|
12
20
|
return sql `coalesce(${expression}, ${defaultValue})`;
|
|
@@ -19,4 +27,63 @@ export function now() {
|
|
|
19
27
|
export function scalar(subquery) {
|
|
20
28
|
return sql `(${subquery})`;
|
|
21
29
|
}
|
|
30
|
+
/** PostgreSQL type cast: `expression::pgType`. */
|
|
31
|
+
export function cast(expression, pgType) {
|
|
32
|
+
return sql `(${expression})::${sql.raw(pgType)}`;
|
|
33
|
+
}
|
|
34
|
+
/** PostgreSQL interval literal: `interval '5 minutes'`. */
|
|
35
|
+
export function interval(amount, unit) {
|
|
36
|
+
return sql `interval '${sql.raw(String(amount))} ${sql.raw(unit)}'`;
|
|
37
|
+
}
|
|
38
|
+
/** PostgreSQL `date_trunc('unit', column)` — truncates a timestamp to the given precision. */
|
|
39
|
+
export function dateTrunc(unit, column) {
|
|
40
|
+
return sql `date_trunc('${sql.raw(unit)}', ${column})`;
|
|
41
|
+
}
|
|
42
|
+
/** PostgreSQL `ROW_NUMBER()` window function. Use with `over()` to apply a window specification. */
|
|
43
|
+
export function rowNumber() {
|
|
44
|
+
return sql `row_number()`;
|
|
45
|
+
}
|
|
46
|
+
/** PostgreSQL `RANK()` window function. Use with `over()` to apply a window specification. */
|
|
47
|
+
export function rank() {
|
|
48
|
+
return sql `rank()`;
|
|
49
|
+
}
|
|
50
|
+
/** PostgreSQL `DENSE_RANK()` window function. Use with `over()` to apply a window specification. */
|
|
51
|
+
export function denseRank() {
|
|
52
|
+
return sql `dense_rank()`;
|
|
53
|
+
}
|
|
54
|
+
/** Applies a window specification to a window function or aggregate: `fn OVER (PARTITION BY ... ORDER BY ...)`. */
|
|
55
|
+
export function over(fn, spec) {
|
|
56
|
+
const parts = [];
|
|
57
|
+
if (spec.partitionBy !== undefined) {
|
|
58
|
+
const cols = Array.isArray(spec.partitionBy) ? spec.partitionBy : [spec.partitionBy];
|
|
59
|
+
parts.push(sql `partition by ${sql.join(cols.map(c => sql `${c}`), sql `, `)}`);
|
|
60
|
+
}
|
|
61
|
+
if (spec.orderBy !== undefined) {
|
|
62
|
+
const cols = Array.isArray(spec.orderBy) ? spec.orderBy : [spec.orderBy];
|
|
63
|
+
parts.push(sql `order by ${sql.join(cols, sql `, `)}`);
|
|
64
|
+
}
|
|
65
|
+
if (parts.length === 0)
|
|
66
|
+
return sql `${fn} over ()`;
|
|
67
|
+
return sql `${fn} over (${sql.join(parts, sql ` `)})`;
|
|
68
|
+
}
|
|
69
|
+
/** PostgreSQL quoted identifier: `"name"`. Promotes `sql.identifier` to a base primitive. */
|
|
70
|
+
export function identifier(name) {
|
|
71
|
+
return sql `${sql.identifier(name)}`;
|
|
72
|
+
}
|
|
73
|
+
/** PostgreSQL `WITH RECURSIVE alias AS (seed UNION ALL step) finalQuery`. If `finalQuery` is omitted, defaults to `SELECT * FROM alias`. */
|
|
74
|
+
export function withRecursive(alias, seed, step, finalQuery) {
|
|
75
|
+
const cte = sql `WITH RECURSIVE ${sql.identifier(alias)} AS (${seed} UNION ALL ${step})`;
|
|
76
|
+
if (finalQuery !== undefined) {
|
|
77
|
+
return sql `${cte} ${finalQuery}`;
|
|
78
|
+
}
|
|
79
|
+
return sql `${cte} SELECT * FROM ${sql.identifier(alias)}`;
|
|
80
|
+
}
|
|
81
|
+
/** PostgreSQL `pg_current_wal_lsn()` — returns the current WAL write position on the primary. Internal primitive for replica-aware job execution. */
|
|
82
|
+
export function walCurrentLsn() {
|
|
83
|
+
return sql `pg_current_wal_lsn()::text`;
|
|
84
|
+
}
|
|
85
|
+
/** PostgreSQL `pg_last_wal_replay_lsn()` — returns the last replayed WAL position on a replica. Returns NULL on the primary. Internal primitive for replica-aware job execution. */
|
|
86
|
+
export function walReplayLsn() {
|
|
87
|
+
return sql `pg_last_wal_replay_lsn()::text`;
|
|
88
|
+
}
|
|
22
89
|
//# sourceMappingURL=expressions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressions.js","sourceRoot":"","sources":["../../../src/data/db/expressions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,uEAAuE;AACvE,MAAM,UAAU,SAAS,CAAC,MAAoB,EAAE,MAAc;IAC5D,OAAO,GAAG,CAAQ,GAAG,MAAM,MAAM,MAAM,EAAE,CAAA;AAC3C,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,SAAS,CAAC,MAAoB,EAAE,MAAc;IAC5D,OAAO,GAAG,CAAQ,GAAG,MAAM,MAAM,MAAM,EAAE,CAAA;AAC3C,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,QAAQ,CAAI,UAAwB,EAAE,YAAe;IACnE,OAAO,GAAG,CAAG,YAAY,UAAU,KAAK,YAAY,GAAG,CAAA;AACzD,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,GAAG;IACjB,OAAO,GAAG,CAAM,OAAO,CAAA;AACzB,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,MAAM,CAAI,QAAoB;IAC5C,OAAO,GAAG,CAAG,IAAI,QAAQ,GAAG,CAAA;AAC9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"expressions.js","sourceRoot":"","sources":["../../../src/data/db/expressions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAA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;QACxE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAA,YAAY,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAA,IAAI,CAAC,EAAE,CAAC,CAAA;IACtD,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAG,GAAG,EAAE,UAAU,CAAA;IACpD,OAAO,GAAG,CAAG,GAAG,EAAE,UAAU,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAA,GAAG,CAAC,GAAG,CAAA;AACxD,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,GAAG,CAAA,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAA;AACrC,CAAC;AAED,4IAA4I;AAC5I,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,IAAS,EAAE,IAAS,EAAE,UAAgB;IACjF,MAAM,GAAG,GAAG,GAAG,CAAA,kBAAkB,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,IAAI,cAAc,IAAI,GAAG,CAAA;IACvF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAA,GAAG,GAAG,IAAI,UAAU,EAAE,CAAA;IAClC,CAAC;IACD,OAAO,GAAG,CAAA,GAAG,GAAG,kBAAkB,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAA;AAC3D,CAAC;AAED,qJAAqJ;AACrJ,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,CAAQ,4BAA4B,CAAA;AAChD,CAAC;AAED,oLAAoL;AACpL,MAAM,UAAU,YAAY;IAC1B,OAAO,GAAG,CAAQ,gCAAgC,CAAA;AACpD,CAAC"}
|
package/dist/data/db/filter.d.ts
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import * as operators from './generated/drizzle-orm/operator.js';
|
|
2
2
|
import * as aggregates from './generated/drizzle-orm/aggregate.js';
|
|
3
|
-
import { increment, decrement, coalesce, now, scalar } from './expressions.js';
|
|
3
|
+
import { increment, decrement, add, subtract, coalesce, now, scalar, cast, interval, dateTrunc, rowNumber, rank, denseRank, over, identifier, withRecursive } from './expressions.js';
|
|
4
|
+
import { ago, castUuid, castJsonb, castTimestamp, castBoolean, castNumeric, castInteger, castText, nextSequence } from './composed.js';
|
|
4
5
|
export declare const filter: {
|
|
5
6
|
readonly increment: typeof increment;
|
|
6
7
|
readonly decrement: typeof decrement;
|
|
8
|
+
readonly add: typeof add;
|
|
9
|
+
readonly subtract: typeof subtract;
|
|
7
10
|
readonly coalesce: typeof coalesce;
|
|
8
11
|
readonly now: typeof now;
|
|
9
12
|
readonly scalar: typeof scalar;
|
|
13
|
+
readonly cast: typeof cast;
|
|
14
|
+
readonly interval: typeof interval;
|
|
15
|
+
readonly dateTrunc: typeof dateTrunc;
|
|
16
|
+
readonly rowNumber: typeof rowNumber;
|
|
17
|
+
readonly rank: typeof rank;
|
|
18
|
+
readonly denseRank: typeof denseRank;
|
|
19
|
+
readonly over: typeof over;
|
|
20
|
+
readonly identifier: typeof identifier;
|
|
21
|
+
readonly withRecursive: typeof withRecursive;
|
|
22
|
+
readonly ago: typeof ago;
|
|
23
|
+
readonly castUuid: typeof castUuid;
|
|
24
|
+
readonly castJsonb: typeof castJsonb;
|
|
25
|
+
readonly castTimestamp: typeof castTimestamp;
|
|
26
|
+
readonly castBoolean: typeof castBoolean;
|
|
27
|
+
readonly castNumeric: typeof castNumeric;
|
|
28
|
+
readonly castInteger: typeof castInteger;
|
|
29
|
+
readonly castText: typeof castText;
|
|
30
|
+
readonly nextSequence: typeof nextSequence;
|
|
10
31
|
readonly except: import("./generated/pg-core/type.js").PgCreateSetOperatorFn;
|
|
11
32
|
readonly exceptAll: import("./generated/pg-core/type.js").PgCreateSetOperatorFn;
|
|
12
33
|
readonly intersect: import("./generated/pg-core/type.js").PgCreateSetOperatorFn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/data/db/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAA;AAElE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/data/db/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAA;AAElE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrL,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtI,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BT,CAAA"}
|