@event-driven-io/dumbo 0.13.0-beta.4 → 0.13.0-beta.41

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 (83) hide show
  1. package/dist/cloudflare.cjs +397 -0
  2. package/dist/cloudflare.cjs.map +1 -0
  3. package/dist/cloudflare.d.cts +99 -0
  4. package/dist/cloudflare.d.ts +99 -0
  5. package/dist/cloudflare.js +361 -0
  6. package/dist/cloudflare.js.map +1 -0
  7. package/dist/core-BMeDuqBQ.js +2265 -0
  8. package/dist/core-BMeDuqBQ.js.map +1 -0
  9. package/dist/core-BPNgo5b6.js +379 -0
  10. package/dist/core-BPNgo5b6.js.map +1 -0
  11. package/dist/core-CIVu4cNp.cjs +588 -0
  12. package/dist/core-CIVu4cNp.cjs.map +1 -0
  13. package/dist/core-D5W_5J8k.cjs +3246 -0
  14. package/dist/core-D5W_5J8k.cjs.map +1 -0
  15. package/dist/core-DqUjje4u.cjs +450 -0
  16. package/dist/core-DqUjje4u.cjs.map +1 -0
  17. package/dist/core-gu5fi784.js +451 -0
  18. package/dist/core-gu5fi784.js.map +1 -0
  19. package/dist/{index-C2z_XBn6.d.ts → index-B-q2er0S.d.cts} +122 -75
  20. package/dist/{index-C0h0c380.d.cts → index-B5qbt5nP.d.ts} +122 -75
  21. package/dist/index-BJJAkyuJ.d.ts +68 -0
  22. package/dist/index-CRbkvVjT.d.ts +1587 -0
  23. package/dist/index-Cmdlb0KP.d.cts +1587 -0
  24. package/dist/index-D7qxqMf9.d.cts +67 -0
  25. package/dist/index-DtRCGhFP.d.cts +68 -0
  26. package/dist/index-m5LDyNNF.d.ts +67 -0
  27. package/dist/index.cjs +219 -270
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +3 -127
  30. package/dist/index.d.ts +3 -127
  31. package/dist/index.js +56 -269
  32. package/dist/index.js.map +1 -1
  33. package/dist/pg.cjs +373 -659
  34. package/dist/pg.cjs.map +1 -1
  35. package/dist/pg.d.cts +140 -153
  36. package/dist/pg.d.ts +140 -153
  37. package/dist/pg.js +326 -658
  38. package/dist/pg.js.map +1 -1
  39. package/dist/postgreSQLMetadata-Khf1e9CT.js +65 -0
  40. package/dist/postgreSQLMetadata-Khf1e9CT.js.map +1 -0
  41. package/dist/postgreSQLMetadata-Ri_p5u6i.cjs +118 -0
  42. package/dist/postgreSQLMetadata-Ri_p5u6i.cjs.map +1 -0
  43. package/dist/postgresql.cjs +25 -0
  44. package/dist/postgresql.d.cts +3 -0
  45. package/dist/postgresql.d.ts +3 -0
  46. package/dist/postgresql.js +4 -0
  47. package/dist/sqlite.cjs +30 -0
  48. package/dist/sqlite.d.cts +3 -0
  49. package/dist/sqlite.d.ts +3 -0
  50. package/dist/sqlite.js +4 -0
  51. package/dist/sqlite3.cjs +437 -273
  52. package/dist/sqlite3.cjs.map +1 -1
  53. package/dist/sqlite3.d.cts +92 -70
  54. package/dist/sqlite3.d.ts +92 -70
  55. package/dist/sqlite3.js +402 -272
  56. package/dist/sqlite3.js.map +1 -1
  57. package/dist/sqliteMetadata-CpmoZxqb.cjs +46 -0
  58. package/dist/sqliteMetadata-CpmoZxqb.cjs.map +1 -0
  59. package/dist/sqliteMetadata-viYmVwA5.js +29 -0
  60. package/dist/sqliteMetadata-viYmVwA5.js.map +1 -0
  61. package/package.json +60 -37
  62. package/dist/chunk-32AL3EAS.cjs +0 -47
  63. package/dist/chunk-32AL3EAS.cjs.map +0 -1
  64. package/dist/chunk-6IHCIJ7S.js +0 -47
  65. package/dist/chunk-6IHCIJ7S.js.map +0 -1
  66. package/dist/chunk-IYEHOE4S.cjs +0 -405
  67. package/dist/chunk-IYEHOE4S.cjs.map +0 -1
  68. package/dist/chunk-N7RWT46K.js +0 -2011
  69. package/dist/chunk-N7RWT46K.js.map +0 -1
  70. package/dist/chunk-OJ34O3Q2.cjs +0 -2011
  71. package/dist/chunk-OJ34O3Q2.cjs.map +0 -1
  72. package/dist/chunk-XVV3OOQX.js +0 -405
  73. package/dist/chunk-XVV3OOQX.js.map +0 -1
  74. package/dist/columnProcessors-BX-sH7ah.d.cts +0 -8
  75. package/dist/columnProcessors-DMPpTPqM.d.ts +0 -8
  76. package/dist/connectionString-B1wm0TFc.d.cts +0 -1271
  77. package/dist/connectionString-B1wm0TFc.d.ts +0 -1271
  78. package/dist/d1.cjs +0 -277
  79. package/dist/d1.cjs.map +0 -1
  80. package/dist/d1.d.cts +0 -72
  81. package/dist/d1.d.ts +0 -72
  82. package/dist/d1.js +0 -277
  83. package/dist/d1.js.map +0 -1
