@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.
- package/dist/cloudflare.cjs +4 -3
- package/dist/cloudflare.d.cts +3 -3
- package/dist/cloudflare.d.ts +3 -3
- package/dist/cloudflare.js +4 -4
- package/dist/{core-D-smW7cm.cjs → core-BPSzA-lq.cjs} +2091 -2075
- package/dist/core-BPSzA-lq.cjs.map +1 -0
- package/dist/{core-DXCRR5A9.cjs → core-BuSVyamf.cjs} +33 -3
- package/dist/core-BuSVyamf.cjs.map +1 -0
- package/dist/{core-BchvTX3G.js → core-C3xoqqDs.js} +28 -4
- package/dist/core-C3xoqqDs.js.map +1 -0
- package/dist/{core-DlV8ua1P.js → core-CHw8vO17.js} +9 -4
- package/dist/core-CHw8vO17.js.map +1 -0
- package/dist/{core-CWZb0zOY.cjs → core-CUGYxOEQ.cjs} +14 -3
- package/dist/core-CUGYxOEQ.cjs.map +1 -0
- package/dist/{core-BG__WVn6.js → core-IV7or0Mj.js} +2086 -2070
- package/dist/core-IV7or0Mj.js.map +1 -0
- package/dist/{index-N2ly5shv.d.cts → index-BJC_v03L.d.ts} +9 -3
- package/dist/{index-BDSQvDH2.d.cts → index-CfH0u2y_.d.cts} +260 -163
- package/dist/{index-BgFHGsuP.d.ts → index-DP9b7v4e.d.cts} +9 -3
- package/dist/{index-zkszkJqP.d.ts → index-QWEAqtHF.d.ts} +260 -163
- package/dist/{index-BdWFmDhJ.d.cts → index-qxECrBHo.d.ts} +10 -3
- package/dist/{index-cxtbLiju.d.ts → index-tS9lpLPz.d.cts} +10 -3
- package/dist/index.cjs +24 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +24 -13
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +4 -3
- package/dist/pg.d.cts +3 -3
- package/dist/pg.d.ts +3 -3
- package/dist/pg.js +4 -4
- package/dist/{postgreSQLMetadata-WGXySO7a.cjs → postgreSQLMetadata-CCsCJ-eH.cjs} +2 -2
- package/dist/{postgreSQLMetadata-WGXySO7a.cjs.map → postgreSQLMetadata-CCsCJ-eH.cjs.map} +1 -1
- package/dist/{postgreSQLMetadata-BTz6vdwE.js → postgreSQLMetadata-bCBDGz1f.js} +2 -2
- package/dist/{postgreSQLMetadata-BTz6vdwE.js.map → postgreSQLMetadata-bCBDGz1f.js.map} +1 -1
- package/dist/postgresql.cjs +3 -2
- package/dist/postgresql.d.cts +3 -3
- package/dist/postgresql.d.ts +3 -3
- package/dist/postgresql.js +3 -3
- package/dist/sqlite.cjs +3 -2
- package/dist/sqlite.d.cts +3 -3
- package/dist/sqlite.d.ts +3 -3
- package/dist/sqlite.js +3 -3
- package/dist/sqlite3.cjs +4 -3
- package/dist/sqlite3.d.cts +3 -3
- package/dist/sqlite3.d.ts +3 -3
- package/dist/sqlite3.js +4 -4
- package/dist/{sqliteMetadata-PJTRPIZ1.cjs → sqliteMetadata-Cc7Z03lm.cjs} +2 -2
- package/dist/{sqliteMetadata-PJTRPIZ1.cjs.map → sqliteMetadata-Cc7Z03lm.cjs.map} +1 -1
- package/dist/{sqliteMetadata-7qBjsMBN.js → sqliteMetadata-CvvEc1-v.js} +2 -2
- package/dist/{sqliteMetadata-7qBjsMBN.js.map → sqliteMetadata-CvvEc1-v.js.map} +1 -1
- package/package.json +1 -1
- package/dist/core-BG__WVn6.js.map +0 -1
- package/dist/core-BchvTX3G.js.map +0 -1
- package/dist/core-CWZb0zOY.cjs.map +0 -1
- package/dist/core-D-smW7cm.cjs.map +0 -1
- package/dist/core-DXCRR5A9.cjs.map +0 -1
- package/dist/core-DlV8ua1P.js.map +0 -1
- package/dist/index-DaP2fTEX.d.ts +0 -67
- 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
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
-
|
|
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
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
|
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:
|
|
451
|
-
isPlain:
|
|
452
|
-
isSQLIn:
|
|
453
|
-
};
|
|
454
|
-
|
|
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
|
-
|
|
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/
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
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 {
|
|
1585
|
-
//# sourceMappingURL=index-
|
|
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-QWEAqtHF.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as SQLExecutor, Dt as MigratorOptions, Ft as DatabaseLock, It as DatabaseLockOptions, Li as SQLFormatter, Mn as DumboError, Nt as AcquireDatabaseLockMode, Pt as AcquireDatabaseLockOptions, Rt as ReleaseDatabaseLockOptions, Sa as SQLProcessor, Wi as SQL, _a as DefaultSQLColumnProcessors, ao as SQLArray, fo as SQLPlain, i as DatabaseConnectionString, lt as DatabaseDriverType, uo as SQLIn } from "./index-QWEAqtHF.js";
|
|
2
2
|
|
|
3
3
|
//#region src/storage/postgresql/core/connections/connectionString.d.ts
|
|
4
4
|
declare const defaultPostgreSQLConnectionString: PostgreSQLConnectionString;
|
|
@@ -52,6 +52,13 @@ declare const functionExists: (execute: SQLExecutor, functionName: string) => Pr
|
|
|
52
52
|
//#region src/storage/postgresql/core/sql/formatter/index.d.ts
|
|
53
53
|
declare const pgFormatter: SQLFormatter;
|
|
54
54
|
//#endregion
|
|
55
|
+
//#region src/storage/postgresql/core/sql/json.d.ts
|
|
56
|
+
declare const PostgreSQLJSON: {
|
|
57
|
+
readonly field: (source: SQL, path: string) => SQL;
|
|
58
|
+
readonly path: (path: string) => SQLPlain;
|
|
59
|
+
readonly textField: (source: SQL, path: string) => SQL;
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
55
62
|
//#region src/storage/postgresql/core/sql/processors/arrayProcessors.d.ts
|
|
56
63
|
declare const PostgreSQLArrayProcessor: SQLProcessor<SQLArray>;
|
|
57
64
|
declare const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn>;
|
|
@@ -64,5 +71,5 @@ type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
|
64
71
|
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
65
72
|
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
66
73
|
//#endregion
|
|
67
|
-
export {
|
|
68
|
-
//# sourceMappingURL=index-
|
|
74
|
+
export { parseDatabaseName as S, releaseAdvisoryLock as _, PostgreSQLExpandSQLInProcessor as a, PostgreSQLConnectionString as b, defaultPostgreSqlDatabase as c, tableExists as d, tableExistsSQL as f, advisoryLock as g, acquireAdvisoryLock as h, PostgreSQLArrayProcessor as i, functionExists as l, AdvisoryLock as m, PostgreSQLDriverType as n, PostgreSQLJSON as o, DefaultPostgreSQLMigratorOptions as p, postgreSQLColumnProcessors as r, pgFormatter as s, PostgreSQLDatabaseName as t, functionExistsSQL as u, tryAcquireAdvisoryLock as v, defaultPostgreSQLConnectionString as x, mapPostgresError as y };
|
|
75
|
+
//# sourceMappingURL=index-qxECrBHo.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as SQLExecutor, Dt as MigratorOptions, Ft as DatabaseLock, It as DatabaseLockOptions, Li as SQLFormatter, Mn as DumboError, Nt as AcquireDatabaseLockMode, Pt as AcquireDatabaseLockOptions, Rt as ReleaseDatabaseLockOptions, Sa as SQLProcessor, Wi as SQL, _a as DefaultSQLColumnProcessors, ao as SQLArray, fo as SQLPlain, i as DatabaseConnectionString, lt as DatabaseDriverType, uo as SQLIn } from "./index-CfH0u2y_.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/storage/postgresql/core/connections/connectionString.d.ts
|
|
4
4
|
declare const defaultPostgreSQLConnectionString: PostgreSQLConnectionString;
|
|
@@ -52,6 +52,13 @@ declare const functionExists: (execute: SQLExecutor, functionName: string) => Pr
|
|
|
52
52
|
//#region src/storage/postgresql/core/sql/formatter/index.d.ts
|
|
53
53
|
declare const pgFormatter: SQLFormatter;
|
|
54
54
|
//#endregion
|
|
55
|
+
//#region src/storage/postgresql/core/sql/json.d.ts
|
|
56
|
+
declare const PostgreSQLJSON: {
|
|
57
|
+
readonly field: (source: SQL, path: string) => SQL;
|
|
58
|
+
readonly path: (path: string) => SQLPlain;
|
|
59
|
+
readonly textField: (source: SQL, path: string) => SQL;
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
55
62
|
//#region src/storage/postgresql/core/sql/processors/arrayProcessors.d.ts
|
|
56
63
|
declare const PostgreSQLArrayProcessor: SQLProcessor<SQLArray>;
|
|
57
64
|
declare const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn>;
|
|
@@ -64,5 +71,5 @@ type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
|
64
71
|
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
65
72
|
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
66
73
|
//#endregion
|
|
67
|
-
export {
|
|
68
|
-
//# sourceMappingURL=index-
|
|
74
|
+
export { parseDatabaseName as S, releaseAdvisoryLock as _, PostgreSQLExpandSQLInProcessor as a, PostgreSQLConnectionString as b, defaultPostgreSqlDatabase as c, tableExists as d, tableExistsSQL as f, advisoryLock as g, acquireAdvisoryLock as h, PostgreSQLArrayProcessor as i, functionExists as l, AdvisoryLock as m, PostgreSQLDriverType as n, PostgreSQLJSON as o, DefaultPostgreSQLMigratorOptions as p, postgreSQLColumnProcessors as r, pgFormatter as s, PostgreSQLDatabaseName as t, functionExistsSQL as u, tryAcquireAdvisoryLock as v, defaultPostgreSQLConnectionString as x, mapPostgresError as y };
|
|
75
|
+
//# sourceMappingURL=index-tS9lpLPz.d.cts.map
|