@event-driven-io/dumbo 0.13.0-beta.40 → 0.13.0-beta.42

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.
Files changed (61) hide show
  1. package/dist/cloudflare.cjs +4 -3
  2. package/dist/cloudflare.d.cts +3 -3
  3. package/dist/cloudflare.d.ts +3 -3
  4. package/dist/cloudflare.js +4 -4
  5. package/dist/{core-D-smW7cm.cjs → core-BPSzA-lq.cjs} +2091 -2075
  6. package/dist/core-BPSzA-lq.cjs.map +1 -0
  7. package/dist/{core-DXCRR5A9.cjs → core-BuSVyamf.cjs} +33 -3
  8. package/dist/core-BuSVyamf.cjs.map +1 -0
  9. package/dist/{core-BchvTX3G.js → core-C3xoqqDs.js} +28 -4
  10. package/dist/core-C3xoqqDs.js.map +1 -0
  11. package/dist/{core-DlV8ua1P.js → core-CHw8vO17.js} +9 -4
  12. package/dist/core-CHw8vO17.js.map +1 -0
  13. package/dist/{core-CWZb0zOY.cjs → core-CUGYxOEQ.cjs} +14 -3
  14. package/dist/core-CUGYxOEQ.cjs.map +1 -0
  15. package/dist/{core-BG__WVn6.js → core-IV7or0Mj.js} +2086 -2070
  16. package/dist/core-IV7or0Mj.js.map +1 -0
  17. package/dist/{index-N2ly5shv.d.cts → index-BJC_v03L.d.ts} +9 -3
  18. package/dist/{index-BDSQvDH2.d.cts → index-CfH0u2y_.d.cts} +260 -163
  19. package/dist/{index-BgFHGsuP.d.ts → index-DP9b7v4e.d.cts} +9 -3
  20. package/dist/{index-zkszkJqP.d.ts → index-QWEAqtHF.d.ts} +260 -163
  21. package/dist/{index-BdWFmDhJ.d.cts → index-qxECrBHo.d.ts} +10 -3
  22. package/dist/{index-cxtbLiju.d.ts → index-tS9lpLPz.d.cts} +10 -3
  23. package/dist/index.cjs +24 -12
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +2 -3
  26. package/dist/index.d.ts +2 -3
  27. package/dist/index.js +24 -13
  28. package/dist/index.js.map +1 -1
  29. package/dist/pg.cjs +4 -3
  30. package/dist/pg.d.cts +3 -3
  31. package/dist/pg.d.ts +3 -3
  32. package/dist/pg.js +4 -4
  33. package/dist/{postgreSQLMetadata-WGXySO7a.cjs → postgreSQLMetadata-CCsCJ-eH.cjs} +2 -2
  34. package/dist/{postgreSQLMetadata-WGXySO7a.cjs.map → postgreSQLMetadata-CCsCJ-eH.cjs.map} +1 -1
  35. package/dist/{postgreSQLMetadata-BTz6vdwE.js → postgreSQLMetadata-bCBDGz1f.js} +2 -2
  36. package/dist/{postgreSQLMetadata-BTz6vdwE.js.map → postgreSQLMetadata-bCBDGz1f.js.map} +1 -1
  37. package/dist/postgresql.cjs +3 -2
  38. package/dist/postgresql.d.cts +3 -3
  39. package/dist/postgresql.d.ts +3 -3
  40. package/dist/postgresql.js +3 -3
  41. package/dist/sqlite.cjs +3 -2
  42. package/dist/sqlite.d.cts +3 -3
  43. package/dist/sqlite.d.ts +3 -3
  44. package/dist/sqlite.js +3 -3
  45. package/dist/sqlite3.cjs +4 -3
  46. package/dist/sqlite3.d.cts +3 -3
  47. package/dist/sqlite3.d.ts +3 -3
  48. package/dist/sqlite3.js +4 -4
  49. package/dist/{sqliteMetadata-PJTRPIZ1.cjs → sqliteMetadata-Cc7Z03lm.cjs} +2 -2
  50. package/dist/{sqliteMetadata-PJTRPIZ1.cjs.map → sqliteMetadata-Cc7Z03lm.cjs.map} +1 -1
  51. package/dist/{sqliteMetadata-7qBjsMBN.js → sqliteMetadata-CvvEc1-v.js} +2 -2
  52. package/dist/{sqliteMetadata-7qBjsMBN.js.map → sqliteMetadata-CvvEc1-v.js.map} +1 -1
  53. package/package.json +1 -1
  54. package/dist/core-BG__WVn6.js.map +0 -1
  55. package/dist/core-BchvTX3G.js.map +0 -1
  56. package/dist/core-CWZb0zOY.cjs.map +0 -1
  57. package/dist/core-D-smW7cm.cjs.map +0 -1
  58. package/dist/core-DXCRR5A9.cjs.map +0 -1
  59. package/dist/core-DlV8ua1P.js.map +0 -1
  60. package/dist/index-DaP2fTEX.d.ts +0 -67
  61. package/dist/index-S_wp0Eaf.d.cts +0 -67
@@ -335,6 +335,11 @@ declare const SQLColumnToken: {
335
335
  type: "SQL_COLUMN";
336
336
  };
337
337
  //#endregion
338
+ //#region src/core/sql/valueMappers/reservedSqlWords.d.ts
339
+ declare const ansiSqlReservedMap: {
340
+ [key: string]: boolean;
341
+ };
342
+ //#endregion
338
343
  //#region src/core/sql/valueMappers/sqlValueMapper.d.ts