@@ -1,58 +1,92 @@
1
- import { dv as DatabaseConnectionString, ar as SQLCommandOptions, as as SQLExecutor, v as AnyConnection, D as DatabaseTransaction, a as DatabaseTransactionOptions, C as Connection, B as ConnectionOptions, w as InferDriverTypeFromConnection, x as InferDbClientFromConnection, G as InitTransaction, c as DbSQLExecutor, S as SQLFormatter, b as ConnectionPool, cy as JSONSerializer, M as MigratorOptions, cU as SQL, q as DatabaseDriverType } from './connectionString-B1wm0TFc.js';
2
-
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-Cmdlb0KP.cjs";
2
+ //#region src/storage/sqlite/core/execute/execute.d.ts
3
+ type SQLiteErrorMapper = (error: unknown) => DumboError;
4
+ declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
5
+ type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
6
+ declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, serializer: JSONSerializer, formatter?: SQLFormatter, errorMapper?: SQLiteErrorMapper) => SQLiteSQLExecutor<DriverType>;
7
+ //#endregion
8
+ //#region src/storage/sqlite/core/transactions/index.d.ts
9
+ type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection, TransactionOptions extends SQLiteTransactionOptions = SQLiteTransactionOptions> = DatabaseTransaction<ConnectionType, TransactionOptions>;
10
+ type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';
11
+ type SQLiteTransactionOptions = DatabaseTransactionOptions & {
12
+ mode?: SQLiteTransactionMode;
13
+ useSavepoints?: boolean;
14
+ };
15
+ declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean, serializer: JSONSerializer, defaultTransactionMode?: "IMMEDIATE" | "DEFERRED" | "EXCLUSIVE") => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
16
+ close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
17
+ } & SQLiteTransactionOptions) => InferTransactionFromConnection<ConnectionType>;
18
+ //#endregion
19
+ //#region src/storage/sqlite/core/connections/connectionString.d.ts
20
+ type SQLitePragmaOptions = {
21
+ journal_mode?: 'DELETE' | 'TRUNCATE' | 'PERSIST' | 'MEMORY' | 'WAL' | 'OFF';
22
+ synchronous?: 'OFF' | 'NORMAL' | 'FULL' | 'EXTRA';
23
+ cache_size?: number;
24
+ foreign_keys?: boolean;
25
+ temp_store?: 'DEFAULT' | 'FILE' | 'MEMORY';
26
+ busy_timeout?: number;
27
+ mmap_size?: number;
28
+ };
3
29
  type SQLiteConnectionString = DatabaseConnectionString<'SQLite', `file:${string}` | `:memory:` | `/${string}` | `./${string}`>;
4
30
  declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnectionString;
5
-
31
+ declare const parsePragmasFromConnectionString: (connectionString: string | SQLiteConnectionString) => Partial<SQLitePragmaOptions>;
32
+ //#endregion
33
+ //#region src/storage/sqlite/core/connections/index.d.ts
6
34
  type SQLiteCommandOptions = SQLCommandOptions & {
7
- ignoreChangesCount?: boolean;
35
+ ignoreChangesCount?: boolean;
8
36
  };
37
+ type BatchSQLiteCommandOptions = SQLiteCommandOptions & BatchSQLCommandOptions;
9
38
  type SQLiteParameters = object | string | bigint | number | boolean | null;
10
39
  type SQLiteClient = {
11
- connect: () => Promise<void>;
12
- close: () => Promise<void>;
40
+ connect: () => Promise<void>;
41
+ close: () => Promise<void>;
13
42
  } & SQLExecutor;
14
43
  type SQLitePoolClient = {
15
- release: () => void;
44
+ release: () => void;
16
45
  } & SQLExecutor;
17
46
  type SQLiteClientFactory<SQLiteClientType extends SQLiteClient = SQLiteClient, ClientOptions = SQLiteClientOptions> = (options: ClientOptions) => SQLiteClientType;
