@rudderjs/database 1.1.0 → 1.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/README.md +70 -0
- package/dist/db.d.ts +21 -3
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +27 -5
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/dist/native/adapter.d.ts +202 -0
- package/dist/native/adapter.d.ts.map +1 -0
- package/dist/native/adapter.js +440 -0
- package/dist/native/adapter.js.map +1 -0
- package/dist/native/compiler.d.ts +371 -0
- package/dist/native/compiler.d.ts.map +1 -0
- package/dist/native/compiler.js +978 -0
- package/dist/native/compiler.js.map +1 -0
- package/dist/native/dialect-mysql.d.ts +26 -0
- package/dist/native/dialect-mysql.d.ts.map +1 -0
- package/dist/native/dialect-mysql.js +188 -0
- package/dist/native/dialect-mysql.js.map +1 -0
- package/dist/native/dialect-pg.d.ts +26 -0
- package/dist/native/dialect-pg.d.ts.map +1 -0
- package/dist/native/dialect-pg.js +192 -0
- package/dist/native/dialect-pg.js.map +1 -0
- package/dist/native/dialect.d.ts +255 -0
- package/dist/native/dialect.d.ts.map +1 -0
- package/dist/native/dialect.js +237 -0
- package/dist/native/dialect.js.map +1 -0
- package/dist/native/driver.d.ts +37 -0
- package/dist/native/driver.d.ts.map +1 -0
- package/dist/native/driver.js +19 -0
- package/dist/native/driver.js.map +1 -0
- package/dist/native/drivers/better-sqlite3.d.ts +56 -0
- package/dist/native/drivers/better-sqlite3.d.ts.map +1 -0
- package/dist/native/drivers/better-sqlite3.js +171 -0
- package/dist/native/drivers/better-sqlite3.js.map +1 -0
- package/dist/native/drivers/mysql.d.ts +30 -0
- package/dist/native/drivers/mysql.d.ts.map +1 -0
- package/dist/native/drivers/mysql.js +176 -0
- package/dist/native/drivers/mysql.js.map +1 -0
- package/dist/native/drivers/postgres.d.ts +57 -0
- package/dist/native/drivers/postgres.d.ts.map +1 -0
- package/dist/native/drivers/postgres.js +155 -0
- package/dist/native/drivers/postgres.js.map +1 -0
- package/dist/native/errors.d.ts +43 -0
- package/dist/native/errors.d.ts.map +1 -0
- package/dist/native/errors.js +64 -0
- package/dist/native/errors.js.map +1 -0
- package/dist/native/index.d.ts +27 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native/index.js +55 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/isolation.d.ts +14 -0
- package/dist/native/isolation.d.ts.map +1 -0
- package/dist/native/isolation.js +37 -0
- package/dist/native/isolation.js.map +1 -0
- package/dist/native/query-builder.d.ts +303 -0
- package/dist/native/query-builder.d.ts.map +1 -0
- package/dist/native/query-builder.js +984 -0
- package/dist/native/query-builder.js.map +1 -0
- package/dist/native/replica-picker.d.ts +22 -0
- package/dist/native/replica-picker.d.ts.map +1 -0
- package/dist/native/replica-picker.js +65 -0
- package/dist/native/replica-picker.js.map +1 -0
- package/dist/native/schema/alter-blueprint.d.ts +37 -0
- package/dist/native/schema/alter-blueprint.d.ts.map +1 -0
- package/dist/native/schema/alter-blueprint.js +56 -0
- package/dist/native/schema/alter-blueprint.js.map +1 -0
- package/dist/native/schema/blueprint.d.ts +151 -0
- package/dist/native/schema/blueprint.d.ts.map +1 -0
- package/dist/native/schema/blueprint.js +286 -0
- package/dist/native/schema/blueprint.js.map +1 -0
- package/dist/native/schema/column.d.ts +168 -0
- package/dist/native/schema/column.d.ts.map +1 -0
- package/dist/native/schema/column.js +190 -0
- package/dist/native/schema/column.js.map +1 -0
- package/dist/native/schema/ddl-compiler.d.ts +34 -0
- package/dist/native/schema/ddl-compiler.d.ts.map +1 -0
- package/dist/native/schema/ddl-compiler.js +352 -0
- package/dist/native/schema/ddl-compiler.js.map +1 -0
- package/dist/native/schema/inspect.d.ts +67 -0
- package/dist/native/schema/inspect.d.ts.map +1 -0
- package/dist/native/schema/inspect.js +312 -0
- package/dist/native/schema/inspect.js.map +1 -0
- package/dist/native/schema/introspect.d.ts +34 -0
- package/dist/native/schema/introspect.d.ts.map +1 -0
- package/dist/native/schema/introspect.js +101 -0
- package/dist/native/schema/introspect.js.map +1 -0
- package/dist/native/schema/migration.d.ts +8 -0
- package/dist/native/schema/migration.d.ts.map +1 -0
- package/dist/native/schema/migration.js +19 -0
- package/dist/native/schema/migration.js.map +1 -0
- package/dist/native/schema/migrator.d.ts +144 -0
- package/dist/native/schema/migrator.d.ts.map +1 -0
- package/dist/native/schema/migrator.js +239 -0
- package/dist/native/schema/migrator.js.map +1 -0
- package/dist/native/schema/rebuild.d.ts +11 -0
- package/dist/native/schema/rebuild.d.ts.map +1 -0
- package/dist/native/schema/rebuild.js +92 -0
- package/dist/native/schema/rebuild.js.map +1 -0
- package/dist/native/schema/schema-builder.d.ts +46 -0
- package/dist/native/schema/schema-builder.d.ts.map +1 -0
- package/dist/native/schema/schema-builder.js +153 -0
- package/dist/native/schema/schema-builder.js.map +1 -0
- package/dist/native/schema/schema-facade.d.ts +63 -0
- package/dist/native/schema/schema-facade.d.ts.map +1 -0
- package/dist/native/schema/schema-facade.js +124 -0
- package/dist/native/schema/schema-facade.js.map +1 -0
- package/dist/native/schema/schema-types.d.ts +27 -0
- package/dist/native/schema/schema-types.d.ts.map +1 -0
- package/dist/native/schema/schema-types.js +52 -0
- package/dist/native/schema/schema-types.js.map +1 -0
- package/dist/native/schema/types-generator.d.ts +73 -0
- package/dist/native/schema/types-generator.d.ts.map +1 -0
- package/dist/native/schema/types-generator.js +181 -0
- package/dist/native/schema/types-generator.js.map +1 -0
- package/dist/registry-bridge.d.ts +24 -4
- package/dist/registry-bridge.d.ts.map +1 -1
- package/dist/registry-bridge.js +20 -0
- package/dist/registry-bridge.js.map +1 -1
- package/dist/sticky.d.ts +22 -0
- package/dist/sticky.d.ts.map +1 -0
- package/dist/sticky.js +61 -0
- package/dist/sticky.js.map +1 -0
- package/package.json +32 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Base class for every error raised by the native engine. Carries a stable
|
|
2
|
+
* `code` so apps can branch on `instanceof NativeOrmError` + `.code` instead
|
|
3
|
+
* of message matching. */
|
|
4
|
+
export declare class NativeOrmError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
constructor(code: string, message: string, options?: {
|
|
7
|
+
cause?: unknown;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Thrown by `NativeQueryBuilder` terminals that aren't implemented yet in the
|
|
12
|
+
* current phase. Phase 1 ships the **read** path only — every write, relation,
|
|
13
|
+
* aggregate, and vector terminal throws this until its phase lands.
|
|
14
|
+
*
|
|
15
|
+
* The message names the missing terminal and the phase that delivers it so the
|
|
16
|
+
* failure is self-explanatory rather than a generic "not a function".
|
|
17
|
+
*/
|
|
18
|
+
export declare class NativeNotImplementedError extends NativeOrmError {
|
|
19
|
+
/** The QueryBuilder method that isn't available yet. */
|
|
20
|
+
readonly method: string;
|
|
21
|
+
constructor(method: string, phase: string);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Thrown when an identifier (table or column name) supplied to the compiler
|
|
25
|
+
* fails validation. Because identifiers can't be parameterized, the native
|
|
26
|
+
* engine validates them against a strict allowlist before quoting — this is a
|
|
27
|
+
* security gate (cross-phase rule 3), not a style check.
|
|
28
|
+
*/
|
|
29
|
+
export declare class NativeIdentifierError extends NativeOrmError {
|
|
30
|
+
/** The rejected identifier. */
|
|
31
|
+
readonly identifier: string;
|
|
32
|
+
constructor(identifier: string);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Thrown when a driver package (e.g. `better-sqlite3`) can't be resolved at
|
|
36
|
+
* runtime. The drivers are optional peers — apps install only the one they use.
|
|
37
|
+
*/
|
|
38
|
+
export declare class NativeDriverError extends NativeOrmError {
|
|
39
|
+
constructor(message: string, options?: {
|
|
40
|
+
cause?: unknown;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/native/errors.ts"],"names":[],"mappings":"AAKA;;2BAE2B;AAC3B,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;gBAET,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAKzE;AAED;;;;;;;GAOG;AACH,qBAAa,yBAA0B,SAAQ,cAAc;IAC3D,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAEX,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAW1C;AAED;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,cAAc;IACvD,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,UAAU,EAAE,MAAM;CAW/B;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;gBACvC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Errors for the native ORM engine (`@rudderjs/orm/native`).
|
|
2
|
+
//
|
|
3
|
+
// Kept in their own module so both the pure compiler/query-builder and the
|
|
4
|
+
// node-only adapter/driver can throw them without pulling each other in.
|
|
5
|
+
/** Base class for every error raised by the native engine. Carries a stable
|
|
6
|
+
* `code` so apps can branch on `instanceof NativeOrmError` + `.code` instead
|
|
7
|
+
* of message matching. */
|
|
8
|
+
export class NativeOrmError extends Error {
|
|
9
|
+
code;
|
|
10
|
+
constructor(code, message, options) {
|
|
11
|
+
super(message, options);
|
|
12
|
+
this.name = 'NativeOrmError';
|
|
13
|
+
this.code = code;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Thrown by `NativeQueryBuilder` terminals that aren't implemented yet in the
|
|
18
|
+
* current phase. Phase 1 ships the **read** path only — every write, relation,
|
|
19
|
+
* aggregate, and vector terminal throws this until its phase lands.
|
|
20
|
+
*
|
|
21
|
+
* The message names the missing terminal and the phase that delivers it so the
|
|
22
|
+
* failure is self-explanatory rather than a generic "not a function".
|
|
23
|
+
*/
|
|
24
|
+
export class NativeNotImplementedError extends NativeOrmError {
|
|
25
|
+
/** The QueryBuilder method that isn't available yet. */
|
|
26
|
+
method;
|
|
27
|
+
constructor(method, phase) {
|
|
28
|
+
super('NATIVE_NOT_IMPLEMENTED', `[RudderJS ORM native] "${method}" is not implemented yet — it lands in ${phase}. ` +
|
|
29
|
+
`Phase 1 of the native engine ships the read path only ` +
|
|
30
|
+
`(first/find/get/all/count/paginate). Use @rudderjs/orm-prisma or ` +
|
|
31
|
+
`@rudderjs/orm-drizzle for the full surface until then.`);
|
|
32
|
+
this.name = 'NativeNotImplementedError';
|
|
33
|
+
this.method = method;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Thrown when an identifier (table or column name) supplied to the compiler
|
|
38
|
+
* fails validation. Because identifiers can't be parameterized, the native
|
|
39
|
+
* engine validates them against a strict allowlist before quoting — this is a
|
|
40
|
+
* security gate (cross-phase rule 3), not a style check.
|
|
41
|
+
*/
|
|
42
|
+
export class NativeIdentifierError extends NativeOrmError {
|
|
43
|
+
/** The rejected identifier. */
|
|
44
|
+
identifier;
|
|
45
|
+
constructor(identifier) {
|
|
46
|
+
super('NATIVE_INVALID_IDENTIFIER', `[RudderJS ORM native] Invalid SQL identifier ${JSON.stringify(identifier)}. ` +
|
|
47
|
+
`Identifiers may contain only letters, digits, underscores, and dots, and ` +
|
|
48
|
+
`must not start with a digit. Values are always bound as parameters; only ` +
|
|
49
|
+
`column/table names flow through this check.`);
|
|
50
|
+
this.name = 'NativeIdentifierError';
|
|
51
|
+
this.identifier = identifier;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Thrown when a driver package (e.g. `better-sqlite3`) can't be resolved at
|
|
56
|
+
* runtime. The drivers are optional peers — apps install only the one they use.
|
|
57
|
+
*/
|
|
58
|
+
export class NativeDriverError extends NativeOrmError {
|
|
59
|
+
constructor(message, options) {
|
|
60
|
+
super('NATIVE_DRIVER_ERROR', message, options);
|
|
61
|
+
this.name = 'NativeDriverError';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/native/errors.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AAEzE;;2BAE2B;AAC3B,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,IAAI,CAAQ;IAErB,YAAY,IAAY,EAAE,OAAe,EAAE,OAA6B;QACtE,KAAK,CAAC,OAAO,EAAE,OAAmC,CAAC,CAAA;QACnD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAC3D,wDAAwD;IAC/C,MAAM,CAAQ;IAEvB,YAAY,MAAc,EAAE,KAAa;QACvC,KAAK,CACH,wBAAwB,EACxB,0BAA0B,MAAM,0CAA0C,KAAK,IAAI;YACnF,wDAAwD;YACxD,mEAAmE;YACnE,wDAAwD,CACzD,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,cAAc;IACvD,+BAA+B;IACtB,UAAU,CAAQ;IAE3B,YAAY,UAAkB;QAC5B,KAAK,CACH,2BAA2B,EAC3B,gDAAgD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI;YAC9E,2EAA2E;YAC3E,2EAA2E;YAC3E,6CAA6C,CAC9C,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACnD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;QAC9C,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './errors.js';
|
|
2
|
+
export * from './driver.js';
|
|
3
|
+
export * from './isolation.js';
|
|
4
|
+
export * from './dialect.js';
|
|
5
|
+
export * from './dialect-pg.js';
|
|
6
|
+
export * from './dialect-mysql.js';
|
|
7
|
+
export * from './compiler.js';
|
|
8
|
+
export * from './query-builder.js';
|
|
9
|
+
export * from './adapter.js';
|
|
10
|
+
export * from './replica-picker.js';
|
|
11
|
+
export * from './drivers/better-sqlite3.js';
|
|
12
|
+
export * from './drivers/postgres.js';
|
|
13
|
+
export * from './drivers/mysql.js';
|
|
14
|
+
export * from './schema/column.js';
|
|
15
|
+
export * from './schema/blueprint.js';
|
|
16
|
+
export * from './schema/alter-blueprint.js';
|
|
17
|
+
export * from './schema/ddl-compiler.js';
|
|
18
|
+
export * from './schema/schema-builder.js';
|
|
19
|
+
export * from './schema/rebuild.js';
|
|
20
|
+
export * from './schema/introspect.js';
|
|
21
|
+
export * from './schema/inspect.js';
|
|
22
|
+
export * from './schema/types-generator.js';
|
|
23
|
+
export * from './schema/schema-types.js';
|
|
24
|
+
export * from './schema/migration.js';
|
|
25
|
+
export * from './schema/schema-facade.js';
|
|
26
|
+
export * from './schema/migrator.js';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AA4BA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAGlC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// ─── @rudderjs/database/native ─────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// The native SQL engine — fully relocated from `@rudderjs/orm/native` by the
|
|
4
|
+
// Phase-2 extraction (docs/plans/2026-06-04-database-extraction-phase-2.md):
|
|
5
|
+
// compiler, dialects, driver seam, concrete drivers, `NativeQueryBuilder`,
|
|
6
|
+
// `NativeAdapter`, and the schema builder + migrator + type generator.
|
|
7
|
+
// `@rudderjs/orm/native` re-exports this barrel verbatim (back-compat shim),
|
|
8
|
+
// so every historical import keeps working; this subpath is the canonical
|
|
9
|
+
// home, and the headline API (`Migration`, `Schema`, `NativeAdapter`, the
|
|
10
|
+
// drivers) is also re-exported from the `@rudderjs/database` main entry.
|
|
11
|
+
//
|
|
12
|
+
// Node-only: the concrete drivers lazy-load `better-sqlite3` / `postgres` /
|
|
13
|
+
// `mysql2` (optional peers). Never import this from a client-bundle-reachable
|
|
14
|
+
// entry.
|
|
15
|
+
//
|
|
16
|
+
// NOTE: the framework provider (`NativeDatabaseProvider` / `nativeDatabase`)
|
|
17
|
+
// deliberately lives in `@rudderjs/orm` (`@rudderjs/orm/native/provider`) — it
|
|
18
|
+
// wires `ModelRegistry` / `ConnectionManager` / the DB-facade bridge, all
|
|
19
|
+
// orm-side state, and `@rudderjs/database` must never depend on `@rudderjs/orm`.
|
|
20
|
+
//
|
|
21
|
+
// Surface note: full star-exports per module. Engine seams consumed across the
|
|
22
|
+
// orm↔database boundary (the Model layer's engine suites, `quoteSqlString`,
|
|
23
|
+
// `makeBindings`, …) must NOT carry the JSDoc internal tag — `stripInternal`
|
|
24
|
+
// drops tagged declarations from the emitted d.ts and breaks the cross-package
|
|
25
|
+
// import. (tsc scans leading comments for the literal tag text, so even
|
|
26
|
+
// *mentioning* it spelled out here would strip the statement below.)
|
|
27
|
+
// Engine core.
|
|
28
|
+
export * from './errors.js';
|
|
29
|
+
export * from './driver.js';
|
|
30
|
+
export * from './isolation.js';
|
|
31
|
+
export * from './dialect.js';
|
|
32
|
+
export * from './dialect-pg.js';
|
|
33
|
+
export * from './dialect-mysql.js';
|
|
34
|
+
export * from './compiler.js';
|
|
35
|
+
export * from './query-builder.js';
|
|
36
|
+
export * from './adapter.js';
|
|
37
|
+
export * from './replica-picker.js';
|
|
38
|
+
export * from './drivers/better-sqlite3.js';
|
|
39
|
+
export * from './drivers/postgres.js';
|
|
40
|
+
export * from './drivers/mysql.js';
|
|
41
|
+
// Schema builder (DDL), migration runner, and the schema → TS type generator.
|
|
42
|
+
export * from './schema/column.js';
|
|
43
|
+
export * from './schema/blueprint.js';
|
|
44
|
+
export * from './schema/alter-blueprint.js';
|
|
45
|
+
export * from './schema/ddl-compiler.js';
|
|
46
|
+
export * from './schema/schema-builder.js';
|
|
47
|
+
export * from './schema/rebuild.js';
|
|
48
|
+
export * from './schema/introspect.js';
|
|
49
|
+
export * from './schema/inspect.js';
|
|
50
|
+
export * from './schema/types-generator.js';
|
|
51
|
+
export * from './schema/schema-types.js';
|
|
52
|
+
export * from './schema/migration.js';
|
|
53
|
+
export * from './schema/schema-facade.js';
|
|
54
|
+
export * from './schema/migrator.js';
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,uEAAuE;AACvE,6EAA6E;AAC7E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,SAAS;AACT,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,iFAAiF;AACjF,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,wEAAwE;AACxE,qEAAqE;AAErE,eAAe;AACf,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAElC,8EAA8E;AAC9E,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TransactionIsolationLevel } from '@rudderjs/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* The SQL keyword form of an isolation level (`'repeatable read'` →
|
|
4
|
+
* `'REPEATABLE READ'`). Throws on any value outside the
|
|
5
|
+
* {@link TransactionIsolationLevel} union — the result is spliced into a
|
|
6
|
+
* `SET TRANSACTION ISOLATION LEVEL` statement, never bound, so this lookup is
|
|
7
|
+
* the injection boundary.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isolationLevelSql(level: TransactionIsolationLevel): string;
|
|
10
|
+
/** The error thrown when a nested transaction (SAVEPOINT) is asked to change
|
|
11
|
+
* isolation level — a savepoint runs inside the enclosing transaction, whose
|
|
12
|
+
* isolation is already fixed. */
|
|
13
|
+
export declare function nestedIsolationError(): Error;
|
|
14
|
+
//# sourceMappingURL=isolation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isolation.d.ts","sourceRoot":"","sources":["../../src/native/isolation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AASpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAS1E;AAED;;kCAEkC;AAClC,wBAAgB,oBAAoB,IAAI,KAAK,CAM5C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// ─── Transaction isolation levels ──────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Shared by the Postgres + MySQL drivers: maps the lowercase ANSI level names
|
|
4
|
+
// from `@rudderjs/contracts` (`TransactionIsolationLevel`) to the SQL keywords
|
|
5
|
+
// for `SET TRANSACTION ISOLATION LEVEL …`. The map doubles as a validation
|
|
6
|
+
// gate — the level is spliced into SQL text (it can't be bound), so an unknown
|
|
7
|
+
// string MUST throw rather than reach the statement. Pure: no `node:` import.
|
|
8
|
+
const ISOLATION_SQL = {
|
|
9
|
+
'read uncommitted': 'READ UNCOMMITTED',
|
|
10
|
+
'read committed': 'READ COMMITTED',
|
|
11
|
+
'repeatable read': 'REPEATABLE READ',
|
|
12
|
+
'serializable': 'SERIALIZABLE',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The SQL keyword form of an isolation level (`'repeatable read'` →
|
|
16
|
+
* `'REPEATABLE READ'`). Throws on any value outside the
|
|
17
|
+
* {@link TransactionIsolationLevel} union — the result is spliced into a
|
|
18
|
+
* `SET TRANSACTION ISOLATION LEVEL` statement, never bound, so this lookup is
|
|
19
|
+
* the injection boundary.
|
|
20
|
+
*/
|
|
21
|
+
export function isolationLevelSql(level) {
|
|
22
|
+
const sql = ISOLATION_SQL[level];
|
|
23
|
+
if (!sql) {
|
|
24
|
+
throw new Error(`[RudderJS ORM native] Unknown transaction isolation level ${JSON.stringify(level)} — ` +
|
|
25
|
+
`expected 'read uncommitted', 'read committed', 'repeatable read', or 'serializable'.`);
|
|
26
|
+
}
|
|
27
|
+
return sql;
|
|
28
|
+
}
|
|
29
|
+
/** The error thrown when a nested transaction (SAVEPOINT) is asked to change
|
|
30
|
+
* isolation level — a savepoint runs inside the enclosing transaction, whose
|
|
31
|
+
* isolation is already fixed. */
|
|
32
|
+
export function nestedIsolationError() {
|
|
33
|
+
return new Error('[RudderJS ORM native] isolationLevel cannot be set on a nested transaction — ' +
|
|
34
|
+
'a nested call maps to a SAVEPOINT inside the open transaction, whose isolation ' +
|
|
35
|
+
'level is already fixed. Set it on the outermost transaction() call.');
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=isolation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isolation.js","sourceRoot":"","sources":["../../src/native/isolation.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,+EAA+E;AAC/E,8EAA8E;AAI9E,MAAM,aAAa,GAA8C;IAC/D,kBAAkB,EAAE,kBAAkB;IACtC,gBAAgB,EAAI,gBAAgB;IACpC,iBAAiB,EAAG,iBAAiB;IACrC,cAAc,EAAM,cAAc;CACnC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAgC;IAChE,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,6DAA6D,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK;YACvF,sFAAsF,CACvF,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;kCAEkC;AAClC,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,KAAK,CACd,+EAA+E;QAC/E,iFAAiF;QACjF,qEAAqE,CACtE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import type { QueryBuilder, WhereOperator, PaginatedResult, RelationExistencePredicate, AggregateRequest, AggregateFn, JoinClause, LockOptions } from '@rudderjs/contracts';
|
|
2
|
+
import { Expression } from '@rudderjs/contracts';
|
|
3
|
+
import { type Dialect } from './dialect.js';
|
|
4
|
+
import type { Executor } from './driver.js';
|
|
5
|
+
import { type JoinCondition, type WindowFunction } from './compiler.js';
|
|
6
|
+
/** One ORDER BY entry for `selectWindow` — a bare column (asc) or an explicit
|
|
7
|
+
* `{ column, direction }` object. Deliberately NOT a `[col, dir]` tuple: a
|
|
8
|
+
* flat two-string array is ambiguous with "two columns". */
|
|
9
|
+
export type WindowOrderInput = string | {
|
|
10
|
+
column: string;
|
|
11
|
+
direction?: 'asc' | 'desc';
|
|
12
|
+
};
|
|
13
|
+
export declare class NativeQueryBuilder<T> implements QueryBuilder<T> {
|
|
14
|
+
private readonly executor;
|
|
15
|
+
private readonly dialect;
|
|
16
|
+
private readonly table;
|
|
17
|
+
private readonly primaryKey;
|
|
18
|
+
/** Read-pool picker on a read/write-split connection (round-robin +
|
|
19
|
+
* sticky-aware, supplied by the adapter); `null` without a split. */
|
|
20
|
+
private readonly readPick;
|
|
21
|
+
/** Capability marker read by the Model layer's hydrating proxy — arrow-path
|
|
22
|
+
* update keys (`'meta->prefs->lang'`) throw a clear Model-layer error on
|
|
23
|
+
* adapter QBs without it (Drizzle/Prisma until their follow-up). */
|
|
24
|
+
readonly supportsJsonPathUpdates = true;
|
|
25
|
+
/** Capability marker read by the Model layer — nested relation paths
|
|
26
|
+
* (`whereHas('posts.comments')`) build a predicate chain (`nested` child
|
|
27
|
+
* predicates) that only adapters with this marker can compile; others get
|
|
28
|
+
* a clear Model-layer throw instead of a silently-ignored field. */
|
|
29
|
+
readonly supportsNestedRelationPredicates = true;
|
|
30
|
+
private readonly _conditions;
|
|
31
|
+
private readonly _orders;
|
|
32
|
+
private readonly _selects;
|
|
33
|
+
private readonly _joins;
|
|
34
|
+
private readonly _groupBy;
|
|
35
|
+
private readonly _having;
|
|
36
|
+
private readonly _unions;
|
|
37
|
+
private readonly _ctes;
|
|
38
|
+
private readonly _rawSelects;
|
|
39
|
+
private readonly _windows;
|
|
40
|
+
private readonly _relationExists;
|
|
41
|
+
private readonly _aggregates;
|
|
42
|
+
private _distinct;
|
|
43
|
+
private _limitN;
|
|
44
|
+
private _offsetN;
|
|
45
|
+
private _softDeletes;
|
|
46
|
+
private _withTrashed;
|
|
47
|
+
private _onlyTrashed;
|
|
48
|
+
private _lock;
|
|
49
|
+
/** Wait behavior for `_lock` (`skipLocked` / `noWait`) — validated mutually
|
|
50
|
+
* exclusive at the setter, threaded to `Dialect.lockSql` via the state. */
|
|
51
|
+
private _lockOpts;
|
|
52
|
+
/** Marks a sub-builder created for whereGroup — terminals throw on it. */
|
|
53
|
+
private _isSubBuilder;
|
|
54
|
+
constructor(executor: Executor, dialect: Dialect, table: string, primaryKey: string,
|
|
55
|
+
/** Read-pool picker on a read/write-split connection (round-robin +
|
|
56
|
+
* sticky-aware, supplied by the adapter); `null` without a split. */
|
|
57
|
+
readPick?: (() => Executor) | null);
|
|
58
|
+
/** The executor for a READ terminal: the read pool on a split connection,
|
|
59
|
+
* EXCEPT locked selects (`lockForUpdate`/`sharedLock`) — a lock is only
|
|
60
|
+
* meaningful on the write connection. Writes/`_reselect` never call this. */
|
|
61
|
+
private _readExecutor;
|
|
62
|
+
private _assertNotSubBuilder;
|
|
63
|
+
private _state;
|
|
64
|
+
private _resolveSoftDelete;
|
|
65
|
+
private _pushClause;
|
|
66
|
+
where(column: string, operatorOrValue: WhereOperator | unknown, value?: unknown): this;
|
|
67
|
+
orWhere(column: string, operatorOrValue: WhereOperator | unknown, value?: unknown): this;
|
|
68
|
+
whereColumn(left: string, operatorOrRight: WhereOperator | string, right?: string): this;
|
|
69
|
+
orWhereColumn(left: string, operatorOrRight: WhereOperator | string, right?: string): this;
|
|
70
|
+
private _pushColumn;
|
|
71
|
+
whereDate(column: string, operatorOrValue: WhereOperator | string | Date, value?: string | Date): this;
|
|
72
|
+
orWhereDate(column: string, operatorOrValue: WhereOperator | string | Date, value?: string | Date): this;
|
|
73
|
+
whereTime(column: string, operatorOrValue: WhereOperator | string | Date, value?: string | Date): this;
|
|
74
|
+
orWhereTime(column: string, operatorOrValue: WhereOperator | string | Date, value?: string | Date): this;
|
|
75
|
+
whereDay(column: string, operatorOrValue: WhereOperator | number | string | Date, value?: number | string | Date): this;
|
|
76
|
+
orWhereDay(column: string, operatorOrValue: WhereOperator | number | string | Date, value?: number | string | Date): this;
|
|
77
|
+
whereMonth(column: string, operatorOrValue: WhereOperator | number | string | Date, value?: number | string | Date): this;
|
|
78
|
+
orWhereMonth(column: string, operatorOrValue: WhereOperator | number | string | Date, value?: number | string | Date): this;
|
|
79
|
+
whereYear(column: string, operatorOrValue: WhereOperator | number | string | Date, value?: number | string | Date): this;
|
|
80
|
+
orWhereYear(column: string, operatorOrValue: WhereOperator | number | string | Date, value?: number | string | Date): this;
|
|
81
|
+
private _pushDatePart;
|
|
82
|
+
/** `whereJsonContains('meta->tags', 'php')` — JSON containment at an arrow
|
|
83
|
+
* path (or the whole column when no `->`). `value` may be a scalar or an
|
|
84
|
+
* array (every element contained). pg `@>`, mysql `JSON_CONTAINS`, sqlite
|
|
85
|
+
* emulated via `json_each` EXISTS (scalars only there). */
|
|
86
|
+
whereJsonContains(column: string, value: unknown): this;
|
|
87
|
+
/** OR-rooted {@link whereJsonContains}. */
|
|
88
|
+
orWhereJsonContains(column: string, value: unknown): this;
|
|
89
|
+
/** Negated {@link whereJsonContains} — `NOT (…)` around the containment. */
|
|
90
|
+
whereJsonDoesntContain(column: string, value: unknown): this;
|
|
91
|
+
/** OR-rooted {@link whereJsonDoesntContain}. */
|
|
92
|
+
orWhereJsonDoesntContain(column: string, value: unknown): this;
|
|
93
|
+
/** `whereJsonLength('meta->tags', '>', 2)` — compare a JSON array's length.
|
|
94
|
+
* Two-arg form (`(column, n)`) is equality. sqlite/pg `json(b)_array_length`,
|
|
95
|
+
* mysql `JSON_LENGTH`. */
|
|
96
|
+
whereJsonLength(column: string, operatorOrValue: WhereOperator | number, value?: number): this;
|
|
97
|
+
/** OR-rooted {@link whereJsonLength}. */
|
|
98
|
+
orWhereJsonLength(column: string, operatorOrValue: WhereOperator | number, value?: number): this;
|
|
99
|
+
private _pushJsonContains;
|
|
100
|
+
private _pushJsonLength;
|
|
101
|
+
/** Column-or-arrow-path → `{ column, segments }` ( `[]` segments = whole column). */
|
|
102
|
+
private _jsonTarget;
|
|
103
|
+
whereGroup(fn: (q: QueryBuilder<T>) => QueryBuilder<T> | void): this;
|
|
104
|
+
orWhereGroup(fn: (q: QueryBuilder<T>) => QueryBuilder<T> | void): this;
|
|
105
|
+
/** Negated group — `NOT (…)` around the callback's conditions (Laravel's
|
|
106
|
+
* `whereNot`). An empty callback is a no-op, same as `whereGroup`. */
|
|
107
|
+
whereNot(fn: (q: QueryBuilder<T>) => QueryBuilder<T> | void): this;
|
|
108
|
+
/** OR-rooted {@link whereNot} — `… OR NOT (…)`. */
|
|
109
|
+
orWhereNot(fn: (q: QueryBuilder<T>) => QueryBuilder<T> | void): this;
|
|
110
|
+
private _addGroup;
|
|
111
|
+
orderBy(column: string | Expression, direction?: 'ASC' | 'DESC'): this;
|
|
112
|
+
selectRaw(sql: string, bindings?: readonly unknown[]): this;
|
|
113
|
+
/**
|
|
114
|
+
* Add a typed window-function projection:
|
|
115
|
+
* `selectWindow('rowNumber', { as: 'rn', partitionBy: 'userId', orderBy: { column: 'createdAt', direction: 'desc' } })`
|
|
116
|
+
* → `ROW_NUMBER() OVER (PARTITION BY "userId" ORDER BY "createdAt" DESC) AS "rn"`.
|
|
117
|
+
*
|
|
118
|
+
* ADDITIVE — appends to the projection (`SELECT *, … AS "rn"` by default), so
|
|
119
|
+
* rows still hydrate as full models with the alias as an extra attribute;
|
|
120
|
+
* `selectRaw`'s REPLACE semantics don't apply. Functions: `rowNumber` /
|
|
121
|
+
* `rank` / `denseRank` / `percentRank` / `cumeDist` (zero-arg ranking set —
|
|
122
|
+
* identical syntax on SQLite ≥3.25 / Postgres / MySQL 8). For aggregates
|
|
123
|
+
* OVER, lag/lead, or frame clauses, use `selectRaw`. SQL forbids window
|
|
124
|
+
* results in WHERE — filter via a CTE/subquery instead.
|
|
125
|
+
*/
|
|
126
|
+
selectWindow(fn: WindowFunction, opts: {
|
|
127
|
+
as: string;
|
|
128
|
+
partitionBy?: string | readonly string[];
|
|
129
|
+
orderBy?: WindowOrderInput | readonly WindowOrderInput[];
|
|
130
|
+
}): this;
|
|
131
|
+
whereRaw(sql: string, bindings?: readonly unknown[]): this;
|
|
132
|
+
orWhereRaw(sql: string, bindings?: readonly unknown[]): this;
|
|
133
|
+
orderByRaw(sql: string, bindings?: readonly unknown[]): this;
|
|
134
|
+
/** Structured projection — `select('users.id', 'posts.title')`. Each column is
|
|
135
|
+
* identifier-quoted (qualified `table.col` supported) and REPLACES the default
|
|
136
|
+
* `*`. Accumulates with `selectRaw` (structured first, then raw). */
|
|
137
|
+
select(...columns: string[]): this;
|
|
138
|
+
/** `SELECT DISTINCT` — de-duplicate the projected rows. */
|
|
139
|
+
distinct(): this;
|
|
140
|
+
/** `INNER JOIN`. Simple form `join('posts', 'posts.userId', '=', 'users.id')`
|
|
141
|
+
* (the operator is optional and defaults to `=`); callback form
|
|
142
|
+
* `join('posts', (j) => j.on(...).where(...))` for compound ON clauses. */
|
|
143
|
+
join(table: string, first: string | ((join: JoinClause) => void), operator?: WhereOperator, second?: string): this;
|
|
144
|
+
/** `LEFT JOIN` — same call forms as {@link join}. */
|
|
145
|
+
leftJoin(table: string, first: string | ((join: JoinClause) => void), operator?: WhereOperator, second?: string): this;
|
|
146
|
+
/** `RIGHT JOIN` — same call forms as {@link join}. (SQLite 3.39+; native on pg/mysql.) */
|
|
147
|
+
rightJoin(table: string, first: string | ((join: JoinClause) => void), operator?: WhereOperator, second?: string): this;
|
|
148
|
+
/** `CROSS JOIN` — Cartesian product, no ON clause. */
|
|
149
|
+
crossJoin(table: string): this;
|
|
150
|
+
private _addJoin;
|
|
151
|
+
/** `GROUP BY col [, …]` — columns identifier-quoted (qualified `table.col` ok). */
|
|
152
|
+
groupBy(...columns: string[]): this;
|
|
153
|
+
/** `HAVING col <op> value` — filter on grouped rows / a SELECT alias. Two-arg
|
|
154
|
+
* form is equality; the value binds. For an aggregate use {@link havingRaw}. */
|
|
155
|
+
having(column: string, operatorOrValue: WhereOperator | unknown, value?: unknown): this;
|
|
156
|
+
/** OR-rooted {@link having}. */
|
|
157
|
+
orHaving(column: string, operatorOrValue: WhereOperator | unknown, value?: unknown): this;
|
|
158
|
+
/** `HAVING <raw>` — the portable way to filter on an aggregate, e.g.
|
|
159
|
+
* `havingRaw('COUNT(*) > ?', [3])`. `?` placeholders bind positionally. */
|
|
160
|
+
havingRaw(sql: string, bindings?: readonly unknown[]): this;
|
|
161
|
+
/** OR-rooted {@link havingRaw}. */
|
|
162
|
+
orHavingRaw(sql: string, bindings?: readonly unknown[]): this;
|
|
163
|
+
private _pushHaving;
|
|
164
|
+
/** `… UNION …` — append another query as a UNION member (duplicate rows
|
|
165
|
+
* removed). The combined result takes THIS query's ORDER BY / LIMIT / OFFSET;
|
|
166
|
+
* the member's own are ignored. `other` is another native query (`Model.query()`). */
|
|
167
|
+
union(other: QueryBuilder<T>): this;
|
|
168
|
+
/** `… UNION ALL …` — like {@link union} but keeps duplicate rows. */
|
|
169
|
+
unionAll(other: QueryBuilder<T>): this;
|
|
170
|
+
private _addUnion;
|
|
171
|
+
/**
|
|
172
|
+
* `WITH name AS (…)` — prepend a common table expression the main query can
|
|
173
|
+
* reference (typically via `join('name', …)` — the FROM stays the model's
|
|
174
|
+
* table). `query` is another native query (`Model.query()` chain) or a raw
|
|
175
|
+
* SQL string with `?` placeholders + `opts.bindings`. CTE bindings precede
|
|
176
|
+
* the main query's (SQL text order). Read-side only (`get`/`first`/`find`/
|
|
177
|
+
* `count`/`paginate`); a builder-backed body keeps its own UNION members but
|
|
178
|
+
* drops ORDER BY / LIMIT (same rule as `union()`).
|
|
179
|
+
*/
|
|
180
|
+
withExpression(name: string, query: QueryBuilder<unknown> | string, opts?: {
|
|
181
|
+
bindings?: readonly unknown[];
|
|
182
|
+
columns?: readonly string[];
|
|
183
|
+
}): this;
|
|
184
|
+
/**
|
|
185
|
+
* `WITH RECURSIVE name [(cols)] AS (…)` — like {@link withExpression} for a
|
|
186
|
+
* self-referencing body. Recursive bodies are usually a raw SQL string (the
|
|
187
|
+
* body references the CTE's own name, which a table-rooted builder can't
|
|
188
|
+
* express): `withRecursiveExpression('tree', 'SELECT … UNION ALL SELECT …
|
|
189
|
+
* FROM t JOIN tree …', { bindings: [rootId], columns: ['id'] })`.
|
|
190
|
+
*/
|
|
191
|
+
withRecursiveExpression(name: string, query: QueryBuilder<unknown> | string, opts?: {
|
|
192
|
+
bindings?: readonly unknown[];
|
|
193
|
+
columns?: readonly string[];
|
|
194
|
+
}): this;
|
|
195
|
+
private _addCte;
|
|
196
|
+
/**
|
|
197
|
+
* `WHERE EXISTS (…)` — an arbitrary EXISTS subquery. `query` is another
|
|
198
|
+
* native query (`Model.query()` chain — correlate to the outer table via
|
|
199
|
+
* qualified `whereColumn('orders.userId', 'users.id')` refs) or a raw SQL
|
|
200
|
+
* string with `?` placeholders + `bindings`. For relation-shaped existence
|
|
201
|
+
* checks prefer `whereHas` — this is the escape hatch for subqueries no
|
|
202
|
+
* declared relation describes.
|
|
203
|
+
*/
|
|
204
|
+
whereExists(query: QueryBuilder<unknown> | string, bindings?: readonly unknown[]): this;
|
|
205
|
+
/** `WHERE NOT EXISTS (…)` — negated {@link whereExists}. */
|
|
206
|
+
whereNotExists(query: QueryBuilder<unknown> | string, bindings?: readonly unknown[]): this;
|
|
207
|
+
/** OR-rooted {@link whereExists}. */
|
|
208
|
+
orWhereExists(query: QueryBuilder<unknown> | string, bindings?: readonly unknown[]): this;
|
|
209
|
+
/** OR-rooted {@link whereNotExists}. */
|
|
210
|
+
orWhereNotExists(query: QueryBuilder<unknown> | string, bindings?: readonly unknown[]): this;
|
|
211
|
+
private _addExists;
|
|
212
|
+
limit(n: number): this;
|
|
213
|
+
offset(n: number): this;
|
|
214
|
+
withTrashed(): this;
|
|
215
|
+
onlyTrashed(): this;
|
|
216
|
+
/** Pessimistic `FOR UPDATE` row lock (no-op on SQLite — see {@link Dialect.lockSql}).
|
|
217
|
+
* Only meaningful inside a `transaction()`; the powering primitive for the
|
|
218
|
+
* native database queue's atomic job reservation. `opts.skipLocked` skips
|
|
219
|
+
* already-locked rows (`SKIP LOCKED`), `opts.noWait` errors instead of
|
|
220
|
+
* blocking (`NOWAIT`) — mutually exclusive, both throw. */
|
|
221
|
+
lockForUpdate(opts?: LockOptions): this;
|
|
222
|
+
/** Shared `FOR SHARE` row lock (no-op on SQLite). Same options as
|
|
223
|
+
* {@link lockForUpdate}. */
|
|
224
|
+
sharedLock(opts?: LockOptions): this;
|
|
225
|
+
/** `skipLocked` skips conflicting rows; `noWait` errors on them — asking for
|
|
226
|
+
* both is a contradiction, so it throws here at the call site (every
|
|
227
|
+
* dialect), not at compile/execute time. */
|
|
228
|
+
private _validateLockOpts;
|
|
229
|
+
/**
|
|
230
|
+
* Coerce `withExists` aggregate aliases from SQLite's integer `1`/`0` to a JS
|
|
231
|
+
* boolean. SQLite has no boolean type, so the `(COUNT(*) > 0)` subselect comes
|
|
232
|
+
* back as a number — the Model contract (and the other adapters over Postgres,
|
|
233
|
+
* which returns a real boolean) expect `true`/`false`. Only `exists` requests
|
|
234
|
+
* are touched; count/sum/min/max/avg stay numeric. No-op when no aggregates.
|
|
235
|
+
*/
|
|
236
|
+
private _coerceAggregates;
|
|
237
|
+
first(): Promise<T | null>;
|
|
238
|
+
find(id: number | string): Promise<T | null>;
|
|
239
|
+
get(): Promise<T[]>;
|
|
240
|
+
all(): Promise<T[]>;
|
|
241
|
+
count(): Promise<number>;
|
|
242
|
+
paginate(page?: number, perPage?: number): Promise<PaginatedResult<T>>;
|
|
243
|
+
with(...relations: string[]): this;
|
|
244
|
+
withPivot(..._columns: string[]): this;
|
|
245
|
+
create(data: Partial<T>): Promise<T>;
|
|
246
|
+
update(id: number | string, data: Partial<T>): Promise<T>;
|
|
247
|
+
updateAll(data: Partial<T>): Promise<number>;
|
|
248
|
+
delete(id: number | string): Promise<void>;
|
|
249
|
+
deleteAll(): Promise<number>;
|
|
250
|
+
insertMany(rows: Partial<T>[]): Promise<void>;
|
|
251
|
+
upsert(rows: Partial<T>[], uniqueBy: string[], update: string[]): Promise<number>;
|
|
252
|
+
/**
|
|
253
|
+
* `INSERT INTO table (cols) SELECT …` — insert rows produced by a subquery
|
|
254
|
+
* (another native query or a raw SQL string + bindings; same body forms as
|
|
255
|
+
* {@link whereExists}). The column list is required and maps the subquery's
|
|
256
|
+
* projection positionally. Returns the inserted-row count. Bulk data-plane
|
|
257
|
+
* write: no observer events, no fillable/guarded filtering, no key
|
|
258
|
+
* generation — like `insertMany`/`upsert`.
|
|
259
|
+
*/
|
|
260
|
+
insertUsing(columns: readonly string[], query: QueryBuilder<unknown> | string, bindings?: readonly unknown[]): Promise<number>;
|
|
261
|
+
restore(id: number | string): Promise<T>;
|
|
262
|
+
forceDelete(id: number | string): Promise<void>;
|
|
263
|
+
increment(id: number | string, column: string, amount?: number, extra?: Record<string, unknown>): Promise<T>;
|
|
264
|
+
decrement(id: number | string, column: string, amount?: number, extra?: Record<string, unknown>): Promise<T>;
|
|
265
|
+
/**
|
|
266
|
+
* Accumulate a relation-existence predicate (`whereHas` / `whereDoesntHave`).
|
|
267
|
+
* Compiled to a correlated `EXISTS` / `NOT EXISTS` subquery AND-merged into
|
|
268
|
+
* the WHERE at terminal time. Composes with flat wheres, soft deletes, and
|
|
269
|
+
* other relation predicates.
|
|
270
|
+
*/
|
|
271
|
+
whereRelationExists(predicate: RelationExistencePredicate): this;
|
|
272
|
+
/**
|
|
273
|
+
* Accumulate aggregate eager-load requests (`withCount`/`withSum`/etc.). Each
|
|
274
|
+
* becomes a correlated `(subselect) AS alias` column in the SELECT list, so
|
|
275
|
+
* the value is stamped on every returned row under `alias` (the Model
|
|
276
|
+
* hydration layer copies it onto the instance).
|
|
277
|
+
*/
|
|
278
|
+
withAggregate(requests: AggregateRequest[]): this;
|
|
279
|
+
/**
|
|
280
|
+
* Single-scalar aggregate terminal — `SELECT fn(col) FROM table WHERE …`.
|
|
281
|
+
* Powers `instance.loadSum`/`loadMin`/etc. Returns `0` for count, `0` for sum
|
|
282
|
+
* on an empty set, `null` for min/max/avg on an empty set, and a boolean for
|
|
283
|
+
* `exists`. `column` is required for sum/min/max/avg.
|
|
284
|
+
*/
|
|
285
|
+
_aggregate(fn: AggregateFn, column?: string): Promise<unknown>;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* The sub-builder passed to the callback form of `join(...)`. Pushes
|
|
289
|
+
* {@link JoinCondition}s into the array the `NativeQueryBuilder` holds for that
|
|
290
|
+
* join — `on`/`orOn` are column-vs-column (nothing binds), `where`/`orWhere`
|
|
291
|
+
* are column-vs-value (the value binds at compile time).
|
|
292
|
+
*/
|
|
293
|
+
export declare class NativeJoinClause implements JoinClause {
|
|
294
|
+
private readonly conditions;
|
|
295
|
+
constructor(conditions: JoinCondition[]);
|
|
296
|
+
on(left: string, operatorOrRight: WhereOperator | string, right?: string): this;
|
|
297
|
+
orOn(left: string, operatorOrRight: WhereOperator | string, right?: string): this;
|
|
298
|
+
where(column: string, operatorOrValue: WhereOperator | unknown, value?: unknown): this;
|
|
299
|
+
orWhere(column: string, operatorOrValue: WhereOperator | unknown, value?: unknown): this;
|
|
300
|
+
private _pushOn;
|
|
301
|
+
private _pushWhere;
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=query-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder.d.ts","sourceRoot":"","sources":["../../src/native/query-builder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,YAAY,EAEZ,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAiB,KAAK,OAAO,EAAiB,MAAM,cAAc,CAAA;AACzE,OAAO,KAAK,EAAE,QAAQ,EAA0B,MAAM,aAAa,CAAA;AACnE,OAAO,EAaL,KAAK,aAAa,EAKlB,KAAK,cAAc,EAGpB,MAAM,eA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