@forinda/kickjs-db 8.8.0 → 8.10.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/dist/adapter-DKRmIatU.d.mts +69 -0
- package/dist/adapter-DKRmIatU.d.mts.map +1 -0
- package/dist/cli.d.mts +4 -2
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +4 -4
- package/dist/cli.mjs.map +1 -1
- package/dist/create-Dxv1CmO0.mjs +31 -0
- package/dist/create-Dxv1CmO0.mjs.map +1 -0
- package/dist/custom-type-0v1pEaSz.mjs +12 -0
- package/dist/custom-type-0v1pEaSz.mjs.map +1 -0
- package/dist/devtools-events.d.mts +1 -1
- package/dist/devtools-events.mjs +1 -1
- package/dist/{index-sRSu3kiL.d.mts → index-D98BJCWj.d.mts} +78 -20
- package/dist/index-D98BJCWj.d.mts.map +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +2 -2
- package/dist/mysql.d.mts +2 -2
- package/dist/mysql.mjs +8 -6
- package/dist/mysql.mjs.map +1 -1
- package/dist/{pg-CJr6OX2u.mjs → pg-CsEZYRUy.mjs} +3 -3
- package/dist/{pg-CJr6OX2u.mjs.map → pg-CsEZYRUy.mjs.map} +1 -1
- package/dist/pg.d.mts +5 -69
- package/dist/pg.d.mts.map +1 -1
- package/dist/pg.mjs +9 -6
- package/dist/pg.mjs.map +1 -1
- package/dist/pglite.d.mts +39 -0
- package/dist/pglite.d.mts.map +1 -0
- package/dist/pglite.mjs +12 -0
- package/dist/pglite.mjs.map +1 -0
- package/dist/{schema-BP_TZ1Sv.d.mts → schema-Cl1eDPkD.d.mts} +3 -3
- package/dist/{schema-BP_TZ1Sv.d.mts.map → schema-Cl1eDPkD.d.mts.map} +1 -1
- package/dist/{schema-types-DqdkKV19.d.mts → schema-types-BMUMDpUC.d.mts} +3 -3
- package/dist/{schema-types-DqdkKV19.d.mts.map → schema-types-BMUMDpUC.d.mts.map} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +2 -2
- package/dist/{split-statements-E5gaoZIS.mjs → split-statements-DSWCQZGv.mjs} +2 -2
- package/dist/{split-statements-E5gaoZIS.mjs.map → split-statements-DSWCQZGv.mjs.map} +1 -1
- package/dist/sqlite.d.mts +1 -1
- package/dist/sqlite.d.mts.map +1 -1
- package/dist/sqlite.mjs +9 -7
- package/dist/sqlite.mjs.map +1 -1
- package/dist/src-C0egEVT1.mjs +203 -0
- package/dist/src-C0egEVT1.mjs.map +1 -0
- package/dist/{table-xq-X29gB.d.mts → table-xb127l8S.d.mts} +2 -2
- package/dist/{table-xq-X29gB.d.mts.map → table-xb127l8S.d.mts.map} +1 -1
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/{types-ydAqBLR1.d.mts → types-BosmVkt_.d.mts} +82 -11
- package/dist/types-BosmVkt_.d.mts.map +1 -0
- package/dist/{types-LCdRbLC1.d.mts → types-CBoxFMRg.d.mts} +13 -1
- package/dist/types-CBoxFMRg.d.mts.map +1 -0
- package/package.json +15 -6
- package/dist/create-K_h9SGPl.mjs +0 -29
- package/dist/create-K_h9SGPl.mjs.map +0 -1
- package/dist/custom-type-BPJpUuWz.mjs +0 -12
- package/dist/custom-type-BPJpUuWz.mjs.map +0 -1
- package/dist/index-sRSu3kiL.d.mts.map +0 -1
- package/dist/src-TXge_81j.mjs +0 -200
- package/dist/src-TXge_81j.mjs.map +0 -1
- package/dist/types-LCdRbLC1.d.mts.map +0 -1
- package/dist/types-ydAqBLR1.d.mts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { d as TypedColumnRefs, t as ColumnBuilder, v as IndexSnapshot, x as RoleSnapshot, y as PolicySnapshot } from "./types-
|
|
2
|
+
import { d as TypedColumnRefs, t as ColumnBuilder, v as IndexSnapshot, x as RoleSnapshot, y as PolicySnapshot } from "./types-CBoxFMRg.mjs";
|
|
3
3
|
//#region src/dsl/rls.d.ts
|
|
4
4
|
/** A database role, for `policy().to(...)` — created by migrations unless `.existing()`. */
|
|
5
5
|
declare class RoleDecl {
|
|
@@ -218,4 +218,4 @@ declare function buildTable<TName extends string, C extends Record<string, Colum
|
|
|
218
218
|
declare function unwrapTable(value: unknown): TableDecl | undefined;
|
|
219
219
|
//#endregion
|
|
220
220
|
export { PolicyDecl as _, qualifiedTableName as a, pgRole as b, CheckDecl as c, PrimaryKeyDecl as d, TableConstraint as f, unique as g, primaryKey as h, buildTable as i, IndexDecl as l, index as m, TableDecl as n, table as o, check as p, TableOptions as r, unwrapTable as s, QualifiedName as t, IndexKey as u, RoleDecl as v, policy as x, isRole as y };
|
|
221
|
-
//# sourceMappingURL=table-
|
|
221
|
+
//# sourceMappingURL=table-xb127l8S.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-
|
|
1
|
+
{"version":3,"file":"table-xb127l8S.d.mts","names":[],"sources":["../src/dsl/rls.ts","../src/dsl/constraints.ts","../src/dsl/table.ts"],"mappings":";;;;cAGa;WACF;WACA,QAAQ;;EAEjB;EAEA,YAAY,cAAc,UAAS,KAAK;;EAKxC;;;;;;;;;;;iBAec,OAAO,cAAc,UAAS,KAAK,wBAA6B;iBAIhE,OAAO,iBAAiB,SAAS;KAI5C,UAAU;;cAGF;WACF;WACA,UAAU;EAEnB,YAAY;;EAKZ,IAAI,SAAS;;EAMb,MAAM,OAAO,eAAe;;;;;EAS5B,GAAG;;EAMH,MAAM;;EAMN,UAAU;;;;;;;;;;;;;;;;;iBAqBI,OAAO,eAAe;;;UC9F5B;EACR;;;KAIU,WAAW;;;;;;;;;;cAeV;;WAEF,SAAS;EAElB,YAAY,cAAc,MAAM,YAAY;;EAK5C,MAAM;;EAMN,MAAM;;EAMN,WAAW,MAAM;;EAMjB,GAAG,KAAK,UAAU;;;;;;EAclB;;iBAMc,MAAM;EAElB,MAAE,MAAU,aAAa;;iBAMb,OAAO;EAEnB,MAAE,MAAU,aAAa;;;UAOZ;EACf;;EAEA;EACA;;;UAIe;EACf;EACA;;EAEA;;;KAIU,kBAAkB,YAAY,iBAAiB,YAAY;;;;;;;;;;iBAWvD,WAAW;EAEvB,MAAE,MAAU,WAAW;;;;;;iBAYX,MAAM,cAAc,qBAAqB;;;UCxHxC,UACf,+BACA,UAAU,eAAe,iBAAiB,eAAe,gBACzD;EAEA;EACA,QAAQ;EACR,WAAW;EACX,WAAW;;EAEX,eAAe;EACf,WAAW;;EAEX;;EAEA;IAAU;;EACV,aAAa;;;;;;;;;EASb,WAAW;;;;;WAKF,UAAU,SAAS;;;;;;;;;;KAWlB,cACV,sBACA,sCACE,4BAA4B,WAAW,UAAU;;iBAGrC,mBAAmB;EACjC;EACA;;KAKG,UACH,sBACA,UAAU,eAAe,gBACzB,kDACE,UAAU,OAAO,GAAG,WAAW,gBAAgB;KAE9C,kBAAkB,UAAU,eAAe,mBAC9C,MAAM,gBAAgB,OACnB,eAAe;;;;;KAMR,aAAa,UAAU,eAAe,kBAC9C,kBAAkB;EAEhB,cAAc,kBAAkB;EAChC;;;;;;;EAOA;IAAkB;;;;;;;;;iBASR,MAAM,sBAAsB,UAAU,eAAe,gBACnE,MAAM,OACN,SAAS,GACT,UAAU,aAAa,KACtB,UAAU,OAAO;;;;;iBAQJ,WACd,sBACA,UAAU,eAAe,gBACzB,oCAEA,MAAM,OACN,UAAU,GACV,SAAS,aAAa,gBACtB,QAAQ,UACP,UAAU,OAAO,GAAG;;;;;;;iBA6EP,YAAY,iBAAiB"}
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { t as SchemaToTypes } from "./schema-types-
|
|
2
|
+
import { r as KickDbClient, s as QueryEvent } from "./types-BosmVkt_.mjs";
|
|
3
|
+
import { t as SchemaToTypes } from "./schema-types-BMUMDpUC.mjs";
|
|
4
4
|
//#region src/testing.d.ts
|
|
5
5
|
export interface TestDbOptions<S> {
|
|
6
6
|
schema: S;
|
package/dist/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-db v8.
|
|
2
|
+
* @forinda/kickjs-db v8.10.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{D as emitPg,
|
|
11
|
+
import{D as emitPg,J as diff,R as EVENTS_ENABLED,Z as extractSnapshot,d as migrateLatest,t as createDbClient,y as emitSqlite}from"./create-Dxv1CmO0.mjs";import{randomBytes}from"node:crypto";async function createTestDb(opts){let{default:Database}=await import(`better-sqlite3`),{sqliteAdapter,sqliteDialect}=await import(`./sqlite.mjs`),database=new Database(`:memory:`);if(database.pragma(`foreign_keys = ON`),opts.migrationsDir)await migrateLatest({adapter:sqliteAdapter({database}),migrationsDir:opts.migrationsDir,requireReviewed:!1,driftCheck:`ignore`});else{let empty={version:1,dialect:`sqlite`,tables:{}},target=extractSnapshot(opts.schema,`sqlite`,{casing:opts.casing});database.exec(emitSqlite(diff(empty,target),{from:empty,to:target}))}return createDbClient({schema:opts.schema,dialect:sqliteDialect({database}),casing:opts.casing,events:!0})}async function createPgTestDb(opts){let{default:pg}=await import(`pg`),{pgAdapter,pgDialect}=await import(`./pg.mjs`),name=`kick_test_${randomBytes(6).toString(`hex`)}`,admin=new pg.Client({connectionString:opts.connectionString});await admin.connect();try{await admin.query(`CREATE DATABASE "${name}"`)}finally{await admin.end()}let url=new URL(opts.connectionString);url.pathname=`/${name}`;let connectionString=url.toString(),pool=new pg.Pool({connectionString});pool.on(`error`,()=>{}),pool.on(`connect`,client=>client.on(`error`,()=>{})),opts.migrationsDir?await migrateLatest({adapter:pgAdapter({pool}),migrationsDir:opts.migrationsDir,requireReviewed:!1,driftCheck:`ignore`}):await pool.query(emitPg(diff({version:1,dialect:`postgres`,tables:{}},extractSnapshot(opts.schema,`postgres`,{casing:opts.casing}))));let db=createDbClient({schema:opts.schema,dialect:pgDialect({pool}),casing:opts.casing,events:!0});return{db,connectionString,async drop(){await db.destroy();let admin=new pg.Client({connectionString:opts.connectionString});await admin.connect();try{await admin.query(`DROP DATABASE IF EXISTS "${name}" WITH (FORCE)`)}finally{await admin.end()}}}}const ROLLBACK=Symbol(`kickjs-db rolled back`);async function rolledBack(db,fn){let result;return await db.transaction(async()=>{throw result=await fn(),ROLLBACK}).catch(err=>{if(err!==ROLLBACK)throw err}),result}async function captureQueries(db,fn){if(db[EVENTS_ENABLED]===!1)throw Error("captureQueries: this client was created without events, so no query is reported and every count would be 0. Create it with `events: true`.");let queries=[],listener=event=>void queries.push(event);db.on(`query`,listener);try{return{result:await fn(),queries}}finally{db.off(`query`,listener)}}async function expectQueries(db,count,fn){let{result,queries}=await captureQueries(db,fn);if(queries.length!==count){let list=queries.map((q,i)=>` ${i+1}. ${q.sql}`).join(`
|
|
12
12
|
`);throw Error(`Expected ${count} quer${count===1?`y`:`ies`}, ran ${queries.length}:\n${list||` (none)`}`)}return result}export{captureQueries,createPgTestDb,createTestDb,expectQueries,rolledBack};
|
|
13
13
|
//# sourceMappingURL=testing.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { l as NotNullBrand, o as GeneratedBrand, t as ColumnBuilder } from "./types-
|
|
2
|
+
import { l as NotNullBrand, o as GeneratedBrand, t as ColumnBuilder } from "./types-CBoxFMRg.mjs";
|
|
3
3
|
import { CommonTableExpression, Dialect, Expression, ExpressionBuilder, Insertable, Kysely, KyselyPlugin, SelectQueryBuilder, SelectType, Selectable, SqlBool, UpdateObject } from "kysely";
|
|
4
4
|
//#region src/client/insert-many.d.ts
|
|
5
5
|
interface InsertManyOptions {
|
|
@@ -33,8 +33,10 @@ interface UpsertOptions<DB, T extends keyof DB & string> extends InsertManyOptio
|
|
|
33
33
|
* What to update on a conflict: column names take the incoming row's value
|
|
34
34
|
* (the default is every inserted column outside `target`); an object sets
|
|
35
35
|
* values or expressions — ``{ views: sql`page_views.views + 1` }``.
|
|
36
|
+
* `false` leaves a conflicting row as it is (`ON CONFLICT DO NOTHING`) and
|
|
37
|
+
* returns it as stored.
|
|
36
38
|
*/
|
|
37
|
-
update?: ReadonlyArray<keyof DB[T] & string> | UpdateObject<DB, T
|
|
39
|
+
update?: ReadonlyArray<keyof DB[T] & string> | UpdateObject<DB, T> | false;
|
|
38
40
|
/**
|
|
39
41
|
* The predicate of a partial unique index `target` refers to (Postgres,
|
|
40
42
|
* SQLite). Write it as the index does, with literals — ``() => sql`active = 1` ``:
|
|
@@ -321,8 +323,12 @@ interface RelationMapEntry {
|
|
|
321
323
|
kind: 'one' | 'many';
|
|
322
324
|
target: string;
|
|
323
325
|
relationName?: string;
|
|
324
|
-
/**
|
|
325
|
-
|
|
326
|
+
/**
|
|
327
|
+
* A `morphTo`: `target` is the union of its tables. The typegen records each
|
|
328
|
+
* type value's table (`{ post: 'posts', podcast: 'podcasts' }`), which types
|
|
329
|
+
* the subject's `__type`; a hand-written `true` types it as `string`.
|
|
330
|
+
*/
|
|
331
|
+
morphTo?: true | Record<string, string>;
|
|
326
332
|
}
|
|
327
333
|
/**
|
|
328
334
|
* The full registered relation graph. Falls back to an open-shaped
|
|
@@ -426,12 +432,20 @@ type WithClause<DB, Rels extends Record<string, RelationMapEntry>> = { [K in key
|
|
|
426
432
|
* the full options.
|
|
427
433
|
*/
|
|
428
434
|
type WithOptions<DB, E, Target extends keyof DB & string> = [E] extends [never] ? NestedOptions<DB, Target> : E extends {
|
|
429
|
-
morphTo:
|
|
430
|
-
} ? {
|
|
435
|
+
morphTo: infer M;
|
|
436
|
+
} ? M extends Record<string, string> ? MorphToOptions<DB, M> : {
|
|
431
437
|
withDeleted?: boolean;
|
|
432
438
|
} : NestedOptions<DB, Target>;
|
|
433
|
-
/**
|
|
434
|
-
|
|
439
|
+
/**
|
|
440
|
+
* A `morphTo` level: `withDeleted` for every target, and each target's own
|
|
441
|
+
* options under its type value — one row each, so no order, limit or offset.
|
|
442
|
+
*/
|
|
443
|
+
type MorphToOptions<DB, M extends Record<string, string>> = {
|
|
444
|
+
withDeleted?: boolean;
|
|
445
|
+
targets?: { [V in keyof M & string]?: M[V] extends keyof DB & string ? true | Omit<NestedOptions<DB, M[V]>, 'orderBy' | 'limit' | 'offset'> : never; };
|
|
446
|
+
};
|
|
447
|
+
/** A nested level runs inside its parent's query: cancelling and the depth limit are the parent's. */
|
|
448
|
+
type NestedOptions<DB, Target extends keyof DB & string> = Omit<FindManyOptions<DB, Target>, 'signal' | 'timeoutMs' | 'maxDepth'>;
|
|
435
449
|
/**
|
|
436
450
|
* Resolved row shape returned by `findMany`. Base table columns
|
|
437
451
|
* intersected with the per-relation slot map produced by `with`.
|
|
@@ -459,7 +473,24 @@ type WithSlots<DB, Table extends keyof DB & string, W> = W extends Record<string
|
|
|
459
473
|
* Resolve one slot. `one` returns `Related | null`; `many` returns
|
|
460
474
|
* `Related[]`. Nested options recurse through `FindManyRow`.
|
|
461
475
|
*/
|
|
462
|
-
type ResolveRelationSlot<DB, R extends RelationMapEntry, V> = R['target'] extends keyof DB & string ?
|
|
476
|
+
type ResolveRelationSlot<DB, R extends RelationMapEntry, V> = R['target'] extends keyof DB & string ? R extends {
|
|
477
|
+
morphTo: infer M;
|
|
478
|
+
} ? M extends Record<string, string> ? MorphToSubject<DB, M, V> | null : (DB[R['target']] & {
|
|
479
|
+
__type: string;
|
|
480
|
+
}) | null : V extends true ? R['kind'] extends 'one' ? DB[R['target']] | null : DB[R['target']][] : V extends FindManyOptions<DB, R['target']> ? R['kind'] extends 'one' ? FindManyRow<DB, R['target'], V> | null : FindManyRow<DB, R['target'], V>[] : never : never;
|
|
481
|
+
/**
|
|
482
|
+
* A `morphTo` subject: its table's row, tagged with the type value it was
|
|
483
|
+
* found by — `subject.__type === 'post'` narrows it to a post.
|
|
484
|
+
*/
|
|
485
|
+
type MorphToSubject<DB, M, W> = M extends Record<string, string> ? { [V in keyof M & string]: M[V] extends keyof DB & string ? TargetRow<DB, M[V], TargetOptions<W, V>> & {
|
|
486
|
+
__type: V;
|
|
487
|
+
} : never; }[keyof M & string] : never;
|
|
488
|
+
/** A target's own options from `with: { subject: { targets: { <type>: … } } }`, or `true`. */
|
|
489
|
+
type TargetOptions<W, V extends string> = W extends {
|
|
490
|
+
targets?: infer T;
|
|
491
|
+
} ? V extends keyof T ? T[V] : true : true;
|
|
492
|
+
/** A target's row: the plain row, or shaped by its options. */
|
|
493
|
+
type TargetRow<DB, Table extends keyof DB & string, O> = [O] extends [true | undefined] ? DB[Table] : O extends FindManyOptions<DB, Table> ? FindManyRow<DB, Table, O> : DB[Table];
|
|
463
494
|
/**
|
|
464
495
|
* Per-table query namespace exposed as `db.query.X`. v1 ships read
|
|
465
496
|
* methods only — writes route through layers 1 + 2 (`selectFrom`,
|
|
@@ -492,16 +523,26 @@ interface QueryEvent {
|
|
|
492
523
|
sql: string;
|
|
493
524
|
parameters: readonly unknown[];
|
|
494
525
|
durationMs: number;
|
|
526
|
+
/** Kysely's id for this query: pairs `beforeQuery`, `query` and `queryError`. */
|
|
527
|
+
queryId?: string;
|
|
528
|
+
/** The transaction it ran in, when it ran in one (a savepoint shares its transaction's). */
|
|
529
|
+
txId?: string;
|
|
495
530
|
}
|
|
496
531
|
interface QueryErrorEvent {
|
|
497
532
|
sql: string;
|
|
498
533
|
parameters: readonly unknown[];
|
|
499
534
|
error: unknown;
|
|
535
|
+
/** Kysely's id for this query: pairs `beforeQuery`, `query` and `queryError`. */
|
|
536
|
+
queryId?: string;
|
|
537
|
+
/** The transaction it ran in, when it ran in one (a savepoint shares its transaction's). */
|
|
538
|
+
txId?: string;
|
|
500
539
|
}
|
|
501
540
|
interface BeforeQueryEvent {
|
|
502
541
|
/** Mutable — listeners may rewrite sql / parameters before execution. */
|
|
503
542
|
sql: string;
|
|
504
543
|
parameters: unknown[];
|
|
544
|
+
/** Kysely's id for this query, as `query` / `queryError` report it. Absent for statements kick/db sends itself. */
|
|
545
|
+
readonly queryId?: string;
|
|
505
546
|
}
|
|
506
547
|
interface TransactionEvent {
|
|
507
548
|
isolation?: 'serializable' | 'repeatable read' | 'read committed' | 'read uncommitted';
|
|
@@ -518,6 +559,12 @@ interface TransactionRetryEvent extends TransactionEvent {
|
|
|
518
559
|
delayMs: number;
|
|
519
560
|
}
|
|
520
561
|
/** Options for `transaction(opts, fn)`. */
|
|
562
|
+
/** A transaction from `startTransaction()`: a client, and the way to finish it. */
|
|
563
|
+
type ManualTransaction<DB> = KickDbClient<DB> & {
|
|
564
|
+
/** Commit, then run its `afterCommit` hooks. */
|
|
565
|
+
commit(): Promise<void>;
|
|
566
|
+
rollback(): Promise<void>;
|
|
567
|
+
};
|
|
521
568
|
interface TransactionOptions extends TransactionEvent {
|
|
522
569
|
/**
|
|
523
570
|
* What to do when a transaction is already open on this call chain:
|
|
@@ -698,6 +745,11 @@ interface KickDbClient<DB = RegisteredDB> {
|
|
|
698
745
|
}): Promise<number>;
|
|
699
746
|
insertMany<T extends keyof DB & string>(table: T, rows: ReadonlyArray<Insertable<DB[T]>>, options: InsertManyOptions & {
|
|
700
747
|
returning: true;
|
|
748
|
+
/**
|
|
749
|
+
* MySQL, which has no RETURNING: a unique key every row gives, to read
|
|
750
|
+
* the inserted rows back by. Required there; ignored elsewhere.
|
|
751
|
+
*/
|
|
752
|
+
readBack?: ReadonlyArray<keyof DB[T] & string>;
|
|
701
753
|
}): Promise<Selectable<DB[T]>[]>;
|
|
702
754
|
/**
|
|
703
755
|
* The row matching `where`, or a new one from `where` + `create`;
|
|
@@ -729,6 +781,18 @@ interface KickDbClient<DB = RegisteredDB> {
|
|
|
729
781
|
* stays committed.
|
|
730
782
|
*/
|
|
731
783
|
afterCommit(fn: () => unknown): Promise<void>;
|
|
784
|
+
/**
|
|
785
|
+
* Open a transaction you finish yourself — for a test that rolls back what
|
|
786
|
+
* it wrote, or a transaction handed across layers:
|
|
787
|
+
*
|
|
788
|
+
* const tx = await db.startTransaction()
|
|
789
|
+
* try { await tx.insertInto('orders').values(o).execute(); await tx.commit() }
|
|
790
|
+
* catch (err) { await tx.rollback(); throw err }
|
|
791
|
+
*
|
|
792
|
+
* Prefer `transaction(fn)`, which can't leave one open. Takes its options
|
|
793
|
+
* but `retry`; its query events carry no `txId`.
|
|
794
|
+
*/
|
|
795
|
+
startTransaction(opts?: Omit<TransactionOptions, 'retry'>): Promise<ManualTransaction<DB>>;
|
|
732
796
|
/** Whether this call chain is inside a transaction. */
|
|
733
797
|
readonly inTransaction: boolean;
|
|
734
798
|
/**
|
|
@@ -813,6 +877,13 @@ interface CreateDbClientOptions<TSchema, _DB = unknown> {
|
|
|
813
877
|
* surface is attached.
|
|
814
878
|
*/
|
|
815
879
|
slowQueryThresholdMs?: number | null;
|
|
880
|
+
/**
|
|
881
|
+
* Add where each query was built to its error's stack — the line that
|
|
882
|
+
* called `.execute()` or `findMany()`, which a driver error otherwise
|
|
883
|
+
* loses across the await. Records a stack per query, so it's for
|
|
884
|
+
* development. Default `false`.
|
|
885
|
+
*/
|
|
886
|
+
asyncStackTraces?: boolean;
|
|
816
887
|
/**
|
|
817
888
|
* Optional KickEventBus instance the client republishes lifecycle
|
|
818
889
|
* events to. When set, the bus receives:
|
|
@@ -883,5 +954,5 @@ interface CreateDbClientOptions<TSchema, _DB = unknown> {
|
|
|
883
954
|
casing?: 'snake_case';
|
|
884
955
|
}
|
|
885
956
|
//#endregion
|
|
886
|
-
export {
|
|
887
|
-
//# sourceMappingURL=types-
|
|
957
|
+
export { TenancyStrategy as A, WithClause as C, BypassOptions as D, BypassInfo as E, ExtensionDefinition as F, ModelExtensions as I, FindOrCreateOptions as L, defineTenancy as M, tenantKey as N, Tenancy as O, ExtendedClient as P, UpsertOptions as R, TableRelations as S, RegisteredDB as T, KickDbRelationsRegister as _, ManualTransaction as a, RelationMapEntry as b, ReadRoute as c, TransactionEvent as d, TransactionOptions as f, FindManyRow as g, FindManyOptions as h, KickDbClientEvents as i, TenantRequiredError as j, TenancyOptions as k, ReadRouter as l, TransactionRollbackEvent as m, CreateDbClientOptions as n, QueryErrorEvent as o, TransactionRetryEvent as p, KickDbClient as r, QueryEvent as s, BeforeQueryEvent as t, SlowQueryEvent as u, QueryNamespace as v, KickDbRegister as w, TableQueryNamespace as x, RegisteredRelations as y, InsertManyOptions as z };
|
|
958
|
+
//# sourceMappingURL=types-BosmVkt_.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BosmVkt_.d.mts","names":["_$__upsert0.UpsertOptions","_$__insert_many0.InsertManyOptions","_$__upsert0.FindOrCreateOptions","_$___extend_types0.ExtensionDefinition","_$___extend_types0.ExtendedClient","KyselyDialect","_$___tenancy0.Tenancy"],"sources":["../src/client/insert-many.ts","../src/client/upsert.ts","../src/extend/types.ts","../src/tenancy.ts","../src/client/register.ts","../src/query/types.ts","../src/client/types.ts"],"mappings":";;;;UAiBiB;;;;;EAKf;;;;;;EAMA;;;;UCTe,cAAc,IAAI,gBAAgB,qBAAqB;;;;;EAKtE,QAAQ,WAAW,GAAG,MAAM,cAAc,WAAW,GAAG;;;;;;EAMxD,QAAQ,oBAAoB,GAAG;;;;;;;;EAQ/B,SAAS,oBAAoB,GAAG,eAAe,aAAa,IAAI;;;;;;EAMhE,SAAS,IAAI,kBAAkB,IAAI,OAAO,WAAW;;;KAIlD,YAAY,QAAQ,WAAW,iBAAiB,KAAK,GAAG,aAAa,WAAU;;KAG/E,WAAW,IAAI,gBAAgB,IAAI,KAAK,KAAK,WAAW,GAAG,KAAK,YAAY,MAC/E,QAAQ,WAAW,GAAG;KAEZ,oBACV,IACA,gBAAgB,aAChB,UAAU,QAAQ,WAAW,GAAG,OAAO,QAAQ,WAAW,GAAG;;EAG7D,OAAO,IAAI,OAAO,cAAc,SAAS,WAAW,GAAG;gBACzC,WAAW,IAAI,GAAG;EAE5B,SAAS,WAAW,IAAI,GAAG;;EAC3B,QAAQ,WAAW,I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AO,KAAK,+BAA+B,QAAQ,kBAAkB;;WAG7E;;;;;WAMA,SAAS,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAyB/B,SAAS,UAAwDC,oBAAA,KAC/D,KAAK,IACyCC,eAAJ,IAAI;EAEhD,WAAW;;UAGI,sBAAsB,SAAS;;EAE9C,QAAQ;;;;;EAKR,SAASC;;;;;;EAMT;;;;;EAKA,UAXSC;;;;;;;EAkBT,UAAUD,mBAAyBA;;;;;;;;;;;EAWnC,QAAQ;;;;;;;EAOR;;;;;;;EAOA;;;;;;;EAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCjD,UAAU;;;;;;EAMV"}
|
|
@@ -7,6 +7,8 @@ interface ColumnSnapshot {
|
|
|
7
7
|
type: string;
|
|
8
8
|
nullable: boolean;
|
|
9
9
|
default: string | null;
|
|
10
|
+
/** `default` is SQL to evaluate (`.defaultSql()`), not a value. Absent means a value. */
|
|
11
|
+
defaultSql?: true;
|
|
10
12
|
primaryKey: boolean;
|
|
11
13
|
/** A column the database computes from others: `GENERATED ALWAYS AS (expression)`. */
|
|
12
14
|
generated?: {
|
|
@@ -286,6 +288,8 @@ interface ColumnState {
|
|
|
286
288
|
type: string;
|
|
287
289
|
nullable: boolean;
|
|
288
290
|
default: string | null;
|
|
291
|
+
/** `default` is SQL to evaluate (`.defaultSql()`), not a value. */
|
|
292
|
+
defaultSql?: boolean;
|
|
289
293
|
primaryKey: boolean;
|
|
290
294
|
unique: boolean;
|
|
291
295
|
references: FkSpec | null;
|
|
@@ -403,6 +407,14 @@ declare class ColumnBuilder<T = unknown> {
|
|
|
403
407
|
* itself (`'active'`); booleans/numbers emit bare (`false`, `0`).
|
|
404
408
|
*/
|
|
405
409
|
default(value: string | number | boolean): this & GeneratedBrand;
|
|
410
|
+
/**
|
|
411
|
+
* A default that is SQL, evaluated by the database for each new row —
|
|
412
|
+
* `id: text().primaryKey().defaultSql('gen_random_uuid()::text')`,
|
|
413
|
+
* `slug: text().defaultSql("lower(hex(randomblob(8)))")`. `.default()` is a
|
|
414
|
+
* value: on a text column `.default('now()')` stores the string `now()`.
|
|
415
|
+
* Written as given, so it's your dialect's SQL.
|
|
416
|
+
*/
|
|
417
|
+
defaultSql(expression: string): this & GeneratedBrand;
|
|
406
418
|
/**
|
|
407
419
|
* A default computed in JS for each inserted row that doesn't set this
|
|
408
420
|
* column — an id generator, a slug, a value from config:
|
|
@@ -462,4 +474,4 @@ declare class ColumnBuilder<T = unknown> {
|
|
|
462
474
|
}
|
|
463
475
|
//#endregion
|
|
464
476
|
export { TableSnapshot as C, SchemaSnapshot as S, ForeignKeySnapshot as _, GeneratedAlwaysBrand as a, RelationSnapshot as b, KICK_NOT_NULL as c, TypedColumnRefs as d, CheckSnapshot as f, FkAction as g, EnumSnapshot as h, FkSpec as i, NotNullBrand as l, Dialect as m, ColumnRef as n, GeneratedBrand as o, ColumnSnapshot as p, ColumnState as r, KICK_GENERATED as s, ColumnBuilder as t, TypedColumnRef as u, IndexSnapshot as v, ViewSnapshot as w, RoleSnapshot as x, PolicySnapshot as y };
|
|
465
|
-
//# sourceMappingURL=types-
|
|
477
|
+
//# sourceMappingURL=types-CBoxFMRg.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CBoxFMRg.d.mts","names":[],"sources":["../src/snapshot/types.ts","../src/dsl/columns/types.ts"],"mappings":";;KAAY;KAEA;UAEK;EACf;EACA;EACA;EACA;;EAEA;EACA;;EAEA;IAAc;IAAoB;;;EAElC;;EAEA;;;;;EAKA;;UAGe;EACf;;EAEA;EACA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;UAGe;EACf;EACA;EACA;EACA;EACA,UAAU;EACV,UAAU;;UAGK;EACf;EACA;;UAGe;;;;;;EAMf;;;;;;EAMA;EACA,SAAS,eAAe;EACxB,SAAS;EACT,aAAa;EACb,QAAQ;;;;;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5C,kBAAkB;EAKlB,qBAAqB;EAMrB;EAKA,SAAS,qBAAqB,cAAc;EAK5C,WACE,cAAc,WACd;IAAQ,WAAW;IAAU,WAAW;IAAU;;;;;;;;;;;;;;EA4BpD,QAAQ,0CAA0C;;;;;;;;EAalD,WAAW,4BAA4B;;;;;;;EAYvC,WAAW,UAAU,WAAW;;;;;;EAUhC,UAAU,UAAU;;;;;EASpB;;;;;;EAUA;;;;;;;;EAYA,kBACE,oBACA;IAAW;aACH;;;;;EASV,oCAAoC,eAAe;;EAOnD,uCAAuC,eAAe;;;;;EAUtD,QAAQ;;;;;;EAUR,QAAQ;;EAMR,aAAa;EAIb,OAAO,eAAe;EAgBtB,WAAW,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forinda/kickjs-db",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0",
|
|
4
4
|
"description": "KickJS-native ORM — code-first schema, reversible migrations, multi-dialect SQL builder",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kickjs",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"import": "./dist/pg.mjs",
|
|
30
30
|
"types": "./dist/pg.d.mts"
|
|
31
31
|
},
|
|
32
|
+
"./pglite": {
|
|
33
|
+
"import": "./dist/pglite.mjs",
|
|
34
|
+
"types": "./dist/pglite.d.mts"
|
|
35
|
+
},
|
|
32
36
|
"./sqlite": {
|
|
33
37
|
"import": "./dist/sqlite.mjs",
|
|
34
38
|
"types": "./dist/sqlite.d.mts"
|
|
@@ -68,6 +72,7 @@
|
|
|
68
72
|
"@forinda/kickjs-cli-kit": "0.1.3"
|
|
69
73
|
},
|
|
70
74
|
"peerDependencies": {
|
|
75
|
+
"@electric-sql/pglite": ">=0.5.5",
|
|
71
76
|
"@forinda/kickjs": ">=8.8.0",
|
|
72
77
|
"@forinda/kickjs-devtools-kit": ">=7.0.0",
|
|
73
78
|
"better-sqlite3": ">=12.0.0",
|
|
@@ -75,6 +80,9 @@
|
|
|
75
80
|
"pg": ">=8.11.0"
|
|
76
81
|
},
|
|
77
82
|
"peerDependenciesMeta": {
|
|
83
|
+
"@electric-sql/pglite": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
78
86
|
"@forinda/kickjs-devtools-kit": {
|
|
79
87
|
"optional": true
|
|
80
88
|
},
|
|
@@ -89,10 +97,11 @@
|
|
|
89
97
|
}
|
|
90
98
|
},
|
|
91
99
|
"devDependencies": {
|
|
100
|
+
"@electric-sql/pglite": "0.5.8",
|
|
92
101
|
"@libsql/client": "^0.18.0",
|
|
93
102
|
"@libsql/kysely-libsql": "^0.4.1",
|
|
94
|
-
"@testcontainers/mysql": "^12.2.
|
|
95
|
-
"@testcontainers/postgresql": "^12.2.
|
|
103
|
+
"@testcontainers/mysql": "^12.2.1",
|
|
104
|
+
"@testcontainers/postgresql": "^12.2.1",
|
|
96
105
|
"@types/better-sqlite3": "^9.6.0",
|
|
97
106
|
"@types/node": "^26.6.5",
|
|
98
107
|
"@types/pg": "^8.23.1",
|
|
@@ -100,13 +109,13 @@
|
|
|
100
109
|
"kysely": "^0.29.6",
|
|
101
110
|
"kysely-d1": "^0.4.0",
|
|
102
111
|
"miniflare": "^4.20260730.0",
|
|
103
|
-
"mysql2": "^3.24.
|
|
112
|
+
"mysql2": "^3.24.6",
|
|
104
113
|
"pg": "^8.23.1",
|
|
105
114
|
"pg-cursor": "^2.22.1",
|
|
106
115
|
"typescript": "^7.0.2",
|
|
107
|
-
"@forinda/kickjs": "10.5.0",
|
|
108
116
|
"@forinda/kickjs-schema": "0.2.4",
|
|
109
|
-
"@forinda/kickjs-devtools-kit": "7.3.0"
|
|
117
|
+
"@forinda/kickjs-devtools-kit": "7.3.0",
|
|
118
|
+
"@forinda/kickjs": "10.8.0"
|
|
110
119
|
},
|
|
111
120
|
"publishConfig": {
|
|
112
121
|
"access": "public"
|