18
47
  type SQLiteClientOrPoolClient = SQLitePoolClient | SQLiteClient;
19
48
  interface SQLiteError extends Error {
20
- errno: number;
49
+ errno: number;
21
50
  }
22
51
  declare const isSQLiteError: (error: unknown) => error is SQLiteError;
23
- type SQLiteClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClient = SQLiteClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = Connection<Self, DriverType, SQLiteClientType, TransactionType, TransactionOptionsType>;
24
- type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType, TransactionOptionsType>;
25
- type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = (SQLiteClientType extends SQLiteClient ? SQLiteClientConnection<Self, DriverType, SQLiteClientType, TransactionType, TransactionOptionsType> : never) | (SQLiteClientType extends SQLitePoolClient ? SQLitePoolClientConnection<Self, DriverType, SQLiteClientType, TransactionType, TransactionOptionsType> : never);
52
+ type SQLiteClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClient = SQLiteClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLiteClientType, TransactionType>;
53
+ type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType>;
54
+ type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = (SQLiteClientType extends SQLiteClient ? SQLiteClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never) | (SQLiteClientType extends SQLitePoolClient ? SQLitePoolClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never);
26
55
  type AnySQLiteClientConnection = SQLiteClientConnection<any, any>;
27
- type AnySQLitePoolClientConnection = SQLitePoolClientConnection<any, any, any, any, any>;
28
- type AnySQLiteConnection = SQLiteConnection<any, any, any, any, any>;
56
+ type AnySQLitePoolClientConnection = SQLitePoolClientConnection<any, any, any, any>;
57
+ type AnySQLiteConnection = SQLiteConnection<any, any, any, any>;
29
58
  type SQLiteConnectionOptions<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionOptions<ConnectionType> & SQLiteClientOptions;
30
59
  type SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
31
- driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
32
- type: 'Client';
33
- sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
34
- connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
60
+ driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
61
+ type: 'Client';
62
+ sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
63
+ connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
64
+ serializer: JSONSerializer;
35
65
  };
36
66
  type SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
37
- driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
38
- type: 'PoolClient';
39
- sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
40
- connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
67
+ driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
68
+ type: 'PoolClient';
69
+ sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
70
+ connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
71
+ serializer: JSONSerializer;
41
72
  };
42
73
  type SQLiteConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ClientOptions = SQLiteClientOptions> = SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions> | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;
43
74
  type SQLiteConnectionFactory<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (options: ConnectionOptions) => SQLiteConnectionType;
44
75
  type TransactionNestingCounter = {
45
- increment: () => void;
46
- decrement: () => void;
47
- reset: () => void;
48
- level: number;
76
+ increment: () => void;
77
+ decrement: () => void;
78
+ reset: () => void;
79
+ level: number;
49
80
  };
50
81
  declare const transactionNestingCounter: () => TransactionNestingCounter;
51
- type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, TransactionType extends DatabaseTransaction<SQLiteConnectionType> = DatabaseTransaction<SQLiteConnectionType>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = {
52
- driverType: SQLiteConnectionType['driverType'];
53
- client: InferDbClientFromConnection<SQLiteConnectionType>;
54
- initTransaction?: InitTransaction<SQLiteConnectionType, TransactionType, TransactionOptionsType>;
55
- allowNestedTransactions?: boolean;
82
+ type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection> = {
83
+ driverType: SQLiteConnectionType['driverType'];
84
+ client: InferDbClientFromConnection<SQLiteConnectionType>;
85
+ initTransaction?: InitTransaction<SQLiteConnectionType>;
86
+ allowNestedTransactions?: boolean;
87
+ defaultTransactionMode?: SQLiteTransactionMode;
88
+ serializer: JSONSerializer;
89
+ errorMapper?: SQLiteErrorMapper;
56
90
  };
57
91
  declare const sqliteAmbientClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection>(options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>) => SQLiteConnectionType;
58
92
  declare const sqliteClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
@@ -60,80 +94,93 @@ declare const sqlitePoolClientConnection: <SQLiteConnectionType extends AnySQLit
60
94
  declare function sqliteConnection<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>): SQLiteConnectionType;
61
95
  type InMemorySQLiteDatabase = ':memory:';
62
96
  declare const InMemorySQLiteDatabase: SQLiteConnectionString;
