@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.
- package/dist/cloudflare.cjs +397 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +99 -0
- package/dist/cloudflare.d.ts +99 -0
- package/dist/cloudflare.js +361 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/core-BMeDuqBQ.js +2265 -0
- package/dist/core-BMeDuqBQ.js.map +1 -0
- package/dist/core-BPNgo5b6.js +379 -0
- package/dist/core-BPNgo5b6.js.map +1 -0
- package/dist/core-CIVu4cNp.cjs +588 -0
- package/dist/core-CIVu4cNp.cjs.map +1 -0
- package/dist/core-D5W_5J8k.cjs +3246 -0
- package/dist/core-D5W_5J8k.cjs.map +1 -0
- package/dist/core-DqUjje4u.cjs +450 -0
- package/dist/core-DqUjje4u.cjs.map +1 -0
- package/dist/core-gu5fi784.js +451 -0
- package/dist/core-gu5fi784.js.map +1 -0
- package/dist/{index-C2z_XBn6.d.ts → index-B-q2er0S.d.cts} +122 -75
- package/dist/{index-C0h0c380.d.cts → index-B5qbt5nP.d.ts} +122 -75
- package/dist/index-BJJAkyuJ.d.ts +68 -0
- package/dist/index-CRbkvVjT.d.ts +1587 -0
- package/dist/index-Cmdlb0KP.d.cts +1587 -0
- package/dist/index-D7qxqMf9.d.cts +67 -0
- package/dist/index-DtRCGhFP.d.cts +68 -0
- package/dist/index-m5LDyNNF.d.ts +67 -0
- package/dist/index.cjs +219 -270
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -127
- package/dist/index.d.ts +3 -127
- package/dist/index.js +56 -269
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +373 -659
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +140 -153
- package/dist/pg.d.ts +140 -153
- package/dist/pg.js +326 -658
- package/dist/pg.js.map +1 -1
- package/dist/postgreSQLMetadata-Khf1e9CT.js +65 -0
- package/dist/postgreSQLMetadata-Khf1e9CT.js.map +1 -0
- package/dist/postgreSQLMetadata-Ri_p5u6i.cjs +118 -0
- package/dist/postgreSQLMetadata-Ri_p5u6i.cjs.map +1 -0
- package/dist/postgresql.cjs +25 -0
- package/dist/postgresql.d.cts +3 -0
- package/dist/postgresql.d.ts +3 -0
- package/dist/postgresql.js +4 -0
- package/dist/sqlite.cjs +30 -0
- package/dist/sqlite.d.cts +3 -0
- package/dist/sqlite.d.ts +3 -0
- package/dist/sqlite.js +4 -0
- package/dist/sqlite3.cjs +437 -273
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +92 -70
- package/dist/sqlite3.d.ts +92 -70
- package/dist/sqlite3.js +402 -272
- package/dist/sqlite3.js.map +1 -1
- package/dist/sqliteMetadata-CpmoZxqb.cjs +46 -0
- package/dist/sqliteMetadata-CpmoZxqb.cjs.map +1 -0
- package/dist/sqliteMetadata-viYmVwA5.js +29 -0
- package/dist/sqliteMetadata-viYmVwA5.js.map +1 -0
- package/package.json +60 -37
- package/dist/chunk-32AL3EAS.cjs +0 -47
- package/dist/chunk-32AL3EAS.cjs.map +0 -1
- package/dist/chunk-6IHCIJ7S.js +0 -47
- package/dist/chunk-6IHCIJ7S.js.map +0 -1
- package/dist/chunk-IYEHOE4S.cjs +0 -405
- package/dist/chunk-IYEHOE4S.cjs.map +0 -1
- package/dist/chunk-N7RWT46K.js +0 -2011
- package/dist/chunk-N7RWT46K.js.map +0 -1
- package/dist/chunk-OJ34O3Q2.cjs +0 -2011
- package/dist/chunk-OJ34O3Q2.cjs.map +0 -1
- package/dist/chunk-XVV3OOQX.js +0 -405
- package/dist/chunk-XVV3OOQX.js.map +0 -1
- package/dist/columnProcessors-BX-sH7ah.d.cts +0 -8
- package/dist/columnProcessors-DMPpTPqM.d.ts +0 -8
- package/dist/connectionString-B1wm0TFc.d.cts +0 -1271
- package/dist/connectionString-B1wm0TFc.d.ts +0 -1271
- package/dist/d1.cjs +0 -277
- package/dist/d1.cjs.map +0 -1
- package/dist/d1.d.cts +0 -72
- package/dist/d1.d.ts +0 -72
- package/dist/d1.js +0 -277
- package/dist/d1.js.map +0 -1
|
@@ -1,58 +1,92 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
12
|
-
|
|
40
|
+
connect: () => Promise<void>;
|
|
41
|
+
close: () => Promise<void>;
|
|
13
42
|
} & SQLExecutor;
|
|
14
43
|
type SQLitePoolClient = {
|
|
15
|
-
|
|
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
|
-
|
|
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
|
|
24
|
-
type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self
|
|
25
|
-
type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self
|
|
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
|
|
28
|
-
type AnySQLiteConnection = SQLiteConnection<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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
|
|
118
|
+
fileName: string | SQLiteConnectionString;
|
|
119
|
+
connectionString?: never;
|
|
72
120
|
} | {
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
145
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
98
146
|
} & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
|
|
99
147
|
type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
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
|
-
|
|
112
|
-
|
|
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
|
-
|
|
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
|
-
|
|
124
|
-
declare const
|
|
125
|
-
declare const tableExists: (
|
|
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
|
-
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
12
|
-
|
|
40
|
+
connect: () => Promise<void>;
|
|
41
|
+
close: () => Promise<void>;
|
|
13
42
|
} & SQLExecutor;
|
|
14
43
|
type SQLitePoolClient = {
|
|
15
|
-
|
|
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
|
-
|
|
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
|
|
24
|
-
type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self
|
|
25
|
-
type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self
|
|
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
|
|
28
|
-
type AnySQLiteConnection = SQLiteConnection<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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
|
|
118
|
+
fileName: string | SQLiteConnectionString;
|
|
119
|
+
connectionString?: never;
|
|
72
120
|
} | {
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
145
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
98
146
|
} & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
|
|
99
147
|
type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
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
|
-
|
|
112
|
-
|
|
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
|
-
|
|
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
|
-
|
|
124
|
-
declare const
|
|
125
|
-
declare const tableExists: (
|
|
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
|
-
|
|
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 {
|
|
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
|