339
344
  interface SQLValueMapper {
340
345
  mapValue: MapSQLParamValue;
@@ -420,44 +425,222 @@ declare global {
420
425
  }
421
426
  declare const defaultProcessorsRegistry: SQLProcessorsRegistry;
422
427
  //#endregion
428
+ //#region src/core/schema/sqlMigration.d.ts
429
+ type MigrationStyle = 'None' | 'CreateOrUpdate';
430
+ type SQLMigration = {
431
+ name: string;
432
+ sqls: SQL[];
433
+ };
434
+ declare const sqlMigration: (name: string, sqls: SQL[]) => SQLMigration;
435
+ type MigrationRecord = {
436
+ id: number;
437
+ name: string;
438
+ application: string;
439
+ sqlHash: string;
440
+ timestamp: Date;
441
+ };
442
+ //#endregion
443
+ //#region src/core/schema/schemaComponent.d.ts
444
+ type SchemaComponent<ComponentKey extends string = string, AdditionalData extends Exclude<Record<string, unknown>, 'schemaComponentKey' | 'components' | 'migrations' | 'addComponent' | 'addMigration'> | undefined = undefined> = {
445
+ schemaComponentKey: ComponentKey;
446
+ components: ReadonlyMap<string, SchemaComponent>;
447
+ migrations: ReadonlyArray<SQLMigration>;
448
+ addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
449
+ addMigration: (migration: SQLMigration) => void;
450
+ } & Exclude<AdditionalData extends undefined ? {} : AdditionalData, 'schemaComponentKey' | 'components' | 'migrations' | 'addComponent' | 'addMigration'>;
451
+ type ExtractAdditionalData<T> = T extends SchemaComponent<infer _ComponentType, infer Data> ? Data : never;
452
+ type AnySchemaComponent = SchemaComponent<string, Record<string, any>>;
453
+ type AnySchemaComponentOfType<ComponentType extends string = string> = SchemaComponent<ComponentType, any>;
454
+ type SchemaComponentOptions<AdditionalOptions extends Record<string, unknown> = Record<string, unknown>> = {
455
+ migrations?: ReadonlyArray<SQLMigration>;
456
+ components?: ReadonlyArray<SchemaComponent>;
457
+ } & Omit<AdditionalOptions, 'migrations' | 'components'>;
458
+ type SchemaComponentType<Kind extends string = string> = `sc:${Kind}`;
459
+ type DumboSchemaComponentType<Kind extends string = string> = SchemaComponentType<`dumbo:${Kind}`>;
460
+ declare const schemaComponent: <const ComponentKey extends string = string>(key: ComponentKey, options: SchemaComponentOptions) => SchemaComponent<ComponentKey>;
461
+ declare const isSchemaComponentOfType: <SchemaComponentOfType extends AnySchemaComponent = AnySchemaComponent>(component: AnySchemaComponent, prefix: string) => component is SchemaComponentOfType;
462
+ declare const filterSchemaComponentsOfType: <T extends AnySchemaComponent>(components: ReadonlyMap<string, AnySchemaComponent>, prefix: string) => ReadonlyMap<string, T>;
463
+ declare const mapSchemaComponentsOfType: <T extends AnySchemaComponent>(components: ReadonlyMap<string, AnySchemaComponent>, prefix: string, keyMapper?: (component: T) => string) => ReadonlyMap<string, T>;
464
+ declare const findSchemaComponentsOfType: <T extends AnySchemaComponent>(root: AnySchemaComponent, prefix: string) => T[];
465
+ //#endregion
466
+ //#region src/core/schema/dumboSchema/dumboSchema.d.ts
467
+ declare const DEFAULT_DATABASE_SCHEMA_NAME = "__default_database_schema__";
468
+ declare function dumboDatabaseSchema<const Tables extends DatabaseSchemaTables = DatabaseSchemaTables>(tables: Tables): DatabaseSchemaSchemaComponent<Tables, typeof DEFAULT_DATABASE_SCHEMA_NAME>;
469
+ declare function dumboDatabaseSchema<const Tables extends DatabaseSchemaTables = DatabaseSchemaTables, const SchemaName extends string = string>(schemaName: SchemaName, tables: Tables, options?: SchemaComponentOptions): DatabaseSchemaSchemaComponent<Tables, SchemaName>;
470
+ declare namespace dumboDatabaseSchema {
471
+ var from: (schemaName: string | undefined, tableNames: string[]) => DatabaseSchemaSchemaComponent;
472
+ var defaultName: string;
473
+ }
474
+ type ValidatedDatabaseSchemaComponent<Schemas extends DatabaseSchemas = DatabaseSchemas> = ValidateDatabaseSchemas<Schemas> extends {
475
+ valid: true;
476
+ } ? DatabaseSchemaComponent<Schemas> : ValidateDatabaseSchemas<Schemas> extends {
477
+ valid: false;
478
+ error: infer E;
479
+ } ? {
480
+ valid: false;
481
+ error: E;
482
+ } : DatabaseSchemaComponent<Schemas>;
483
+ declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(schemas: Schemas): ValidatedDatabaseSchemaComponent<Schemas>;
484
+ declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(schema: DatabaseSchemaSchemaComponent): ValidatedDatabaseSchemaComponent<Schemas>;
485
+ declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(databaseName: string, schemas: Schemas, options?: SchemaComponentOptions): ValidatedDatabaseSchemaComponent<Schemas>;
486
+ declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(databaseName: string, schema: AnyDatabaseSchemaSchemaComponent, options?: SchemaComponentOptions): ValidatedDatabaseSchemaComponent<Schemas>;
487
+ declare namespace dumboDatabase {
488
+ var from: <Schemas extends DatabaseSchemas = DatabaseSchemas>(databaseName: string | undefined, schemaNames: string[]) => ValidatedDatabaseSchemaComponent<Schemas>;
489
+ var defaultName: string;
490
+ }
491
+ declare const dumboSchema: {
492
+ database: typeof dumboDatabase;
493
+ schema: typeof dumboDatabaseSchema;
494
+ table: <const Columns extends TableColumns = TableColumns, const TableName extends string = string, const Relationships extends TableRelationships<keyof Columns & string> = TableRelationships<keyof Columns & string>>(name: TableName, definition: {
495
+ columns?: Columns;
496
+ primaryKey?: TableColumnNames<TableSchemaComponent<Columns, TableName, Relationships>>[];
497
+ relationships?: Relationships;
498
+ indexes?: Record<string, IndexSchemaComponent>;
499
+ } & SchemaComponentOptions) => TableSchemaComponent<Columns, TableName, Relationships>;
500
+ column: <const ColumnType extends AnyColumnTypeToken | string = string | AnyColumnTypeToken, const TOptions extends SchemaComponentOptions & Omit<SQLColumnToken<ColumnType>, "name" | "type" | "sqlTokenType"> = Omit<ColumnSchemaComponentOptions<ColumnType>, "type">, const ColumnName extends string = string>(name: ColumnName, type: ColumnType, options?: TOptions) => ({
501
+ schemaComponentKey: `sc:dumbo:column:${ColumnName}`;
502
+ components: ReadonlyMap<string, SchemaComponent>;
503
+ migrations: ReadonlyArray<SQLMigration>;
504
+ addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
505
+ addMigration: (migration: SQLMigration) => void;
506
+ } & Readonly<{
507
+ columnName: ColumnName;
508
+ }> & {
509
+ sqlTokenType: "SQL_COLUMN";
510
+ } & Omit<{
511
+ name: string;
512
+ type: ColumnType;
513
+ notNull?: false;
514
+ unique?: boolean;
515
+ primaryKey: never;
516
+ default?: ColumnType | SQLToken;
517
+ }, "sqlTokenType"> & (TOptions & {
518
+ type: ColumnType;
519
+ } extends infer T ? T extends TOptions & {
520
+ type: ColumnType;
521
+ } ? T extends {
522
+ notNull: true;
523
+ } | {
524
+ primaryKey: true;
525
+ } ? {
526
+ notNull: true;
527
+ } : {
528
+ notNull?: false;
529
+ } : never : never)) | ({
530
+ schemaComponentKey: `sc:dumbo:column:${ColumnName}`;
531
+ components: ReadonlyMap<string, SchemaComponent>;
532
+ migrations: ReadonlyArray<SQLMigration>;
533
+ addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
534
+ addMigration: (migration: SQLMigration) => void;
535
+ } & Readonly<{
536
+ columnName: ColumnName;
537
+ }> & {
538
+ sqlTokenType: "SQL_COLUMN";
539
+ } & Omit<NullableSQLColumnTokenProps<ColumnType>, "sqlTokenType"> & (TOptions & {
540
+ type: ColumnType;
541
+ } extends infer T_1 ? T_1 extends TOptions & {
542
+ type: ColumnType;
543
+ } ? T_1 extends {
544
+ notNull: true;
545
+ } | {
546
+ primaryKey: true;
547
+ } ? {
548
+ notNull: true;
549
+ } : {
550
+ notNull?: false;
551
+ } : never : never));
552
+ index: (name: string, columnNames: string[], options?: {
553
+ unique?: boolean;
554
+ } & SchemaComponentOptions) => IndexSchemaComponent;
555
+ };
556
+ //#endregion
557
+ //#region src/core/sql/tokenizedSQL/tokenizedSQL.d.ts
558
+ type TokenizedSQL = Readonly<{
559
+ __brand: 'tokenized-sql';
560
+ sqlChunks: ReadonlyArray<string>;
561
+ sqlTokens: ReadonlyArray<AnySQLToken>;
562
+ }>;
563
+ declare const TokenizedSQL: {
564
+ (strings: ReadonlyArray<string>, values: unknown[]): TokenizedSQL;
565
+ paramPlaceholder: string;
566
+ empty: {
567
+ __brand: "tokenized-sql";
568
+ sqlChunks: string[];
569
+ sqlTokens: never[];
570
+ };
571
+ };
572
+ declare const isTokenizedSQL: (value: unknown) => value is TokenizedSQL;
573
+ //#endregion
423
574
  //#region src/core/sql/sql.d.ts
575
+ /** A tokenized SQL statement created with the {@link SQL} template tag. */
424
576
  type SQL = string & {
425
577
  __brand: 'sql';
426
578
  };
427
- declare function SQL(strings: TemplateStringsArray, ...values: unknown[]): SQL;
428
- declare namespace SQL {
429
- export var EMPTY: SQL;
430
- export var concat: (...sqls: SQL[]) => SQL;
431
- export var merge: (sqls: SQL[], separator?: string) => SQL;
432
- export var format: (sql: SQL | SQL[], formatter: SQLFormatter, options?: FormatSQLOptions) => ParametrizedSQL;
433
- export var describe: (sql: SQL | SQL[], formatter: SQLFormatter, options?: FormatSQLOptions) => string;
434
- var _a: (column: string, values: unknown[], options?: {
579
+ type SQLTag = {
580
+ /**
581
+ * Creates a tokenized SQL statement.
582
+ *
583
+ * Interpolated values are treated as bound parameters by default. Use the
584
+ * helper methods on `SQL` for SQL syntax that cannot be represented as a bound
585
+ * parameter, such as identifiers or trusted raw fragments.
586
+ */
587
+ (strings: TemplateStringsArray, ...values: unknown[]): SQL; /** Empty SQL statement used when optional query fragments are absent. */
588
+ EMPTY: SQL; /** Concatenates SQL fragments without adding a separator. */
589
+ concat: (...sqls: SQL[]) => SQL;
590
+ /**
591
+ * Merges SQL fragments, skipping empty fragments and inserting a separator
592
+ * between non-empty fragments.
593
+ */
594
+ merge: (sqls: SQL[], separator?: string) => SQL; /** Formats SQL into a parametrized query and params using the selected formatter. */
595
+ format: (sql: SQL | SQL[], formatter: SQLFormatter, options?: FormatSQLOptions) => ParametrizedSQL; /** Formats SQL into a readable SQL string for diagnostics and migrations. */
596
+ describe: (sql: SQL | SQL[], formatter: SQLFormatter, options?: FormatSQLOptions) => string; /** Creates a SQL `IN`/native-array token for the provided column and values. */
597
+ in: (column: string, values: unknown[], options?: {
435
598
  mode?: SQLArrayMode;
436
- }) => SQLIn;
437
- export var array: (values: unknown[], options?: {
599
+ }) => SQLIn; /** Creates an array token that formatters can render as native or expanded params. */
600
+ array: (values: unknown[], options?: {
438
601
  mode?: SQLArrayMode;
439
- }) => SQLArray;
440
- export var identifier: (input: string) => SQLIdentifier;
441
- export var plain: (input: string) => SQLPlain;
442
- export var check: {
602
+ }) => SQLArray; /** Creates a SQL identifier token, quoting it when required by SQL rules. */
603
+ identifier: typeof SQLIdentifier.from;
604
+ /**
605
+ * Creates a trusted raw SQL fragment.
606
+ *
607
+ * This does not quote, escape, or bind the value. Prefer bound parameters for
608
+ * data values, `SQL.identifier` for identifiers, and `SQL.literal` only when
609
+ * SQL syntax requires an inline value literal.
610
+ */
611
+ plain: typeof SQLPlain.from;
612
+ /**
613
+ * Creates an inline SQL value literal.
614
+ *
615
+ * Use this for SQL syntax positions that cannot use bound parameters. Data
616
+ * values in ordinary queries should stay as template interpolations.
617
+ */
618
+ literal: (value: string) => SQLPlain; /** Type guards and helpers for SQL tokens. */
619
+ check: {
443
620
  isSQL: (value: unknown) => value is SQL;
444
- isTokenizedSQL: (value: unknown) => value is Readonly<{
445
- __brand: "tokenized-sql";
446
- sqlChunks: ReadonlyArray<string>;
447
- sqlTokens: ReadonlyArray<AnySQLToken>;
448
- }>;
621
+ isTokenizedSQL: (value: unknown) => value is TokenizedSQL;
449
622
  isEmpty: (sql: SQL) => boolean;
450
- isIdentifier: (token: unknown) => token is SQLIdentifier;
451
- isPlain: (token: unknown) => token is SQLPlain;
452
- isSQLIn: (token: unknown) => token is SQLIn;
453
- };
454
- export var column: ((input: Omit<SQLColumnToken<string | AnyColumnTypeToken>, "sqlTokenType">) => SQLColumnToken<string | AnyColumnTypeToken>) & {
455
- type: typeof SQLColumnTypeTokensFactory;
623
+ isIdentifier: typeof SQLIdentifier.check;
624
+ isPlain: typeof SQLPlain.check;
625
+ isSQLIn: typeof SQLIn.check;
626
+ }; /** Creates a schema column token for SQL generation. */
627
+ column: typeof SQLColumnToken.from & {
628
+ /** Column type token factory. */type: typeof SQLColumnTypeTokensFactory;
629
+ }; /** Creates a schema column token using Dumbo schema metadata. */
630
+ columnN: typeof dumboSchema.column & {
631
+ /** Column type token factory. */type: typeof SQLColumnTypeTokensFactory;
456
632
  };
457
- export { _a as in };
458
- }
633
+ };
634
+ /**
635
+ * Creates SQL by interpolating values directly into the statement.
636
+ *
637
+ * Prefer {@link SQL} for query execution. `RawSQL` is for trusted SQL text that
638
+ * is already safe to inline.
639
+ */
459
640
  declare function RawSQL(strings: TemplateStringsArray, ...values: unknown[]): SQL;
641
+ /** Returns true when the value is a tokenized SQL statement. */
460
642
  declare const isSQL: (value: unknown) => value is SQL;
643
+ declare const SQL: SQLTag;
461
644
  //#endregion
462
645
  //#region src/core/sql/formatters/sqlFormatter.d.ts
463
646
  type FormatContext = Partial<SQLProcessorContext> & Pick<SQLProcessorContext, 'serializer'>;
@@ -489,44 +672,13 @@ declare const getFormatter: (dialect: string) => SQLFormatter;
489
672
  declare function formatSQL(sql: SQL | SQL[], formatter: SQLFormatter, serializer: JSONSerializer, context?: FormatSQLOptions): ParametrizedSQL;
490
673
  declare const describeSQL: (sql: SQL | SQL[], formatter: SQLFormatter, serializer: JSONSerializer, options?: FormatSQLOptions) => string;
491
674
  //#endregion
492
- //#region src/core/schema/sqlMigration.d.ts
493
- type MigrationStyle = 'None' | 'CreateOrUpdate';
494
- type SQLMigration = {
495
- name: string;
496
- sqls: SQL[];
497
- };
498
- declare const sqlMigration: (name: string, sqls: SQL[]) => SQLMigration;
499
- type MigrationRecord = {
500
- id: number;
501
- name: string;
502
- application: string;
503
- sqlHash: string;
504
- timestamp: Date;
675
+ //#region src/core/sql/parameters/jsonParam.d.ts
676
+ declare const JSONParam: {
677
+ readonly arrayContaining: (jsonValue: unknown, serializer: JSONSerializer) => string;
678
+ readonly document: (document: unknown, serializer: JSONSerializer) => string;
679
+ readonly value: (jsonValue: unknown, serializer: JSONSerializer) => string;
505
680
  };
506
681
  //#endregion
507
- //#region src/core/schema/schemaComponent.d.ts
508
- type SchemaComponent<ComponentKey extends string = string, AdditionalData extends Exclude<Record<string, unknown>, 'schemaComponentKey' | 'components' | 'migrations' | 'addComponent' | 'addMigration'> | undefined = undefined> = {
509
- schemaComponentKey: ComponentKey;
510
- components: ReadonlyMap<string, SchemaComponent>;
511
- migrations: ReadonlyArray<SQLMigration>;
512
- addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
513
- addMigration: (migration: SQLMigration) => void;
514
- } & Exclude<AdditionalData extends undefined ? {} : AdditionalData, 'schemaComponentKey' | 'components' | 'migrations' | 'addComponent' | 'addMigration'>;
515
- type ExtractAdditionalData<T> = T extends SchemaComponent<infer _ComponentType, infer Data> ? Data : never;
516
- type AnySchemaComponent = SchemaComponent<string, Record<string, any>>;
517
- type AnySchemaComponentOfType<ComponentType extends string = string> = SchemaComponent<ComponentType, any>;
518
- type SchemaComponentOptions<AdditionalOptions extends Record<string, unknown> = Record<string, unknown>> = {
519
- migrations?: ReadonlyArray<SQLMigration>;
520
- components?: ReadonlyArray<SchemaComponent>;
521
- } & Omit<AdditionalOptions, 'migrations' | 'components'>;
522
- type SchemaComponentType<Kind extends string = string> = `sc:${Kind}`;
523
- type DumboSchemaComponentType<Kind extends string = string> = SchemaComponentType<`dumbo:${Kind}`>;
524
- declare const schemaComponent: <const ComponentKey extends string = string>(key: ComponentKey, options: SchemaComponentOptions) => SchemaComponent<ComponentKey>;
525
- declare const isSchemaComponentOfType: <SchemaComponentOfType extends AnySchemaComponent = AnySchemaComponent>(component: AnySchemaComponent, prefix: string) => component is SchemaComponentOfType;
526
- declare const filterSchemaComponentsOfType: <T extends AnySchemaComponent>(components: ReadonlyMap<string, AnySchemaComponent>, prefix: string) => ReadonlyMap<string, T>;
527
- declare const mapSchemaComponentsOfType: <T extends AnySchemaComponent>(components: ReadonlyMap<string, AnySchemaComponent>, prefix: string, keyMapper?: (component: T) => string) => ReadonlyMap<string, T>;
528
- declare const findSchemaComponentsOfType: <T extends AnySchemaComponent>(root: AnySchemaComponent, prefix: string) => T[];
529
- //#endregion
530
682
  //#region src/core/schema/components/columnSchemaComponent.d.ts
531
683
  type ColumnURNType = 'sc:dumbo:column';
532
684
  type ColumnURN<ColumnName extends string = string> = `${ColumnURNType}:${ColumnName}`;
@@ -1058,6 +1210,25 @@ type QueryResult<Result extends QueryResultRow = QueryResultRow> = {
1058
1210
  rows: Result[];
1059
1211
  };
1060
1212
  //#endregion
1213
+ //#region src/core/query/mappers.d.ts
1214
+ declare const mapRows: <Result extends QueryResultRow = QueryResultRow, Mapped = unknown>(getResult: Promise<QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
1215
+ declare const toCamelCase: (snakeStr: string) => string;
1216
+ declare const mapToCamelCase: <T extends Record<string, unknown>>(obj: Record<string, unknown>) => T;
1217
+ //#endregion
1218
+ //#region src/core/query/selectors.d.ts
1219
+ declare const firstOrNull: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result | null>;
1220
+ declare const first: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result>;
1221
+ declare const singleOrNull: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result | null>;
1222
+ declare const single: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result>;
1223
+ type CountSQLQueryResult = {
1224
+ count: number;
1225
+ };
1226
+ declare const count: (getResult: Promise<QueryResult<CountSQLQueryResult>>) => Promise<number>;
1227
+ type ExistsSQLQueryResult = {
1228
+ exists: boolean | 1 | 0;
1229
+ };
1230
+ declare const exists: (getResult: Promise<QueryResult<ExistsSQLQueryResult>>) => Promise<boolean>;
1231
+ //#endregion
1061
1232
  //#region src/core/execute/execute.d.ts
1062
1233
  declare const mapColumnToJSON: (column: string, serializer: JSONSerializer, options?: JSONDeserializeOptions) => {
1063
1234
  [x: string]: (value: unknown) => unknown;
@@ -1084,6 +1255,8 @@ type BatchSQLCommandOptions = SQLCommandOptions & {
1084
1255
  assertChanges?: boolean;
1085
1256
  };
1086
1257
  declare class BatchCommandNoChangesError extends DumboError {
1258
+ static readonly ErrorCode: number;
1259
+ static readonly ErrorType: string;
1087
1260
  readonly statementIndex: number;
1088
1261
  constructor(statementIndex: number);
1089
1262
  }
@@ -1173,97 +1346,6 @@ declare const resolveDatabaseMetadata: (driverType: DatabaseDriverType, driverOv
1173
1346
  declare const getDefaultDatabase: (driverType: DatabaseDriverType) => string | undefined;
1174
1347
  declare const getDefaultDatabaseAsync: (driverType: DatabaseDriverType) => Promise<string | undefined>;
1175
1348
  //#endregion
1176
- //#region src/core/schema/dumboSchema/dumboSchema.d.ts
1177
- declare const DEFAULT_DATABASE_SCHEMA_NAME = "__default_database_schema__";
1178
- declare function dumboDatabaseSchema<const Tables extends DatabaseSchemaTables = DatabaseSchemaTables>(tables: Tables): DatabaseSchemaSchemaComponent<Tables, typeof DEFAULT_DATABASE_SCHEMA_NAME>;
1179
- declare function dumboDatabaseSchema<const Tables extends DatabaseSchemaTables = DatabaseSchemaTables, const SchemaName extends string = string>(schemaName: SchemaName, tables: Tables, options?: SchemaComponentOptions): DatabaseSchemaSchemaComponent<Tables, SchemaName>;
1180
- declare namespace dumboDatabaseSchema {
1181
- var from: (schemaName: string | undefined, tableNames: string[]) => DatabaseSchemaSchemaComponent;
1182
- var defaultName: string;
1183
- }
1184
- type ValidatedDatabaseSchemaComponent<Schemas extends DatabaseSchemas = DatabaseSchemas> = ValidateDatabaseSchemas<Schemas> extends {
1185
- valid: true;
1186
- } ? DatabaseSchemaComponent<Schemas> : ValidateDatabaseSchemas<Schemas> extends {
1187
- valid: false;
1188
- error: infer E;
1189
- } ? {
1190
- valid: false;
1191
- error: E;
1192
- } : DatabaseSchemaComponent<Schemas>;
1193
- declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(schemas: Schemas): ValidatedDatabaseSchemaComponent<Schemas>;
1194
- declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(schema: DatabaseSchemaSchemaComponent): ValidatedDatabaseSchemaComponent<Schemas>;
1195
- declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(databaseName: string, schemas: Schemas, options?: SchemaComponentOptions): ValidatedDatabaseSchemaComponent<Schemas>;
1196
- declare function dumboDatabase<Schemas extends DatabaseSchemas = DatabaseSchemas>(databaseName: string, schema: AnyDatabaseSchemaSchemaComponent, options?: SchemaComponentOptions): ValidatedDatabaseSchemaComponent<Schemas>;
1197
- declare namespace dumboDatabase {
1198
- var from: <Schemas extends DatabaseSchemas = DatabaseSchemas>(databaseName: string | undefined, schemaNames: string[]) => ValidatedDatabaseSchemaComponent<Schemas>;
1199
- var defaultName: string;
1200
- }
1201
- declare const dumboSchema: {
1202
- database: typeof dumboDatabase;
1203
- schema: typeof dumboDatabaseSchema;
1204
- table: <const Columns extends TableColumns = TableColumns, const TableName extends string = string, const Relationships extends TableRelationships<keyof Columns & string> = TableRelationships<keyof Columns & string>>(name: TableName, definition: {
1205
- columns?: Columns;
1206
- primaryKey?: TableColumnNames<TableSchemaComponent<Columns, TableName, Relationships>>[];
1207
- relationships?: Relationships;
1208
- indexes?: Record<string, IndexSchemaComponent>;
1209
- } & SchemaComponentOptions) => TableSchemaComponent<Columns, TableName, Relationships>;
1210
- column: <const ColumnType extends AnyColumnTypeToken | string = string | AnyColumnTypeToken, const TOptions extends SchemaComponentOptions & Omit<SQLColumnToken<ColumnType>, "name" | "type" | "sqlTokenType"> = Omit<ColumnSchemaComponentOptions<ColumnType>, "type">, const ColumnName extends string = string>(name: ColumnName, type: ColumnType, options?: TOptions) => ({
1211
- schemaComponentKey: `sc:dumbo:column:${ColumnName}`;
1212
- components: ReadonlyMap<string, SchemaComponent>;
1213
- migrations: ReadonlyArray<SQLMigration>;
1214
- addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
1215
- addMigration: (migration: SQLMigration) => void;
1216
- } & Readonly<{
1217
- columnName: ColumnName;
1218
- }> & {
1219
- sqlTokenType: "SQL_COLUMN";
1220
- } & Omit<{
1221
- name: string;
1222
- type: ColumnType;
1223
- notNull?: false;
1224
- unique?: boolean;
1225
- primaryKey: never;
1226
- default?: ColumnType | SQLToken;
1227
- }, "sqlTokenType"> & (TOptions & {
1228
- type: ColumnType;
1229
- } extends infer T ? T extends TOptions & {
1230
- type: ColumnType;
1231
- } ? T extends {
1232
- notNull: true;
1233
- } | {
1234
- primaryKey: true;
1235
- } ? {
1236
- notNull: true;
1237
- } : {
1238
- notNull?: false;
1239
- } : never : never)) | ({
1240
- schemaComponentKey: `sc:dumbo:column:${ColumnName}`;
1241
- components: ReadonlyMap<string, SchemaComponent>;
1242
- migrations: ReadonlyArray<SQLMigration>;
1243
- addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
1244
- addMigration: (migration: SQLMigration) => void;
1245
- } & Readonly<{
1246
- columnName: ColumnName;
1247
- }> & {
1248
- sqlTokenType: "SQL_COLUMN";
1249
- } & Omit<NullableSQLColumnTokenProps<ColumnType>, "sqlTokenType"> & (TOptions & {
1250
- type: ColumnType;
1251
- } extends infer T_1 ? T_1 extends TOptions & {
1252
- type: ColumnType;
1253
- } ? T_1 extends {
1254
- notNull: true;
1255
- } | {
1256
- primaryKey: true;
1257
- } ? {
1258
- notNull: true;
1259
- } : {
1260
- notNull?: false;
1261
- } : never : never));
1262
- index: (name: string, columnNames: string[], options?: {
1263
- unique?: boolean;
1264
- } & SchemaComponentOptions) => IndexSchemaComponent;
1265
- };
1266
- //#endregion
1267
1349
  //#region src/core/locks/databaseLock.d.ts
1268
1350
  type DatabaseLockOptions = {
1269
1351
  lockId: number;
@@ -1524,6 +1606,28 @@ type CreateConnectionPoolOptions<ConnectionType extends AnyConnection> = Pick<Co
1524
1606
  };
1525
1607
  declare const createConnectionPool: <ConnectionType extends AnyConnection>(pool: CreateConnectionPoolOptions<ConnectionType>) => ConnectionPool<ConnectionType>;
1526
1608
  //#endregion
1609
+ //#region src/core/testing/typesTesting.d.ts
1610
+ type Expect<T extends true> = T;
1611
+ type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
1612
+ type IsError<T> = T extends AnyTypeValidationError ? true : false;
1613
+ type IsOK<T> = T extends TypeValidationSuccess ? true : false;
1614
+ //#endregion
1615
+ //#region src/core/tracing/printing/color.d.ts
1616
+ declare const color: {
1617
+ level: 0 | 1;
1618
+ hex: (value: string) => (text: string) => string;
1619
+ red: (value: string) => string;
1620
+ green: (value: string) => string;
1621
+ blue: (value: string) => string;
1622
+ cyan: (value: string) => string;
1623
+ yellow: (value: string) => string;
1624
+ };
1625
+ //#endregion
1626
+ //#region src/core/tracing/printing/pretty.d.ts
1627
+ declare const prettyJson: (obj: unknown, options?: {
1628
+ handleMultiline?: boolean;
1629
+ }) => string;
1630
+ //#endregion
1527
1631
  //#region src/core/tracing/index.d.ts
1528
1632
  declare const tracer: {
1529
1633
  (): void;
@@ -1553,13 +1657,6 @@ type DumboConnectionOptions<DatabaseDriver extends AnyDumboDatabaseDriver = AnyD
1553
1657
  driver?: DatabaseDriver;
1554
1658
  driverType?: DatabaseDriver['driverType'];
1555
1659
  } & Omit<Options, 'driver' | 'driverType' | 'connectionString'> : never : never;
1556
- declare module './sql' {
1557
- namespace SQL {
1558
- const columnN: typeof dumboSchema.column & {
1559
- type: typeof SQLColumnTypeTokensFactory;
1560
- };
1561
- }
1562
- }
1563
1660
  //#endregion
1564
1661
  //#region src/storage/all/connections/connectionString.d.ts
1565
1662
  type DatabaseConnectionString<DatabaseTypeName extends DatabaseType = DatabaseType, Format extends string = string> = Format & {
@@ -1581,5 +1678,5 @@ declare function dumbo<DatabaseDriver extends AnyDumboDatabaseDriver = AnyDumboD
1581
1678
  driver?: never;
1582
1679
  }): ExtractDumboTypeFromDriver<DatabaseDriver>;
1583
1680
  //#endregion
1584
- export { transactionFactoryWithAsyncAmbientConnection as $, JSONCodecOptions as $a, mapDefaultSQLColumnProcessors as $i, ValidateTable as $n, NormalizeColumnPath as $r, executeInNewConnection as $t, CreateAmbientConnectionOptions as A, SQLColumnToken as Aa, mapSchemaComponentsOfType as Ai, CollectReferencesErrors as An, InferDatabaseSchemas as Ar, DatabaseLockOptions as At, WithConnectionOptions as B, SQLArrayMode as Ba, describeSQL as Bi, SchemaTablesWithSingle as Bn, AllColumnTypesInSchema as Br, getDefaultDatabase as Bt, createConnectionPool as C, JSONValueType as Ca, ExtractAdditionalData as Ci, NotNullViolationError as Cn, InferTableSchemaComponentTypes as Cr, combineMigrations as Ct, Connection as D, JavaScriptValueTypeToNameMap as Da, filterSchemaComponentsOfType as Di, TransientDatabaseError as Dn, TableURNType as Dr, AcquireDatabaseLockMode as Dt, AnyConnection as E, JavaScriptValueTypeName as Ea, SchemaComponentType as Ei, SystemError as En, TableURN as Er, runSQLMigrations as Et, InferDriverTypeFromConnection as F, TimestamptzToken as Fa, sqlMigration as Fi, DatabaseSchemasWithSingle as Fn, TableRowType as Fr, DatabaseCapabilities as Ft, AnyDatabaseTransaction as G, SQLLiteral as Ga, SQL as Gi, ValidateDatabaseSchemas as Gn, ColumnPath as Gr, DbSQLExecutor as Gt, createConnection as H, SQLDefaultTokensTypes as Ha, getFormatter as Hi, ValidateColumnTypeMatch as Hn, AnyTableRelationshipDefinition as Hr, resolveDatabaseMetadata as Ht, InferTransactionFromConnection as I, VarcharToken as Ia, FormatContext as Ii, NoError as In, Writable as Ir, DatabaseMetadata as It, InferTransactionOptionsFromTransaction as J, ParametrizedSQL as Ja, ExpandArrayProcessor as Ji, ValidateReferences as Jn, ExtractColumnNames as Jr, SQLExecutor as Jt, DatabaseTransaction as K, SQLPlain as Ka, isSQL as Ki, ValidateDatabaseSchemasWithMessages as Kn, ColumnPathToReference as Kr, DbSQLExecutorOptions as Kt, InferTransactionOptionsFromConnection as L, AnySQLToken as La, FormatSQLOptions as Li, RelationshipColumnsMismatchError as Ln, AllColumnReferences as Lr, DumboDatabaseMetadataRegistry as Lt, CreateSingletonConnectionOptions as M, SQLColumnTypeTokensFactory as Ma, MigrationRecord as Mi, ColumnReferenceError as Mn, InferTableRow as Mr, ReleaseDatabaseLockOptions as Mt, CreateTransientConnectionOptions as N, SerialToken as Na, MigrationStyle as Ni, ColumnReferenceExistanceError as Nn, TableColumnNames as Nr, defaultDatabaseLockOptions as Nt, ConnectionFactory as O, NotNullableSQLColumnTokenProps as Oa, findSchemaComponentsOfType as Oi, UniqueConstraintError as On, tableSchemaComponent as Or, AcquireDatabaseLockOptions as Ot, InferDbClientFromConnection as P, TimestampToken as Pa, SQLMigration as Pi, ColumnReferenceTypeMismatchError as Pn, TableColumnType as Pr, dumboSchema as Pt, transactionFactoryWithAmbientConnection as Q, JSONCodec as Qa, DefaultSQLColumnProcessors as Qi, ValidateSchemaTables as Qn, LookupColumnType as Qr, executeInAmbientConnection as Qt, InitTransaction as R, ExtractSQLTokenType as Ra, SQLFormatter as Ri, RelationshipReferencesLengthMismatchError as Rn, AllColumnReferencesInSchema as Rr, dumboDatabaseMetadataRegistry as Rt, createBoundedConnectionPool as S, JSONBToken as Sa, DumboSchemaComponentType as Si, LockNotAvailableError as Sn, InferTableSchemaComponentColumns as Sr, RunSQLMigrationsResult as St, createSingletonConnectionPool as T, JavaScriptValueType as Ta, SchemaComponentOptions as Ti, SerializationError as Tn, TableSchemaComponent as Tr, registerDefaultMigratorOptions as Tt, createSingletonConnection as U, SQLIdentifier as Ua, registerFormatter as Ui, ValidateColumnsMatch as Un, AnyTableRelationshipDefinitionWithColumns as Ur, BatchCommandNoChangesError as Ut, createAmbientConnection as V, SQLDefaultTokens as Va, formatSQL as Vi, ValidateColumnReference as Vn, AnyRelationshipDefinition as Vr, getDefaultDatabaseAsync as Vt, createTransientConnection as W, SQLIn as Wa, RawSQL as Wi, ValidateDatabaseSchema as Wn, ColumnName$1 as Wr, BatchSQLCommandOptions as Wt, WithDatabaseTransactionFactory as X, SerializationCodec as Xa, FormatIdentifierProcessor as Xi, ValidateRelationshipColumns as Xn, ExtractSchemaNames as Xr, SQLQueryResultColumnMapping as Xt, TransactionResult as Y, ParametrizedSQLBuilder as Ya, ExpandSQLInProcessor as Yi, ValidateRelationship as Yn, ExtractColumnTypeName as Yr, SQLQueryOptions as Yt, executeInTransaction as Z, Serializer as Za, MapLiteralProcessor as Zi, ValidateRelationshipLength as Zn, ExtractTableNames as Zr, WithSQLExecutor as Zt, CreateConnectionPoolOptions as _, BigIntegerToken as _a, ColumnURN as _i, ExclusionViolationError as _n, DatabaseSchemaTables as _r, dumboDatabaseDriverRegistry as _t, parseConnectionString as a, SQLProcessorOptions as aa, TableColumnName as ai, sqlExecutor as an, JSONRevivers as ao, FormatTableLevel as ar, DatabaseType as at, createAlwaysNewConnectionPool as b, DefaultSQLColumnToken as ba, AnySchemaComponent as bi, IntegrityConstraintViolationError as bn, databaseSchemaSchemaComponent as br, MIGRATIONS_LOCK_ID as bt, LogLevel as c, DefaultMapSQLParamValueOptions as ca, AnyTypeValidationError as ci, QueryResult as cn, JSONSerializer as co, Join as cr, getDatabaseDriverName as ct, tracer as d, SQLValueMapper as da, IndexURN as di, CheckViolationError as dn, composeJSONRevivers as do, DatabaseSchemas as dr, AnyDumboDatabaseDriver as dt, SQLProcessorsReadonlyRegistry as ea, NormalizeReference as ei, executeInNewDbClient as en, JSONDeserializeOptions as eo, ValidateTableRelationships as er, transactionFactoryWithDbClient as et, AmbientConnectionPoolOptions as f, mapANSISQLParamPlaceholder as fa, IndexURNType as fi, ConcurrencyError as fn, jsonSerializer as fo, DatabaseURN as fr, DumboDatabaseDriver as ft, CreateBoundedConnectionPoolOptions as g, AutoIncrementSQLColumnToken as ga, ColumnSchemaComponentOptions as gi, DumboError as gn, DatabaseSchemaSchemaComponent as gr, canHandleDriverWithConnectionString as gt, CreateAlwaysNewConnectionPoolOptions as h, AnyColumnTypeToken as ha, ColumnSchemaComponent as hi, DeadlockError as hn, AnyDatabaseSchemaSchemaComponent as hr, ExtractDumboTypeFromDriver as ht, DatabaseConnectionString as i, SQLProcessorContext as ia, SchemaColumnName as ii, mapSQLQueryResult as in, JSONReviverContext as io, FormatSingleError as ir, DatabaseDriverTypeParts as it, CreateConnectionOptions as j, SQLColumnTypeTokens as ja, schemaComponent as ji, CollectRelationshipErrors as jn, InferSchemaTables as jr, NoDatabaseLock as jt, ConnectionOptions as k, NullableSQLColumnTokenProps as ka, isSchemaComponentOfType as ki, schemaComponentURN as kn, InferColumnType as kr, DatabaseLock as kt, LogStyle as l, MapSQLParamValue as la, TypeValidationSuccess as li, QueryResultRow as ln, JSONSerializerOptions as lo, AnyDatabaseSchemaComponent as lr, getDatabaseType as lt, ConnectionPoolFactory as m, mapSQLParamValue as ma, AnyColumnSchemaComponent as mi, DataError as mn, databaseSchemaComponent as mr, ExtractDumboDatabaseDriverOptions as mt, sqliteMetadata as n, AnySQLProcessor as na, RelationshipDefinition as ni, mapColumnToDate as nn, JSONReplacers as no, FormatRelationshipBlock as nr, DatabaseDriverName as nt, Dumbo as o, ANSISQLIdentifierQuote as oa, TableRelationships as oi, sqlExecutorInAmbientConnection as on, JSONSerializationOptions as oo, FormatValidationErrors as or, InferDriverDatabaseType as ot, ConnectionPool as p, mapSQLIdentifier as pa, indexSchemaComponent as pi, ConnectionError as pn, DbClientSetup as po, DatabaseURNType as pr, DumboDatabaseDriverRegistry as pt, DatabaseTransactionOptions as q, SQLToken as qa, defaultProcessorsRegistry as qi, ValidateReference as qn, ColumnReference as qr, SQLCommandOptions as qt, postgreSQLMetadata as r, SQLProcessor as ra, RelationshipType as ri, mapColumnToJSON as rn, JSONReviver as ro, FormatSchemaLevel as rr, DatabaseDriverType as rt, DumboConnectionOptions as s, ANSISQLParamPlaceholder as sa, relationship as si, sqlExecutorInNewConnection as sn, JSONSerializeOptions as so, IndentErrors as sr, fromDatabaseDriverType as st, dumbo as t, SQLProcessorsRegistry as ta, ParseReferencePath as ti, mapColumnToBigint as tn, JSONReplacer as to, FormatDatabaseValidationErrors as tr, transactionFactoryWithNewConnection as tt, LogType as u, MapSQLParamValueOptions as ua, IndexSchemaComponent as ui, AdminShutdownError as un, composeJSONReplacers as uo, DatabaseSchemaComponent as ur, toDatabaseDriverType as ut, SingletonClientConnectionPoolOptions as v, BigSerialToken as va, ColumnURNType as vi, ForeignKeyViolationError as vn, DatabaseSchemaURN as vr, SchemaComponentMigrator as vt, createSingletonClientConnectionPool as w, JSONValueTypeName as wa, SchemaComponent as wi, QueryCanceledError as wn, TableColumns as wr, getDefaultMigratorOptionsFromRegistry as wt, createAmbientConnectionPool as x, IntegerToken as xa, AnySchemaComponentOfType as xi, InvalidOperationError as xn, AnyTableSchemaComponent as xr, MigratorOptions as xt, SingletonConnectionPoolOptions as y, ColumnTypeToken as ya, columnSchemaComponent as yi, InsufficientResourcesError as yn, DatabaseSchemaURNType as yr, migrationTableSchemaComponent as yt, WithConnectionFactory as z, SQLArray as za, SQLFormatterOptions as zi, RelationshipValidationError as zn, AllColumnTypes as zr, getDatabaseMetadata as zt };
1585
- //# sourceMappingURL=index-BDSQvDH2.d.cts.map
1681
+ export { DatabaseTransactionOptions as $, SerialToken as $a, ExtractAdditionalData as $i, RelationshipColumnsMismatchError as $n, AllColumnReferences as $r, SQLExecutor as $t, createSingletonClientConnectionPool as A, SQLValueMapper as Aa, ColumnSchemaComponentOptions as Ai, DataError as An, composeJSONReplacers as Ao, databaseSchemaComponent as Ar, getDefaultMigratorOptionsFromRegistry as At, InferDbClientFromConnection as B, DefaultSQLColumnToken as Ba, formatSQL as Bi, QueryCanceledError as Bn, TableColumns as Br, DatabaseCapabilities as Bt, CreateConnectionPoolOptions as C, SQLProcessorContext as Ca, relationship as Ci, toCamelCase as Cn, JSONReviver as Co, IndentErrors as Cr, dumboDatabaseDriverRegistry as Ct, createAmbientConnectionPool as D, DefaultMapSQLParamValueOptions as Da, indexSchemaComponent as Di, CheckViolationError as Dn, JSONSerializeOptions as Do, DatabaseSchemas as Dr, MigratorOptions as Dt, createAlwaysNewConnectionPool as E, ANSISQLParamPlaceholder as Ea, IndexURNType as Ei, AdminShutdownError as En, JSONSerializationOptions as Eo, DatabaseSchemaComponent as Er, MIGRATIONS_LOCK_ID as Et, ConnectionOptions as F, AnyColumnTypeToken as Fa, FormatContext as Fi, InsufficientResourcesError as Fn, DatabaseSchemaURNType as Fr, DatabaseLock as Ft, WithConnectionFactory as G, JavaScriptValueType as Ga, SQLTag as Gi, schemaComponentURN as Gn, InferColumnType as Gr, getDefaultDatabase as Gt, InferTransactionFromConnection as H, JSONBToken as Ha, registerFormatter as Hi, SystemError as Hn, TableURN as Hr, DumboDatabaseMetadataRegistry as Ht, CreateAmbientConnectionOptions as I, AutoIncrementSQLColumnToken as Ia, FormatSQLOptions as Ii, IntegrityConstraintViolationError as In, databaseSchemaSchemaComponent as Ir, DatabaseLockOptions as It, createConnection as J, NotNullableSQLColumnTokenProps as Ja, isTokenizedSQL as Ji, ColumnReferenceError as Jn, InferTableRow as Jr, BatchCommandNoChangesError as Jt, WithConnectionOptions as K, JavaScriptValueTypeName as Ka, isSQL as Ki, CollectReferencesErrors as Kn, InferDatabaseSchemas as Kr, getDefaultDatabaseAsync as Kt, CreateConnectionOptions as L, BigIntegerToken as La, SQLFormatter as Li, InvalidOperationError as Ln, AnyTableSchemaComponent as Lr, NoDatabaseLock as Lt, AnyConnection as M, mapSQLIdentifier as Ma, ColumnURNType as Mi, DumboError as Mn, jsonSerializer as Mo, DatabaseSchemaSchemaComponent as Mr, runSQLMigrations as Mt, Connection as N, mapSQLParamValue as Na, columnSchemaComponent as Ni, ExclusionViolationError as Nn, DbClientSetup as No, DatabaseSchemaTables as Nr, AcquireDatabaseLockMode as Nt, createBoundedConnectionPool as O, MapSQLParamValue as Oa, AnyColumnSchemaComponent as Oi, ConcurrencyError as On, JSONSerializer as Oo, DatabaseURN as Or, RunSQLMigrationsResult as Ot, ConnectionFactory as P, ansiSqlReservedMap as Pa, JSONParam as Pi, ForeignKeyViolationError as Pn, DatabaseSchemaURN as Pr, AcquireDatabaseLockOptions as Pt, DatabaseTransaction as Q, SQLColumnTypeTokensFactory as Qa, DumboSchemaComponentType as Qi, NoError as Qn, Writable as Qr, SQLCommandOptions as Qt, CreateSingletonConnectionOptions as R, BigSerialToken as Ra, SQLFormatterOptions as Ri, LockNotAvailableError as Rn, InferTableSchemaComponentColumns as Rr, ReleaseDatabaseLockOptions as Rt, CreateBoundedConnectionPoolOptions as S, SQLProcessor as Sa, TableRelationships as Si, mapToCamelCase as Sn, JSONReplacers as So, FormatValidationErrors as Sr, canHandleDriverWithConnectionString as St, SingletonConnectionPoolOptions as T, ANSISQLIdentifierQuote as Ta, IndexURN as Ti, QueryResultRow as Tn, JSONRevivers as To, AnyDatabaseSchemaComponent as Tr, migrationTableSchemaComponent as Tt, InferTransactionOptionsFromConnection as U, JSONValueType as Ua, RawSQL as Ui, TransientDatabaseError as Un, TableURNType as Ur, dumboDatabaseMetadataRegistry as Ut, InferDriverTypeFromConnection as V, IntegerToken as Va, getFormatter as Vi, SerializationError as Vn, TableSchemaComponent as Vr, DatabaseMetadata as Vt, InitTransaction as W, JSONValueTypeName as Wa, SQL as Wi, UniqueConstraintError as Wn, tableSchemaComponent as Wr, getDatabaseMetadata as Wt, createTransientConnection as X, SQLColumnToken as Xa, AnySchemaComponent as Xi, ColumnReferenceTypeMismatchError as Xn, TableColumnType as Xr, DbSQLExecutor as Xt, createSingletonConnection as Y, NullableSQLColumnTokenProps as Ya, dumboSchema as Yi, ColumnReferenceExistanceError as Yn, TableColumnNames as Yr, BatchSQLCommandOptions as Yt, AnyDatabaseTransaction as Z, SQLColumnTypeTokens as Za, AnySchemaComponentOfType as Zi, DatabaseSchemasWithSingle as Zn, TableRowType as Zr, DbSQLExecutorOptions as Zt, IsOK as _, DefaultSQLColumnProcessors as _a, ParseReferencePath as _i, first as _n, Serializer as _o, FormatDatabaseValidationErrors as _r, AnyDumboDatabaseDriver as _t, parseConnectionString as a, isSchemaComponentOfType as aa, AnyTableRelationshipDefinitionWithColumns as ai, executeInNewDbClient as an, SQLArray as ao, ValidateColumnsMatch as ar, transactionFactoryWithAsyncAmbientConnection as at, ConnectionPoolFactory as b, SQLProcessorsRegistry as ba, SchemaColumnName as bi, singleOrNull as bn, JSONDeserializeOptions as bo, FormatSingleError as br, ExtractDumboDatabaseDriverOptions as bt, LogLevel as c, MigrationRecord as ca, ColumnPathToReference as ci, mapColumnToJSON as cn, SQLDefaultTokensTypes as co, ValidateDatabaseSchemasWithMessages as cr, DatabaseDriverName as ct, tracer as d, sqlMigration as da, ExtractColumnTypeName as di, sqlExecutorInAmbientConnection as dn, SQLLiteral as do, ValidateRelationship as dr, DatabaseType as dt, SchemaComponent as ea, AllColumnReferencesInSchema as ei, SQLQueryOptions as en, TimestampToken as eo, RelationshipReferencesLengthMismatchError as er, InferTransactionOptionsFromTransaction as et, prettyJson as f, defaultProcessorsRegistry as fa, ExtractSchemaNames as fi, sqlExecutorInNewConnection as fn, SQLPlain as fo, ValidateRelationshipColumns as fr, InferDriverDatabaseType as ft, IsError as g, MapLiteralProcessor as ga, NormalizeReference as gi, exists as gn, SerializationCodec as go, ValidateTableRelationships as gr, toDatabaseDriverType as gt, Expect as h, FormatIdentifierProcessor as ha, NormalizeColumnPath as hi, count as hn, ParametrizedSQLBuilder as ho, ValidateTable as hr, getDatabaseType as ht, DatabaseConnectionString as i, findSchemaComponentsOfType as ia, AnyTableRelationshipDefinition as ii, executeInNewConnection as in, ExtractSQLTokenType as io, ValidateColumnTypeMatch as ir, transactionFactoryWithAmbientConnection as it, createSingletonConnectionPool as j, mapANSISQLParamPlaceholder as ja, ColumnURN as ji, DeadlockError as jn, composeJSONRevivers as jo, AnyDatabaseSchemaSchemaComponent as jr, registerDefaultMigratorOptions as jt, createConnectionPool as k, MapSQLParamValueOptions as ka, ColumnSchemaComponent as ki, ConnectionError as kn, JSONSerializerOptions as ko, DatabaseURNType as kr, combineMigrations as kt, LogStyle as l, MigrationStyle as la, ColumnReference as li, mapSQLQueryResult as ln, SQLIdentifier as lo, ValidateReference as lr, DatabaseDriverType as lt, Equals as m, ExpandSQLInProcessor as ma, LookupColumnType as mi, ExistsSQLQueryResult as mn, ParametrizedSQL as mo, ValidateSchemaTables as mr, getDatabaseDriverName as mt, sqliteMetadata as n, SchemaComponentType as na, AllColumnTypesInSchema as ni, WithSQLExecutor as nn, VarcharToken as no, SchemaTablesWithSingle as nr, WithDatabaseTransactionFactory as nt, Dumbo as o, mapSchemaComponentsOfType as oa, ColumnName$1 as oi, mapColumnToBigint as on, SQLArrayMode as oo, ValidateDatabaseSchema as or, transactionFactoryWithDbClient as ot, color as p, ExpandArrayProcessor as pa, ExtractTableNames as pi, CountSQLQueryResult as pn, SQLToken as po, ValidateRelationshipLength as pr, fromDatabaseDriverType as pt, createAmbientConnection as q, JavaScriptValueTypeToNameMap as qa, TokenizedSQL as qi, CollectRelationshipErrors as qn, InferSchemaTables as qr, resolveDatabaseMetadata as qt, postgreSQLMetadata as r, filterSchemaComponentsOfType as ra, AnyRelationshipDefinition as ri, executeInAmbientConnection as rn, AnySQLToken as ro, ValidateColumnReference as rr, executeInTransaction as rt, DumboConnectionOptions as s, schemaComponent as sa, ColumnPath as si, mapColumnToDate as sn, SQLDefaultTokens as so, ValidateDatabaseSchemas as sr, transactionFactoryWithNewConnection as st, dumbo as t, SchemaComponentOptions as ta, AllColumnTypes as ti, SQLQueryResultColumnMapping as tn, TimestamptzToken as to, RelationshipValidationError as tr, TransactionResult as tt, LogType as u, SQLMigration as ua, ExtractColumnNames as ui, sqlExecutor as un, SQLIn as uo, ValidateReferences as ur, DatabaseDriverTypeParts as ut, AmbientConnectionPoolOptions as v, mapDefaultSQLColumnProcessors as va, RelationshipDefinition as vi, firstOrNull as vn, JSONCodec as vo, FormatRelationshipBlock as vr, DumboDatabaseDriver as vt, SingletonClientConnectionPoolOptions as w, SQLProcessorOptions as wa, IndexSchemaComponent as wi, QueryResult as wn, JSONReviverContext as wo, Join as wr, SchemaComponentMigrator as wt, CreateAlwaysNewConnectionPoolOptions as x, AnySQLProcessor as xa, TableColumnName as xi, mapRows as xn, JSONReplacer as xo, FormatTableLevel as xr, ExtractDumboTypeFromDriver as xt, ConnectionPool as y, SQLProcessorsReadonlyRegistry as ya, RelationshipType as yi, single as yn, JSONCodecOptions as yo, FormatSchemaLevel as yr, DumboDatabaseDriverRegistry as yt, CreateTransientConnectionOptions as z, ColumnTypeToken as za, describeSQL as zi, NotNullViolationError as zn, InferTableSchemaComponentTypes as zr, defaultDatabaseLockOptions as zt };
1682
+ //# sourceMappingURL=index-CfH0u2y_.d.cts.map
@@ -1,4 +1,5 @@
1
- import { D as Connection, E as AnyConnection, F as InferDriverTypeFromConnection, Gt as DbSQLExecutor, I as InferTransactionFromConnection, Jt as SQLExecutor, K as DatabaseTransaction, P as InferDbClientFromConnection, R as InitTransaction, Ri as SQLFormatter, Wt as BatchSQLCommandOptions, co as JSONSerializer, gn as DumboError, i as DatabaseConnectionString, k as ConnectionOptions, p as ConnectionPool, q as DatabaseTransactionOptions, qt as SQLCommandOptions, rt as DatabaseDriverType, xt as MigratorOptions } from "./index-zkszkJqP.js";
1
+ import { $ as DatabaseTransactionOptions, $t as SQLExecutor, B as InferDbClientFromConnection, Dt as MigratorOptions, F as ConnectionOptions, H as InferTransactionFromConnection, Li as SQLFormatter, M as AnyConnection, Mn as DumboError, N as Connection, Oo as JSONSerializer, Q as DatabaseTransaction, Qt as SQLCommandOptions, V as InferDriverTypeFromConnection, W as InitTransaction, Xt as DbSQLExecutor, Yt as BatchSQLCommandOptions, fo as SQLPlain, i as DatabaseConnectionString, lt as DatabaseDriverType, y as ConnectionPool } from "./index-CfH0u2y_.cjs";
2
+
2
3
  //#region src/storage/sqlite/core/execute/execute.d.ts
3
4
  type SQLiteErrorMapper = (error: unknown) => DumboError;
4
5
  declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
@@ -176,11 +177,16 @@ declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<
176
177
  //#region src/storage/sqlite/core/sql/formatter/index.d.ts
177
178
  declare const sqliteFormatter: SQLFormatter;
178
179
  //#endregion
180
+ //#region src/storage/sqlite/core/sql/json.d.ts
181
+ declare const SQLiteJSON: {
182
+ readonly path: (path: string) => SQLPlain;
183
+ };
184
+ //#endregion
179
185
  //#region src/storage/sqlite/core/index.d.ts
180
186
  type SQLiteDatabaseName = 'SQLite';
181
187
  declare const SQLiteDatabaseName = "SQLite";
182
188
  type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
183
189
  type SQLiteDatabaseType = 'SQLite';
184
190
  //#endregion
185
- export { SQLitePragmaOptions as $, SQLiteClientConnectionDefinitionOptions as A, SQLiteParameters as B, AnySQLiteConnection as C, InMemorySQLiteDatabase as D, DEFAULT_SQLITE_PRAGMA_OPTIONS as E, SQLiteConnection as F, TransactionNestingCounter as G, SQLitePoolClientConnection as H, SQLiteConnectionDefinitionOptions as I, sqliteClientConnection as J, isSQLiteError as K, SQLiteConnectionFactory as L, SQLiteClientOptions as M, SQLiteClientOrPoolClient as N, SQLiteClient as O, SQLiteCommandOptions as P, SQLiteConnectionString as Q, SQLiteConnectionOptions as R, AnySQLiteClientConnection as S, BatchSQLiteCommandOptions as T, SQLitePoolConnectionDefinitionOptions as U, SQLitePoolClient as V, SqliteAmbientClientConnectionOptions as W, sqlitePoolClientConnection as X, sqliteConnection as Y, transactionNestingCounter as Z, sqliteAmbientConnectionPool as _, defaultSQLiteDatabase as a, SQLiteErrorMapper as at, toSqlitePoolOptions as b, SQLiteAlwaysNewConnectionPool as c, sqliteSQLExecutor as ct, SQLitePool as d, parsePragmasFromConnectionString as et, SQLitePoolFactoryOptions as f, sqliteAlwaysNewConnectionPool as g, isInMemoryDatabase as h, sqliteFormatter as i, sqliteTransaction as it, SQLiteClientFactory as j, SQLiteClientConnection as k, SQLiteAmbientConnectionPool as l, SQLiteSingletonConnectionPool as m, SQLiteDatabaseType as n, SQLiteTransactionMode as nt, tableExists as o, SQLiteSQLExecutor as ot, SQLitePoolOptions as p, sqliteAmbientClientConnection as q, SQLiteDriverType as r, SQLiteTransactionOptions as rt, DefaultSQLiteMigratorOptions as s, sqliteExecute as st, SQLiteDatabaseName as t, SQLiteTransaction as tt, SQLiteFileNameOrConnectionString as u, sqlitePool as v, AnySQLitePoolClientConnection as w, mapSqliteError as x, sqliteSingletonConnectionPool as y, SQLiteError as z };
186
- //# sourceMappingURL=index-BgFHGsuP.d.ts.map
191
+ export { SQLiteConnectionString as $, SQLiteClientConnection as A, SQLiteError as B, AnySQLiteClientConnection as C, DEFAULT_SQLITE_PRAGMA_OPTIONS as D, BatchSQLiteCommandOptions as E, SQLiteCommandOptions as F, SqliteAmbientClientConnectionOptions as G, SQLitePoolClient as H, SQLiteConnection as I, sqliteAmbientClientConnection as J, TransactionNestingCounter as K, SQLiteConnectionDefinitionOptions as L, SQLiteClientFactory as M, SQLiteClientOptions as N, InMemorySQLiteDatabase as O, SQLiteClientOrPoolClient as P, transactionNestingCounter as Q, SQLiteConnectionFactory as R, mapSqliteError as S, AnySQLitePoolClientConnection as T, SQLitePoolClientConnection as U, SQLiteParameters as V, SQLitePoolConnectionDefinitionOptions as W, sqliteConnection as X, sqliteClientConnection as Y, sqlitePoolClientConnection as Z, sqliteAlwaysNewConnectionPool as _, sqliteFormatter as a, sqliteTransaction as at, sqliteSingletonConnectionPool as b, DefaultSQLiteMigratorOptions as c, sqliteExecute as ct, SQLiteFileNameOrConnectionString as d, SQLitePragmaOptions as et, SQLitePool as f, isInMemoryDatabase as g, SQLiteSingletonConnectionPool as h, SQLiteJSON as i, SQLiteTransactionOptions as it, SQLiteClientConnectionDefinitionOptions as j, SQLiteClient as k, SQLiteAlwaysNewConnectionPool as l, sqliteSQLExecutor as lt, SQLitePoolOptions as m, SQLiteDatabaseType as n, SQLiteTransaction as nt, defaultSQLiteDatabase as o, SQLiteErrorMapper as ot, SQLitePoolFactoryOptions as p, isSQLiteError as q, SQLiteDriverType as r, SQLiteTransactionMode as rt, tableExists as s, SQLiteSQLExecutor as st, SQLiteDatabaseName as t, parsePragmasFromConnectionString as tt, SQLiteAmbientConnectionPool as u, sqliteAmbientConnectionPool as v, AnySQLiteConnection as w, toSqlitePoolOptions as x, sqlitePool as y, SQLiteConnectionOptions as z };
192
+ //# sourceMappingURL=index-DP9b7v4e.d.cts.map