63
- type SQLiteClientOptions = {};
64
-
65
- declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
66
- type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
67
- declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, formatter?: SQLFormatter) => SQLiteSQLExecutor<DriverType>;
68
-
97
+ declare const DEFAULT_SQLITE_PRAGMA_OPTIONS: SQLitePragmaOptions;
98
+ type SQLiteClientOptions = {
99
+ pragmaOptions?: Partial<SQLitePragmaOptions>;
100
+ defaultTransactionMode?: SQLiteTransactionMode;
101
+ skipDatabasePragmas?: boolean;
102
+ readonly?: boolean;
103
+ };
104
+ //#endregion
105
+ //#region src/storage/sqlite/core/errors/errorMapper.d.ts
106
+ /**
107
+ * Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed
108
+ * DumboError based on the SQLite result code.
109
+ *
110
+ * Result code reference: https://www.sqlite.org/rescode.html
111
+ *
112
+ * Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.
113
+ */
114
+ declare const mapSqliteError: (error: unknown) => DumboError;
115
+ //#endregion
116
+ //#region src/storage/sqlite/core/pool/pool.d.ts
69
117
  type SQLiteFileNameOrConnectionString = {
70
- fileName: string | SQLiteConnectionString;
71
- connectionString?: never;
118
+ fileName: string | SQLiteConnectionString;
119
+ connectionString?: never;
72
120
  } | {
73
- connectionString: string | SQLiteConnectionString;
74
- fileName?: never;
121
+ connectionString: string | SQLiteConnectionString;
122
+ fileName?: never;
75
123
  };
76
124
  declare const isInMemoryDatabase: (options: Record<string, unknown>) => boolean;
77
125
  type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
78
126
  type SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = {
79
- singleton?: true;
80
- pooled?: false;
81
- sqliteConnectionFactory?: never;
82
- connection: SQLiteConnectionType;
83
- connectionOptions?: never;
127
+ singleton?: true;
128
+ pooled?: false;
129
+ sqliteConnectionFactory?: never;
130
+ connection: SQLiteConnectionType;
131
+ connectionOptions?: never;
84
132
  };
85
133
  declare const sqliteAmbientConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(options: {
86
- driverType: SQLiteConnectionType["driverType"];
134
+ driverType: SQLiteConnectionType["driverType"];
87
135
  } & SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType["driverType"]>) => SQLiteAmbientConnectionPool<SQLiteConnectionType["driverType"]>;
88
136
  type SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
89
- singleton: true;
90
- pooled?: true;
91
- sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
92
- connection?: never;
93
- connectionOptions: ConnectionOptions;
137
+ singleton: true;
138
+ pooled?: true;
139
+ sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
140
+ connection?: never;
141
+ connectionOptions: ConnectionOptions;
94
142
  };
95
143
  type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
96
144
  declare const sqliteSingletonConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
97
- driverType: SQLiteConnectionType["driverType"];
145
+ driverType: SQLiteConnectionType["driverType"];
98
146
  } & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
99
147
  type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
100
- singleton?: false;
101
- pooled?: true;
102
- sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
103
- connection?: never;
104
- connectionOptions: ConnectionOptions;
148
+ singleton?: false;
149
+ pooled?: true;
150
+ sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
151
+ connection?: never;
152
+ connectionOptions: ConnectionOptions;
105
153
  };
106
154
  type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
107
155
  declare const sqliteAlwaysNewConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
108
- driverType: SQLiteConnectionType["driverType"];
156
+ driverType: SQLiteConnectionType["driverType"];
109
157
  } & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
110
158
  type SQLitePoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType>) & {
111
- driverType: SQLiteConnectionType['driverType'];
112
- serializer?: JSONSerializer;
159
+ driverType: SQLiteConnectionType['driverType'];
160
+ serializer?: JSONSerializer;
113
161
  };
114
162
  type SQLitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = SQLiteAmbientConnectionPool<SQLiteConnectionType> | SQLiteSingletonConnectionPool<SQLiteConnectionType> | SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
115
163
  type SQLitePoolFactoryOptions<SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions> = Omit<SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>, 'singleton'> & {
116
- singleton?: boolean;
164
+ singleton?: boolean;
117
165
  };
118
166
  declare const toSqlitePoolOptions: <SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions>(options: SQLitePoolFactoryOptions<SQLiteConnectionType, ConnectionOptions>) => SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>;
119
167
  declare function sqlitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions>(options: SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>): SQLitePool<SQLiteConnectionType>;
120
-
168
+ //#endregion
169
+ //#region src/storage/sqlite/core/schema/migrations.d.ts
121
170
  declare const DefaultSQLiteMigratorOptions: MigratorOptions;
122
-
123
- declare const defaultPostgreSqlDatabase = "postgres";
124
- declare const tableExistsSQL: (tableName: string) => SQL;
125
- declare const tableExists: (pool: ConnectionPool, tableName: string) => Promise<boolean>;
126
-
171
+ //#endregion
172
+ //#region src/storage/sqlite/core/schema/schema.d.ts
173
+ declare const defaultSQLiteDatabase = ":memory:";
174
+ declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
175
+ //#endregion
176
+ //#region src/storage/sqlite/core/sql/formatter/index.d.ts
127
177
  declare const sqliteFormatter: SQLFormatter;
128
-
129
- type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = DatabaseTransaction<ConnectionType>;
130
- declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean) => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
131
- close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
132
- } & DatabaseTransactionOptions) => DatabaseTransaction<ConnectionType>;
133
-
178
+ //#endregion
179
+ //#region src/storage/sqlite/core/index.d.ts
134
180
  type SQLiteDatabaseName = 'SQLite';
135
181
  declare const SQLiteDatabaseName = "SQLite";
136
182
  type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
137
183
  type SQLiteDatabaseType = 'SQLite';
138
-
139
- export { type SQLiteTransaction as $, type AnySQLiteClientConnection as A, type SQLiteClientOptions as B, SQLiteConnectionString as C, sqliteExecute as D, type SQLiteSQLExecutor as E, sqliteSQLExecutor as F, type SQLiteFileNameOrConnectionString as G, isInMemoryDatabase as H, InMemorySQLiteDatabase as I, type SQLiteAmbientConnectionPool as J, sqliteAmbientConnectionPool as K, type SQLiteSingletonConnectionPool as L, sqliteSingletonConnectionPool as M, type SQLiteAlwaysNewConnectionPool as N, sqliteAlwaysNewConnectionPool as O, type SQLitePoolOptions as P, type SQLitePool as Q, type SQLitePoolFactoryOptions as R, type SQLiteClient as S, type TransactionNestingCounter as T, toSqlitePoolOptions as U, sqlitePool as V, DefaultSQLiteMigratorOptions as W, defaultPostgreSqlDatabase as X, tableExistsSQL as Y, tableExists as Z, sqliteFormatter as _, type SQLiteDriverType as a, sqliteTransaction as a0, type SQLiteConnectionOptions as b, SQLiteDatabaseName as c, type SQLiteDatabaseType as d, type SQLiteCommandOptions as e, type SQLiteParameters as f, type SQLitePoolClient as g, type SQLiteClientFactory as h, type SQLiteClientOrPoolClient as i, type SQLiteError as j, isSQLiteError as k, type SQLiteClientConnection as l, type SQLitePoolClientConnection as m, type SQLiteConnection as n, type AnySQLitePoolClientConnection as o, type AnySQLiteConnection as p, type SQLiteClientConnectionDefinitionOptions as q, type SQLitePoolConnectionDefinitionOptions as r, type SQLiteConnectionDefinitionOptions as s, type SQLiteConnectionFactory as t, transactionNestingCounter as u, type SqliteAmbientClientConnectionOptions as v, sqliteAmbientClientConnection as w, sqliteClientConnection as x, sqlitePoolClientConnection as y, sqliteConnection as z };
184
+ //#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-B-q2er0S.d.cts.map
@@ -1,58 +1,92 @@
1
- import { dv as DatabaseConnectionString, ar as SQLCommandOptions, as as SQLExecutor, v as AnyConnection, D as DatabaseTransaction, a as DatabaseTransactionOptions, C as Connection, B as ConnectionOptions, w as InferDriverTypeFromConnection, x as InferDbClientFromConnection, G as InitTransaction, c as DbSQLExecutor, S as SQLFormatter, b as ConnectionPool, cy as JSONSerializer, M as MigratorOptions, cU as SQL, q as DatabaseDriverType } from './connectionString-B1wm0TFc.cjs';
2
-
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-CRbkvVjT.js";
2
+ //#region src/storage/sqlite/core/execute/execute.d.ts
3
+ type SQLiteErrorMapper = (error: unknown) => DumboError;
4
+ declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
5
+ type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
6
+ declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, serializer: JSONSerializer, formatter?: SQLFormatter, errorMapper?: SQLiteErrorMapper) => SQLiteSQLExecutor<DriverType>;
7
+ //#endregion
8
+ //#region src/storage/sqlite/core/transactions/index.d.ts
9
+ type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection, TransactionOptions extends SQLiteTransactionOptions = SQLiteTransactionOptions> = DatabaseTransaction<ConnectionType, TransactionOptions>;
10
+ type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';
11
+ type SQLiteTransactionOptions = DatabaseTransactionOptions & {
12
+ mode?: SQLiteTransactionMode;
13
+ useSavepoints?: boolean;
14
+ };
15
+ declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean, serializer: JSONSerializer, defaultTransactionMode?: "IMMEDIATE" | "DEFERRED" | "EXCLUSIVE") => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
16
+ close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
17
+ } & SQLiteTransactionOptions) => InferTransactionFromConnection<ConnectionType>;
18
+ //#endregion
19
+ //#region src/storage/sqlite/core/connections/connectionString.d.ts
20
+ type SQLitePragmaOptions = {
21
+ journal_mode?: 'DELETE' | 'TRUNCATE' | 'PERSIST' | 'MEMORY' | 'WAL' | 'OFF';
22
+ synchronous?: 'OFF' | 'NORMAL' | 'FULL' | 'EXTRA';
23
+ cache_size?: number;
24
+ foreign_keys?: boolean;
25
+ temp_store?: 'DEFAULT' | 'FILE' | 'MEMORY';
26
+ busy_timeout?: number;
27
+ mmap_size?: number;
28
+ };
3
29
  type SQLiteConnectionString = DatabaseConnectionString<'SQLite', `file:${string}` | `:memory:` | `/${string}` | `./${string}`>;
4
30
  declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnectionString;
5
-
31
+ declare const parsePragmasFromConnectionString: (connectionString: string | SQLiteConnectionString) => Partial<SQLitePragmaOptions>;
32
+ //#endregion
33
+ //#region src/storage/sqlite/core/connections/index.d.ts
6
34
  type SQLiteCommandOptions = SQLCommandOptions & {
7
- ignoreChangesCount?: boolean;
35
+ ignoreChangesCount?: boolean;
8
36
  };
37
+ type BatchSQLiteCommandOptions = SQLiteCommandOptions & BatchSQLCommandOptions;
9
38
  type SQLiteParameters = object | string | bigint | number | boolean | null;
10
39
  type SQLiteClient = {
11
- connect: () => Promise<void>;
12
- close: () => Promise<void>;
40
+ connect: () => Promise<void>;
41
+ close: () => Promise<void>;
13
42
  } & SQLExecutor;
14
43
  type SQLitePoolClient = {
15
- release: () => void;
44
+ release: () => void;
16
45
  } & SQLExecutor;
17
46
  type SQLiteClientFactory<SQLiteClientType extends SQLiteClient = SQLiteClient, ClientOptions = SQLiteClientOptions> = (options: ClientOptions) => SQLiteClientType;
18
47
  type SQLiteClientOrPoolClient = SQLitePoolClient | SQLiteClient;
19
48
  interface SQLiteError extends Error {
20
- errno: number;
49
+ errno: number;
21
50
  }
22
51
  declare const isSQLiteError: (error: unknown) => error is SQLiteError;
23
- type SQLiteClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClient = SQLiteClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = Connection<Self, DriverType, SQLiteClientType, TransactionType, TransactionOptionsType>;
24
- type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType, TransactionOptionsType>;
25
- type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = (SQLiteClientType extends SQLiteClient ? SQLiteClientConnection<Self, DriverType, SQLiteClientType, TransactionType, TransactionOptionsType> : never) | (SQLiteClientType extends SQLitePoolClient ? SQLitePoolClientConnection<Self, DriverType, SQLiteClientType, TransactionType, TransactionOptionsType> : never);
52
+ type SQLiteClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClient = SQLiteClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLiteClientType, TransactionType>;
53
+ type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType>;
54
+ type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = (SQLiteClientType extends SQLiteClient ? SQLiteClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never) | (SQLiteClientType extends SQLitePoolClient ? SQLitePoolClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never);
26
55
  type AnySQLiteClientConnection = SQLiteClientConnection<any, any>;
27
- type AnySQLitePoolClientConnection = SQLitePoolClientConnection<any, any, any, any, any>;
28
- type AnySQLiteConnection = SQLiteConnection<any, any, any, any, any>;
56
+ type AnySQLitePoolClientConnection = SQLitePoolClientConnection<any, any, any, any>;
57
+ type AnySQLiteConnection = SQLiteConnection<any, any, any, any>;
29
58
  type SQLiteConnectionOptions<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionOptions<ConnectionType> & SQLiteClientOptions;
30
59
  type SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
31
- driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
32
- type: 'Client';
33
- sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
34
- connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
60
+ driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
61
+ type: 'Client';
62
+ sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
63
+ connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
64
+ serializer: JSONSerializer;
35
65
  };
36
66
  type SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
37
- driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
38
- type: 'PoolClient';
39
- sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
40
- connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
67
+ driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
68
+ type: 'PoolClient';
69
+ sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
70
+ connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
71
+ serializer: JSONSerializer;
41
72
  };
42
73
  type SQLiteConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ClientOptions = SQLiteClientOptions> = SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions> | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;
43
74
  type SQLiteConnectionFactory<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (options: ConnectionOptions) => SQLiteConnectionType;
44
75
  type TransactionNestingCounter = {
45
- increment: () => void;
46
- decrement: () => void;
47
- reset: () => void;
48
- level: number;
76
+ increment: () => void;
77
+ decrement: () => void;
78
+ reset: () => void;
79
+ level: number;
49
80
  };
50
81
  declare const transactionNestingCounter: () => TransactionNestingCounter;
51
- type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, TransactionType extends DatabaseTransaction<SQLiteConnectionType> = DatabaseTransaction<SQLiteConnectionType>, TransactionOptionsType extends DatabaseTransactionOptions = DatabaseTransactionOptions> = {
52
- driverType: SQLiteConnectionType['driverType'];
53
- client: InferDbClientFromConnection<SQLiteConnectionType>;
54
- initTransaction?: InitTransaction<SQLiteConnectionType, TransactionType, TransactionOptionsType>;
55
- allowNestedTransactions?: boolean;
82
+ type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection> = {
83
+ driverType: SQLiteConnectionType['driverType'];
84
+ client: InferDbClientFromConnection<SQLiteConnectionType>;
85
+ initTransaction?: InitTransaction<SQLiteConnectionType>;
86
+ allowNestedTransactions?: boolean;
87
+ defaultTransactionMode?: SQLiteTransactionMode;
88
+ serializer: JSONSerializer;
89
+ errorMapper?: SQLiteErrorMapper;
56
90
  };
57
91
  declare const sqliteAmbientClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection>(options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>) => SQLiteConnectionType;
58
92
  declare const sqliteClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
@@ -60,80 +94,93 @@ declare const sqlitePoolClientConnection: <SQLiteConnectionType extends AnySQLit
60
94
  declare function sqliteConnection<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>): SQLiteConnectionType;
61
95
  type InMemorySQLiteDatabase = ':memory:';
62
96
  declare const InMemorySQLiteDatabase: SQLiteConnectionString;
63
- type SQLiteClientOptions = {};
64
-
65
- declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
66
- type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
67
- declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, formatter?: SQLFormatter) => SQLiteSQLExecutor<DriverType>;
68
-
97
+ declare const DEFAULT_SQLITE_PRAGMA_OPTIONS: SQLitePragmaOptions;
98
+ type SQLiteClientOptions = {
99
+ pragmaOptions?: Partial<SQLitePragmaOptions>;
100
+ defaultTransactionMode?: SQLiteTransactionMode;
101
+ skipDatabasePragmas?: boolean;
102
+ readonly?: boolean;
103
+ };
104
+ //#endregion
105
+ //#region src/storage/sqlite/core/errors/errorMapper.d.ts
106
+ /**
107
+ * Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed
108
+ * DumboError based on the SQLite result code.
109
+ *
110
+ * Result code reference: https://www.sqlite.org/rescode.html
111
+ *
112
+ * Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.
113
+ */
114
+ declare const mapSqliteError: (error: unknown) => DumboError;
115
+ //#endregion
116
+ //#region src/storage/sqlite/core/pool/pool.d.ts
69
117
  type SQLiteFileNameOrConnectionString = {
70
- fileName: string | SQLiteConnectionString;
71
- connectionString?: never;
118
+ fileName: string | SQLiteConnectionString;
119
+ connectionString?: never;
72
120
  } | {
73
- connectionString: string | SQLiteConnectionString;
74
- fileName?: never;
121
+ connectionString: string | SQLiteConnectionString;
122
+ fileName?: never;
75
123
  };
76
124
  declare const isInMemoryDatabase: (options: Record<string, unknown>) => boolean;
77
125
  type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
78
126
  type SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = {
79
- singleton?: true;
80
- pooled?: false;
81
- sqliteConnectionFactory?: never;
82
- connection: SQLiteConnectionType;
83
- connectionOptions?: never;
127
+ singleton?: true;
128
+ pooled?: false;
129
+ sqliteConnectionFactory?: never;
130
+ connection: SQLiteConnectionType;
131
+ connectionOptions?: never;
84
132
  };
85
133
  declare const sqliteAmbientConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(options: {
86
- driverType: SQLiteConnectionType["driverType"];
134
+ driverType: SQLiteConnectionType["driverType"];
87
135
  } & SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType["driverType"]>) => SQLiteAmbientConnectionPool<SQLiteConnectionType["driverType"]>;
88
136
  type SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
89
- singleton: true;
90
- pooled?: true;
91
- sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
92
- connection?: never;
93
- connectionOptions: ConnectionOptions;
137
+ singleton: true;
138
+ pooled?: true;
139
+ sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
140
+ connection?: never;
141
+ connectionOptions: ConnectionOptions;
94
142
  };
95
143
  type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
96
144
  declare const sqliteSingletonConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
97
- driverType: SQLiteConnectionType["driverType"];
145
+ driverType: SQLiteConnectionType["driverType"];
98
146
  } & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
99
147
  type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
100
- singleton?: false;
101
- pooled?: true;
102
- sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
103
- connection?: never;
104
- connectionOptions: ConnectionOptions;
148
+ singleton?: false;
149
+ pooled?: true;
150
+ sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
151
+ connection?: never;
152
+ connectionOptions: ConnectionOptions;
105
153
  };
106
154
  type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
107
155
  declare const sqliteAlwaysNewConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
108
- driverType: SQLiteConnectionType["driverType"];
156
+ driverType: SQLiteConnectionType["driverType"];
109
157
  } & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
110
158
  type SQLitePoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType>) & {
111
- driverType: SQLiteConnectionType['driverType'];
112
- serializer?: JSONSerializer;
159
+ driverType: SQLiteConnectionType['driverType'];
160
+ serializer?: JSONSerializer;
113
161
  };
114
162
  type SQLitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = SQLiteAmbientConnectionPool<SQLiteConnectionType> | SQLiteSingletonConnectionPool<SQLiteConnectionType> | SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
115
163
  type SQLitePoolFactoryOptions<SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions> = Omit<SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>, 'singleton'> & {
116
- singleton?: boolean;
164
+ singleton?: boolean;
117
165
  };
118
166
  declare const toSqlitePoolOptions: <SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions>(options: SQLitePoolFactoryOptions<SQLiteConnectionType, ConnectionOptions>) => SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>;
119
167
  declare function sqlitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions>(options: SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>): SQLitePool<SQLiteConnectionType>;
120
-
168
+ //#endregion
169
+ //#region src/storage/sqlite/core/schema/migrations.d.ts
121
170
  declare const DefaultSQLiteMigratorOptions: MigratorOptions;
122
-
123
- declare const defaultPostgreSqlDatabase = "postgres";
124
- declare const tableExistsSQL: (tableName: string) => SQL;
125
- declare const tableExists: (pool: ConnectionPool, tableName: string) => Promise<boolean>;
126
-
171
+ //#endregion
172
+ //#region src/storage/sqlite/core/schema/schema.d.ts
173
+ declare const defaultSQLiteDatabase = ":memory:";
174
+ declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
175
+ //#endregion
176
+ //#region src/storage/sqlite/core/sql/formatter/index.d.ts
127
177
  declare const sqliteFormatter: SQLFormatter;
128
-
129
- type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = DatabaseTransaction<ConnectionType>;
130
- declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean) => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
131
- close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
132
- } & DatabaseTransactionOptions) => DatabaseTransaction<ConnectionType>;
133
-
178
+ //#endregion
179
+ //#region src/storage/sqlite/core/index.d.ts
134
180
  type SQLiteDatabaseName = 'SQLite';
135
181
  declare const SQLiteDatabaseName = "SQLite";
136
182
  type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
137
183
  type SQLiteDatabaseType = 'SQLite';
138
-
139
- export { type SQLiteTransaction as $, type AnySQLiteClientConnection as A, type SQLiteClientOptions as B, SQLiteConnectionString as C, sqliteExecute as D, type SQLiteSQLExecutor as E, sqliteSQLExecutor as F, type SQLiteFileNameOrConnectionString as G, isInMemoryDatabase as H, InMemorySQLiteDatabase as I, type SQLiteAmbientConnectionPool as J, sqliteAmbientConnectionPool as K, type SQLiteSingletonConnectionPool as L, sqliteSingletonConnectionPool as M, type SQLiteAlwaysNewConnectionPool as N, sqliteAlwaysNewConnectionPool as O, type SQLitePoolOptions as P, type SQLitePool as Q, type SQLitePoolFactoryOptions as R, type SQLiteClient as S, type TransactionNestingCounter as T, toSqlitePoolOptions as U, sqlitePool as V, DefaultSQLiteMigratorOptions as W, defaultPostgreSqlDatabase as X, tableExistsSQL as Y, tableExists as Z, sqliteFormatter as _, type SQLiteDriverType as a, sqliteTransaction as a0, type SQLiteConnectionOptions as b, SQLiteDatabaseName as c, type SQLiteDatabaseType as d, type SQLiteCommandOptions as e, type SQLiteParameters as f, type SQLitePoolClient as g, type SQLiteClientFactory as h, type SQLiteClientOrPoolClient as i, type SQLiteError as j, isSQLiteError as k, type SQLiteClientConnection as l, type SQLitePoolClientConnection as m, type SQLiteConnection as n, type AnySQLitePoolClientConnection as o, type AnySQLiteConnection as p, type SQLiteClientConnectionDefinitionOptions as q, type SQLitePoolConnectionDefinitionOptions as r, type SQLiteConnectionDefinitionOptions as s, type SQLiteConnectionFactory as t, transactionNestingCounter as u, type SqliteAmbientClientConnectionOptions as v, sqliteAmbientClientConnection as w, sqliteClientConnection as x, sqlitePoolClientConnection as y, sqliteConnection as z };
184
+ //#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-B5qbt5nP.d.ts.map