@event-driven-io/dumbo 0.13.0-beta.3 → 0.13.0-beta.30
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/chunk-4SM4JJJZ.js +83 -0
- package/dist/chunk-4SM4JJJZ.js.map +1 -0
- package/dist/chunk-EEKBLOCH.cjs +706 -0
- package/dist/chunk-EEKBLOCH.cjs.map +1 -0
- package/dist/{chunk-OJ34O3Q2.cjs → chunk-GVR3PSDL.cjs} +2474 -1636
- package/dist/chunk-GVR3PSDL.cjs.map +1 -0
- package/dist/chunk-HZM7GDOT.cjs +34 -0
- package/dist/chunk-HZM7GDOT.cjs.map +1 -0
- package/dist/{chunk-N7RWT46K.js → chunk-JKE6SULM.js} +2522 -1684
- package/dist/chunk-JKE6SULM.js.map +1 -0
- package/dist/chunk-MOPKHYYU.cjs +83 -0
- package/dist/chunk-MOPKHYYU.cjs.map +1 -0
- package/dist/chunk-RA2L3FQW.js +481 -0
- package/dist/chunk-RA2L3FQW.js.map +1 -0
- package/dist/chunk-UA542GT3.cjs +481 -0
- package/dist/chunk-UA542GT3.cjs.map +1 -0
- package/dist/chunk-WLWELSA2.js +34 -0
- package/dist/chunk-WLWELSA2.js.map +1 -0
- package/dist/chunk-XFEGS3YT.js +706 -0
- package/dist/chunk-XFEGS3YT.js.map +1 -0
- package/dist/cloudflare.cjs +456 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +92 -0
- package/dist/cloudflare.d.ts +92 -0
- package/dist/cloudflare.js +456 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/{columnProcessors-DMPpTPqM.d.ts → columnProcessors-Be2uMYjS.d.cts} +1 -1
- package/dist/{columnProcessors-BX-sH7ah.d.cts → columnProcessors-D0ivj_SU.d.ts} +1 -1
- package/dist/{connectionString-B1wm0TFc.d.cts → connectionString-Dch_MIRU.d.cts} +394 -168
- package/dist/{connectionString-B1wm0TFc.d.ts → connectionString-Dch_MIRU.d.ts} +394 -168
- package/dist/index.cjs +100 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -18
- package/dist/index.d.ts +23 -18
- package/dist/index.js +105 -9
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +383 -9
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +81 -105
- package/dist/pg.d.ts +81 -105
- package/dist/pg.js +435 -61
- package/dist/pg.js.map +1 -1
- package/dist/postgresql.cjs +50 -0
- package/dist/postgresql.cjs.map +1 -0
- package/dist/postgresql.d.cts +61 -0
- package/dist/postgresql.d.ts +61 -0
- package/dist/postgresql.js +50 -0
- package/dist/sqlite.cjs +60 -0
- package/dist/sqlite.cjs.map +1 -0
- package/dist/{index-C2z_XBn6.d.ts → sqlite.d.cts} +69 -20
- package/dist/{index-C0h0c380.d.cts → sqlite.d.ts} +69 -20
- package/dist/sqlite.js +60 -0
- package/dist/sqlite3.cjs +319 -6
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +45 -25
- package/dist/sqlite3.d.ts +45 -25
- package/dist/sqlite3.js +335 -22
- package/dist/sqlite3.js.map +1 -1
- package/package.json +55 -33
- package/dist/chunk-A7TC7IOP.cjs +0 -55
- package/dist/chunk-A7TC7IOP.cjs.map +0 -1
- package/dist/chunk-F7JQ7BX7.js +0 -240
- package/dist/chunk-F7JQ7BX7.js.map +0 -1
- package/dist/chunk-I34X53VL.js +0 -688
- package/dist/chunk-I34X53VL.js.map +0 -1
- package/dist/chunk-ISNF6USX.cjs +0 -688
- package/dist/chunk-ISNF6USX.cjs.map +0 -1
- package/dist/chunk-IYEHOE4S.cjs +0 -405
- package/dist/chunk-IYEHOE4S.cjs.map +0 -1
- package/dist/chunk-L2YZQAG3.cjs +0 -240
- package/dist/chunk-L2YZQAG3.cjs.map +0 -1
- package/dist/chunk-N7RWT46K.js.map +0 -1
- package/dist/chunk-OJ34O3Q2.cjs.map +0 -1
- package/dist/chunk-TXSETOGH.js +0 -55
- package/dist/chunk-TXSETOGH.js.map +0 -1
- package/dist/chunk-XVV3OOQX.js +0 -405
- package/dist/chunk-XVV3OOQX.js.map +0 -1
- 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
- package/dist/pg-3ACXFMU4.cjs +0 -59
- package/dist/pg-3ACXFMU4.cjs.map +0 -1
- package/dist/pg-GHOW3XSG.js +0 -59
- package/dist/sqlite3-EEIKQCJR.js +0 -25
- package/dist/sqlite3-SE4DDYZE.cjs +0 -25
- package/dist/sqlite3-SE4DDYZE.cjs.map +0 -1
- /package/dist/{pg-GHOW3XSG.js.map → postgresql.js.map} +0 -0
- /package/dist/{sqlite3-EEIKQCJR.js.map → sqlite.js.map} +0 -0
package/dist/chunk-XVV3OOQX.js
DELETED
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SQL,
|
|
3
|
-
SQLFormatter,
|
|
4
|
-
SQLProcessorsRegistry,
|
|
5
|
-
createAlwaysNewConnectionPool,
|
|
6
|
-
createAmbientConnection,
|
|
7
|
-
createAmbientConnectionPool,
|
|
8
|
-
createConnection,
|
|
9
|
-
createSingletonConnectionPool,
|
|
10
|
-
defaultProcessorsRegistry,
|
|
11
|
-
exists,
|
|
12
|
-
mapDefaultSQLColumnProcessors,
|
|
13
|
-
mapSQLQueryResult,
|
|
14
|
-
registerDefaultMigratorOptions,
|
|
15
|
-
registerFormatter,
|
|
16
|
-
sqlExecutor,
|
|
17
|
-
tracer
|
|
18
|
-
} from "./chunk-N7RWT46K.js";
|
|
19
|
-
|
|
20
|
-
// src/storage/sqlite/core/sql/processors/columProcessors.ts
|
|
21
|
-
var mapColumnType = (token, { builder }) => {
|
|
22
|
-
let columnSQL;
|
|
23
|
-
const { sqlTokenType } = token;
|
|
24
|
-
switch (sqlTokenType) {
|
|
25
|
-
case "SQL_COLUMN_AUTO_INCREMENT":
|
|
26
|
-
columnSQL = `INTEGER ${token.primaryKey ? "PRIMARY KEY" : ""} AUTOINCREMENT`;
|
|
27
|
-
break;
|
|
28
|
-
case "SQL_COLUMN_BIGINT":
|
|
29
|
-
columnSQL = "INTEGER";
|
|
30
|
-
break;
|
|
31
|
-
case "SQL_COLUMN_SERIAL":
|
|
32
|
-
columnSQL = "INTEGER";
|
|
33
|
-
break;
|
|
34
|
-
case "SQL_COLUMN_INTEGER":
|
|
35
|
-
columnSQL = "INTEGER";
|
|
36
|
-
break;
|
|
37
|
-
case "SQL_COLUMN_JSONB":
|
|
38
|
-
columnSQL = "BLOB";
|
|
39
|
-
break;
|
|
40
|
-
case "SQL_COLUMN_BIGSERIAL":
|
|
41
|
-
columnSQL = "INTEGER";
|
|
42
|
-
break;
|
|
43
|
-
case "SQL_COLUMN_TIMESTAMP":
|
|
44
|
-
columnSQL = "DATETIME";
|
|
45
|
-
break;
|
|
46
|
-
case "SQL_COLUMN_TIMESTAMPTZ":
|
|
47
|
-
columnSQL = "DATETIME";
|
|
48
|
-
break;
|
|
49
|
-
case "SQL_COLUMN_VARCHAR":
|
|
50
|
-
columnSQL = `VARCHAR ${Number.isNaN(token.length) ? "" : `(${token.length})`}`;
|
|
51
|
-
break;
|
|
52
|
-
default: {
|
|
53
|
-
const exhaustiveCheck = sqlTokenType;
|
|
54
|
-
throw new Error(`Unknown column type: ${exhaustiveCheck}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
builder.addSQL(columnSQL);
|
|
58
|
-
};
|
|
59
|
-
var sqliteColumnProcessors = mapDefaultSQLColumnProcessors(mapColumnType);
|
|
60
|
-
|
|
61
|
-
// src/storage/sqlite/core/sql/formatter/index.ts
|
|
62
|
-
var sqliteSQLProcessorsRegistry = SQLProcessorsRegistry({
|
|
63
|
-
from: defaultProcessorsRegistry
|
|
64
|
-
}).register(sqliteColumnProcessors);
|
|
65
|
-
var sqliteFormatter = SQLFormatter({
|
|
66
|
-
processorsRegistry: sqliteSQLProcessorsRegistry
|
|
67
|
-
});
|
|
68
|
-
registerFormatter("SQLite", sqliteFormatter);
|
|
69
|
-
|
|
70
|
-
// src/storage/sqlite/core/execute/execute.ts
|
|
71
|
-
var sqliteExecute = async (database, handle) => {
|
|
72
|
-
try {
|
|
73
|
-
return await handle(database);
|
|
74
|
-
} finally {
|
|
75
|
-
await database.close();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var sqliteSQLExecutor = (driverType, formatter) => ({
|
|
79
|
-
driverType,
|
|
80
|
-
query: async (client, sql, options) => {
|
|
81
|
-
if (options?.timeoutMs) {
|
|
82
|
-
await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);
|
|
83
|
-
}
|
|
84
|
-
tracer.info("db:sql:query", {
|
|
85
|
-
query: (formatter ?? sqliteFormatter).format(sql).query,
|
|
86
|
-
params: (formatter ?? sqliteFormatter).format(sql).params,
|
|
87
|
-
debugSQL: (formatter ?? sqliteFormatter).describe(sql)
|
|
88
|
-
});
|
|
89
|
-
let result = await client.query(sql, options);
|
|
90
|
-
if (options?.mapping) {
|
|
91
|
-
result = {
|
|
92
|
-
...result,
|
|
93
|
-
rows: result.rows.map(
|
|
94
|
-
(row) => mapSQLQueryResult(row, options.mapping)
|
|
95
|
-
)
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
99
|
-
},
|
|
100
|
-
batchQuery: async (client, sqls, options) => {
|
|
101
|
-
if (options?.timeoutMs) {
|
|
102
|
-
await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);
|
|
103
|
-
}
|
|
104
|
-
const results = await client.batchQuery(sqls, options);
|
|
105
|
-
if (options?.mapping) {
|
|
106
|
-
return results.map((result) => ({
|
|
107
|
-
...result,
|
|
108
|
-
rows: result.rows.map(
|
|
109
|
-
(row) => mapSQLQueryResult(row, options.mapping)
|
|
110
|
-
)
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
return results;
|
|
114
|
-
},
|
|
115
|
-
command: async (client, sql, options) => {
|
|
116
|
-
if (options?.timeoutMs) {
|
|
117
|
-
await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);
|
|
118
|
-
}
|
|
119
|
-
tracer.info("db:sql:command", {
|
|
120
|
-
query: (formatter ?? sqliteFormatter).format(sql).query,
|
|
121
|
-
params: (formatter ?? sqliteFormatter).format(sql).params,
|
|
122
|
-
debugSQL: (formatter ?? sqliteFormatter).describe(sql)
|
|
123
|
-
});
|
|
124
|
-
return await client.command(sql, options);
|
|
125
|
-
},
|
|
126
|
-
batchCommand: async (client, sqls, options) => {
|
|
127
|
-
if (options?.timeoutMs) {
|
|
128
|
-
await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);
|
|
129
|
-
}
|
|
130
|
-
return await client.batchCommand(sqls, options);
|
|
131
|
-
},
|
|
132
|
-
formatter: formatter ?? sqliteFormatter
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// src/storage/sqlite/core/pool/pool.ts
|
|
136
|
-
var isInMemoryDatabase = (options) => {
|
|
137
|
-
if ("fileName" in options) {
|
|
138
|
-
return options.fileName === InMemorySQLiteDatabase;
|
|
139
|
-
}
|
|
140
|
-
if ("connectionString" in options) {
|
|
141
|
-
return options.connectionString === InMemorySQLiteDatabase;
|
|
142
|
-
}
|
|
143
|
-
return false;
|
|
144
|
-
};
|
|
145
|
-
var sqliteAmbientConnectionPool = (options) => {
|
|
146
|
-
const { connection, driverType } = options;
|
|
147
|
-
return createAmbientConnectionPool({
|
|
148
|
-
driverType,
|
|
149
|
-
connection
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
var sqliteSingletonConnectionPool = (options) => {
|
|
153
|
-
const { driverType, sqliteConnectionFactory, connectionOptions } = options;
|
|
154
|
-
return createSingletonConnectionPool({
|
|
155
|
-
driverType,
|
|
156
|
-
getConnection: () => sqliteConnectionFactory(connectionOptions)
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
var sqliteAlwaysNewConnectionPool = (options) => {
|
|
160
|
-
const { driverType, sqliteConnectionFactory, connectionOptions } = options;
|
|
161
|
-
return createAlwaysNewConnectionPool({
|
|
162
|
-
driverType,
|
|
163
|
-
getConnection: () => sqliteConnectionFactory(connectionOptions)
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
var toSqlitePoolOptions = (options) => {
|
|
167
|
-
const { singleton, ...rest } = options;
|
|
168
|
-
const useSingleton = singleton ?? isInMemoryDatabase(options);
|
|
169
|
-
if (useSingleton) {
|
|
170
|
-
return { ...rest, singleton: true };
|
|
171
|
-
}
|
|
172
|
-
return { ...rest, singleton: false };
|
|
173
|
-
};
|
|
174
|
-
function sqlitePool(options) {
|
|
175
|
-
const { driverType } = options;
|
|
176
|
-
if (options.connection)
|
|
177
|
-
return createAmbientConnectionPool({
|
|
178
|
-
driverType,
|
|
179
|
-
connection: options.connection
|
|
180
|
-
});
|
|
181
|
-
if (options.singleton === true && options.sqliteConnectionFactory) {
|
|
182
|
-
return createSingletonConnectionPool({
|
|
183
|
-
driverType,
|
|
184
|
-
getConnection: () => options.sqliteConnectionFactory(options.connectionOptions)
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
return createAlwaysNewConnectionPool({
|
|
188
|
-
driverType,
|
|
189
|
-
getConnection: () => options.sqliteConnectionFactory(options.connectionOptions)
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// src/storage/sqlite/core/schema/migrations.ts
|
|
194
|
-
var DefaultSQLiteMigratorOptions = {};
|
|
195
|
-
registerDefaultMigratorOptions("SQLite", DefaultSQLiteMigratorOptions);
|
|
196
|
-
|
|
197
|
-
// src/storage/sqlite/core/schema/schema.ts
|
|
198
|
-
var defaultPostgreSqlDatabase = "postgres";
|
|
199
|
-
var tableExistsSQL = (tableName) => SQL`
|
|
200
|
-
SELECT EXISTS (
|
|
201
|
-
SELECT 1
|
|
202
|
-
FROM sqlite_master
|
|
203
|
-
WHERE type = 'table' AND name = ${tableName}
|
|
204
|
-
) AS "exists"
|
|
205
|
-
`;
|
|
206
|
-
var tableExists = async (pool, tableName) => exists(pool.execute.query(tableExistsSQL(tableName)));
|
|
207
|
-
|
|
208
|
-
// src/storage/sqlite/core/index.ts
|
|
209
|
-
var SQLiteDatabaseName = "SQLite";
|
|
210
|
-
|
|
211
|
-
// src/storage/sqlite/core/connections/connectionString.ts
|
|
212
|
-
var SQLiteConnectionString2 = (connectionString) => {
|
|
213
|
-
if (!connectionString.startsWith("file:") && connectionString !== ":memory:" && !connectionString.startsWith("/") && !connectionString.startsWith("./")) {
|
|
214
|
-
throw new Error(
|
|
215
|
-
`Invalid SQLite connection string: ${connectionString}. It should start with "file:", ":memory:", "/", or "./".`
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
return connectionString;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
// src/storage/sqlite/core/connections/index.ts
|
|
222
|
-
var isSQLiteError = (error) => {
|
|
223
|
-
if (error instanceof Error && "code" in error) {
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
return false;
|
|
227
|
-
};
|
|
228
|
-
var transactionNestingCounter = () => {
|
|
229
|
-
let transactionLevel = 0;
|
|
230
|
-
return {
|
|
231
|
-
reset: () => {
|
|
232
|
-
transactionLevel = 0;
|
|
233
|
-
},
|
|
234
|
-
increment: () => {
|
|
235
|
-
transactionLevel++;
|
|
236
|
-
},
|
|
237
|
-
decrement: () => {
|
|
238
|
-
transactionLevel--;
|
|
239
|
-
if (transactionLevel < 0) {
|
|
240
|
-
throw new Error("Transaction level is out of bounds");
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
get level() {
|
|
244
|
-
return transactionLevel;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
var sqliteAmbientClientConnection = (options) => {
|
|
249
|
-
const { client, driverType, initTransaction, allowNestedTransactions } = options;
|
|
250
|
-
return createAmbientConnection({
|
|
251
|
-
driverType,
|
|
252
|
-
client,
|
|
253
|
-
initTransaction: initTransaction ?? ((connection) => sqliteTransaction(
|
|
254
|
-
driverType,
|
|
255
|
-
connection,
|
|
256
|
-
allowNestedTransactions ?? false
|
|
257
|
-
)),
|
|
258
|
-
executor: () => sqliteSQLExecutor(driverType)
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
var sqliteClientConnection = (options) => {
|
|
262
|
-
const { connectionOptions, sqliteClientFactory } = options;
|
|
263
|
-
let client = null;
|
|
264
|
-
const connect = async () => {
|
|
265
|
-
if (client) return Promise.resolve(client);
|
|
266
|
-
client = sqliteClientFactory(connectionOptions);
|
|
267
|
-
if (client && "connect" in client && typeof client.connect === "function")
|
|
268
|
-
await client.connect();
|
|
269
|
-
return client;
|
|
270
|
-
};
|
|
271
|
-
return createConnection({
|
|
272
|
-
driverType: options.driverType,
|
|
273
|
-
connect,
|
|
274
|
-
close: async () => {
|
|
275
|
-
if (client && "close" in client && typeof client.close === "function")
|
|
276
|
-
await client.close();
|
|
277
|
-
else if (client && "release" in client && typeof client.release === "function")
|
|
278
|
-
client.release();
|
|
279
|
-
},
|
|
280
|
-
initTransaction: (connection) => sqliteTransaction(
|
|
281
|
-
options.driverType,
|
|
282
|
-
connection,
|
|
283
|
-
connectionOptions.transactionOptions?.allowNestedTransactions ?? false
|
|
284
|
-
),
|
|
285
|
-
executor: () => sqliteSQLExecutor(options.driverType)
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
var sqlitePoolClientConnection = (options) => {
|
|
289
|
-
const { connectionOptions, sqliteClientFactory } = options;
|
|
290
|
-
let client = null;
|
|
291
|
-
const connect = async () => {
|
|
292
|
-
if (client) return Promise.resolve(client);
|
|
293
|
-
client = sqliteClientFactory(connectionOptions);
|
|
294
|
-
await client.connect();
|
|
295
|
-
return client;
|
|
296
|
-
};
|
|
297
|
-
return createConnection({
|
|
298
|
-
driverType: options.driverType,
|
|
299
|
-
connect,
|
|
300
|
-
close: () => client !== null ? Promise.resolve(client.release()) : Promise.resolve(),
|
|
301
|
-
initTransaction: (connection) => sqliteTransaction(
|
|
302
|
-
options.driverType,
|
|
303
|
-
connection,
|
|
304
|
-
connectionOptions.transactionOptions?.allowNestedTransactions ?? false
|
|
305
|
-
),
|
|
306
|
-
executor: () => sqliteSQLExecutor(options.driverType)
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
function sqliteConnection(options) {
|
|
310
|
-
return options.type === "Client" ? sqliteClientConnection(options) : sqlitePoolClientConnection(options);
|
|
311
|
-
}
|
|
312
|
-
var InMemorySQLiteDatabase = SQLiteConnectionString2(":memory:");
|
|
313
|
-
|
|
314
|
-
// src/storage/sqlite/core/transactions/index.ts
|
|
315
|
-
var sqliteTransaction = (driverType, connection, allowNestedTransactions) => (getClient, options) => {
|
|
316
|
-
const transactionCounter = transactionNestingCounter();
|
|
317
|
-
allowNestedTransactions = options?.allowNestedTransactions ?? allowNestedTransactions;
|
|
318
|
-
return {
|
|
319
|
-
connection: connection(),
|
|
320
|
-
driverType,
|
|
321
|
-
begin: async function() {
|
|
322
|
-
const client = await getClient;
|
|
323
|
-
if (allowNestedTransactions) {
|
|
324
|
-
if (transactionCounter.level >= 1) {
|
|
325
|
-
transactionCounter.increment();
|
|
326
|
-
await client.query(
|
|
327
|
-
SQL`SAVEPOINT transaction${SQL.plain(transactionCounter.level.toString())}`
|
|
328
|
-
);
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
transactionCounter.increment();
|
|
332
|
-
}
|
|
333
|
-
await client.query(SQL`BEGIN TRANSACTION`);
|
|
334
|
-
},
|
|
335
|
-
commit: async function() {
|
|
336
|
-
const client = await getClient;
|
|
337
|
-
try {
|
|
338
|
-
if (allowNestedTransactions) {
|
|
339
|
-
if (transactionCounter.level > 1) {
|
|
340
|
-
await client.query(
|
|
341
|
-
SQL`RELEASE transaction${SQL.plain(transactionCounter.level.toString())}`
|
|
342
|
-
);
|
|
343
|
-
transactionCounter.decrement();
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
transactionCounter.reset();
|
|
347
|
-
}
|
|
348
|
-
await client.query(SQL`COMMIT`);
|
|
349
|
-
} finally {
|
|
350
|
-
if (options?.close)
|
|
351
|
-
await options?.close(
|
|
352
|
-
client
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
rollback: async function(error) {
|
|
357
|
-
const client = await getClient;
|
|
358
|
-
try {
|
|
359
|
-
if (allowNestedTransactions) {
|
|
360
|
-
if (transactionCounter.level > 1) {
|
|
361
|
-
transactionCounter.decrement();
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
await client.query(SQL`ROLLBACK`);
|
|
366
|
-
} finally {
|
|
367
|
-
if (options?.close)
|
|
368
|
-
await options?.close(
|
|
369
|
-
client,
|
|
370
|
-
error
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
execute: sqlExecutor(sqliteSQLExecutor(driverType), {
|
|
375
|
-
connect: () => getClient
|
|
376
|
-
})
|
|
377
|
-
};
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
export {
|
|
381
|
-
sqliteFormatter,
|
|
382
|
-
sqliteExecute,
|
|
383
|
-
sqliteSQLExecutor,
|
|
384
|
-
sqliteTransaction,
|
|
385
|
-
SQLiteConnectionString2 as SQLiteConnectionString,
|
|
386
|
-
isSQLiteError,
|
|
387
|
-
transactionNestingCounter,
|
|
388
|
-
sqliteAmbientClientConnection,
|
|
389
|
-
sqliteClientConnection,
|
|
390
|
-
sqlitePoolClientConnection,
|
|
391
|
-
sqliteConnection,
|
|
392
|
-
InMemorySQLiteDatabase,
|
|
393
|
-
isInMemoryDatabase,
|
|
394
|
-
sqliteAmbientConnectionPool,
|
|
395
|
-
sqliteSingletonConnectionPool,
|
|
396
|
-
sqliteAlwaysNewConnectionPool,
|
|
397
|
-
toSqlitePoolOptions,
|
|
398
|
-
sqlitePool,
|
|
399
|
-
DefaultSQLiteMigratorOptions,
|
|
400
|
-
defaultPostgreSqlDatabase,
|
|
401
|
-
tableExistsSQL,
|
|
402
|
-
tableExists,
|
|
403
|
-
SQLiteDatabaseName
|
|
404
|
-
};
|
|
405
|
-
//# sourceMappingURL=chunk-XVV3OOQX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/storage/sqlite/core/sql/processors/columProcessors.ts","../src/storage/sqlite/core/sql/formatter/index.ts","../src/storage/sqlite/core/execute/execute.ts","../src/storage/sqlite/core/pool/pool.ts","../src/storage/sqlite/core/schema/migrations.ts","../src/storage/sqlite/core/schema/schema.ts","../src/storage/sqlite/core/index.ts","../src/storage/sqlite/core/connections/connectionString.ts","../src/storage/sqlite/core/connections/index.ts","../src/storage/sqlite/core/transactions/index.ts"],"sourcesContent":["import {\n mapDefaultSQLColumnProcessors,\n type DefaultSQLColumnProcessors,\n type DefaultSQLColumnToken,\n type SQLProcessorContext,\n} from '../../../../../core';\n\nconst mapColumnType = (\n token: DefaultSQLColumnToken,\n { builder }: SQLProcessorContext,\n): void => {\n let columnSQL: string;\n const { sqlTokenType } = token;\n switch (sqlTokenType) {\n case 'SQL_COLUMN_AUTO_INCREMENT':\n columnSQL = `INTEGER ${token.primaryKey ? 'PRIMARY KEY' : ''} AUTOINCREMENT`;\n break;\n case 'SQL_COLUMN_BIGINT':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_SERIAL':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_INTEGER':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_JSONB':\n columnSQL = 'BLOB';\n break;\n case 'SQL_COLUMN_BIGSERIAL':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_TIMESTAMP':\n columnSQL = 'DATETIME';\n break;\n case 'SQL_COLUMN_TIMESTAMPTZ':\n columnSQL = 'DATETIME';\n break;\n case 'SQL_COLUMN_VARCHAR':\n columnSQL = `VARCHAR ${Number.isNaN(token.length) ? '' : `(${token.length})`}`;\n break;\n default: {\n const exhaustiveCheck: never = sqlTokenType;\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unknown column type: ${exhaustiveCheck}`);\n }\n }\n builder.addSQL(columnSQL);\n};\n\nexport const sqliteColumnProcessors: DefaultSQLColumnProcessors =\n mapDefaultSQLColumnProcessors(mapColumnType);\n","import {\n defaultProcessorsRegistry,\n registerFormatter,\n SQLFormatter,\n SQLProcessorsRegistry,\n} from '../../../../../core/sql';\nimport { sqliteColumnProcessors } from '../processors';\n\nconst sqliteSQLProcessorsRegistry = SQLProcessorsRegistry({\n from: defaultProcessorsRegistry,\n}).register(sqliteColumnProcessors);\n\nconst sqliteFormatter: SQLFormatter = SQLFormatter({\n processorsRegistry: sqliteSQLProcessorsRegistry,\n});\n\nregisterFormatter('SQLite', sqliteFormatter);\n\nexport { sqliteFormatter };\n","import type { SQLiteDriverType } from '..';\nimport {\n mapSQLQueryResult,\n SQL,\n SQLFormatter,\n tracer,\n type DbSQLExecutor,\n type QueryResult,\n type QueryResultRow,\n type SQLCommandOptions,\n type SQLQueryOptions,\n} from '../../../../core';\nimport type { SQLiteClient } from '../connections';\nimport { sqliteFormatter } from '../sql/formatter';\n\nexport const sqliteExecute = async <Result = void>(\n database: SQLiteClient,\n handle: (client: SQLiteClient) => Promise<Result>,\n) => {\n try {\n return await handle(database);\n } finally {\n await database.close();\n }\n};\n\nexport type SQLiteSQLExecutor<\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n> = DbSQLExecutor<DriverType, SQLiteClient>;\n\nexport const sqliteSQLExecutor = <\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n>(\n driverType: DriverType,\n formatter?: SQLFormatter,\n): SQLiteSQLExecutor<DriverType> => ({\n driverType,\n query: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sql: SQL,\n options?: SQLQueryOptions,\n ): Promise<QueryResult<Result>> => {\n if (options?.timeoutMs) {\n await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);\n }\n\n tracer.info('db:sql:query', {\n query: (formatter ?? sqliteFormatter).format(sql).query,\n params: (formatter ?? sqliteFormatter).format(sql).params,\n debugSQL: (formatter ?? sqliteFormatter).describe(sql),\n });\n\n let result = await client.query<Result>(sql, options);\n\n if (options?.mapping) {\n result = {\n ...result,\n rows: result.rows.map((row) =>\n mapSQLQueryResult(row, options.mapping!),\n ),\n };\n }\n\n return result;\n },\n batchQuery: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sqls: SQL[],\n options?: SQLQueryOptions,\n ): Promise<QueryResult<Result>[]> => {\n if (options?.timeoutMs) {\n await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);\n }\n\n const results = await client.batchQuery<Result>(sqls, options);\n\n if (options?.mapping) {\n return results.map((result) => ({\n ...result,\n rows: result.rows.map((row) =>\n mapSQLQueryResult(row, options.mapping!),\n ),\n }));\n }\n\n return results;\n },\n command: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sql: SQL,\n options?: SQLCommandOptions,\n ): Promise<QueryResult<Result>> => {\n if (options?.timeoutMs) {\n await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);\n }\n\n tracer.info('db:sql:command', {\n query: (formatter ?? sqliteFormatter).format(sql).query,\n params: (formatter ?? sqliteFormatter).format(sql).params,\n debugSQL: (formatter ?? sqliteFormatter).describe(sql),\n });\n\n return await client.command<Result>(sql, options);\n },\n batchCommand: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sqls: SQL[],\n options?: SQLCommandOptions,\n ): Promise<QueryResult<Result>[]> => {\n if (options?.timeoutMs) {\n await client.query(SQL`PRAGMA busy_timeout = ${options.timeoutMs}`);\n }\n\n return await client.batchCommand<Result>(sqls, options);\n },\n formatter: formatter ?? sqliteFormatter,\n});\n","import {\n InMemorySQLiteDatabase,\n SQLiteConnectionString,\n type AnySQLiteConnection,\n type SQLiteConnectionFactory,\n type SQLiteConnectionOptions,\n} from '..';\nimport {\n createAlwaysNewConnectionPool,\n createAmbientConnectionPool,\n createSingletonConnectionPool,\n JSONSerializer,\n type ConnectionPool,\n} from '../../../../core';\n\nexport type SQLiteFileNameOrConnectionString =\n | {\n fileName: string | SQLiteConnectionString;\n connectionString?: never;\n }\n | {\n connectionString: string | SQLiteConnectionString;\n fileName?: never;\n };\n\nexport const isInMemoryDatabase = (\n options: Record<string, unknown>,\n): boolean => {\n if ('fileName' in options) {\n return options.fileName === InMemorySQLiteDatabase;\n }\n if ('connectionString' in options) {\n return options.connectionString === InMemorySQLiteDatabase;\n }\n return false;\n};\n\nexport type SQLiteAmbientConnectionPool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionPool<SQLiteConnectionType>;\n\ntype SQLiteAmbientConnectionPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = {\n singleton?: true;\n pooled?: false;\n sqliteConnectionFactory?: never;\n connection: SQLiteConnectionType;\n connectionOptions?: never;\n};\n\nexport const sqliteAmbientConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n>(\n options: {\n driverType: SQLiteConnectionType['driverType'];\n } & SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType['driverType']>,\n): SQLiteAmbientConnectionPool<SQLiteConnectionType['driverType']> => {\n const { connection, driverType } = options;\n\n return createAmbientConnectionPool<SQLiteConnectionType>({\n driverType,\n connection: connection,\n });\n};\n\ntype SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = {\n singleton: true;\n pooled?: true;\n sqliteConnectionFactory: SQLiteConnectionFactory<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n connection?: never;\n connectionOptions: ConnectionOptions;\n};\n\nexport type SQLiteSingletonConnectionPool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionPool<SQLiteConnectionType>;\n\nexport const sqliteSingletonConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions &\n Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>,\n>(\n options: {\n driverType: SQLiteConnectionType['driverType'];\n } & SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >,\n): SQLiteSingletonConnectionPool<SQLiteConnectionType> => {\n const { driverType, sqliteConnectionFactory, connectionOptions } = options;\n\n return createSingletonConnectionPool<SQLiteConnectionType>({\n driverType,\n getConnection: () => sqliteConnectionFactory(connectionOptions),\n });\n};\n\ntype SQLiteAlwaysNewPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = {\n singleton?: false;\n pooled?: true;\n sqliteConnectionFactory: SQLiteConnectionFactory<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n connection?: never;\n connectionOptions: ConnectionOptions;\n};\n\nexport type SQLiteAlwaysNewConnectionPool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionPool<SQLiteConnectionType>;\n\nexport const sqliteAlwaysNewConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions &\n Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>,\n>(\n options: {\n driverType: SQLiteConnectionType['driverType'];\n } & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLiteAlwaysNewConnectionPool<SQLiteConnectionType> => {\n const { driverType, sqliteConnectionFactory, connectionOptions } = options;\n\n return createAlwaysNewConnectionPool<SQLiteConnectionType>({\n driverType,\n getConnection: () => sqliteConnectionFactory(connectionOptions),\n });\n};\n\nexport type SQLitePoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = (\n | SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>\n | SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >\n | SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType>\n) & {\n driverType: SQLiteConnectionType['driverType'];\n serializer?: JSONSerializer;\n};\n\nexport type SQLitePool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> =\n | SQLiteAmbientConnectionPool<SQLiteConnectionType>\n | SQLiteSingletonConnectionPool<SQLiteConnectionType>\n | SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;\n\nexport type SQLitePoolFactoryOptions<\n SQLiteConnectionType extends AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions,\n> = Omit<\n SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>,\n 'singleton'\n> & {\n singleton?: boolean;\n};\n\nexport const toSqlitePoolOptions = <\n SQLiteConnectionType extends AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions,\n>(\n options: SQLitePoolFactoryOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions> => {\n const { singleton, ...rest } = options;\n const useSingleton = singleton ?? isInMemoryDatabase(options);\n\n if (useSingleton) {\n return { ...rest, singleton: true } as SQLitePoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n }\n return { ...rest, singleton: false } as SQLitePoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n};\n\nexport function sqlitePool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n>(\n options: SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLitePool<SQLiteConnectionType> {\n const { driverType } = options;\n\n // TODO: Handle dates and bigints\n // setSQLiteTypeParser(serializer ?? JSONSerializer);\n\n if (options.connection)\n return createAmbientConnectionPool<SQLiteConnectionType>({\n driverType,\n connection: options.connection,\n });\n\n if (options.singleton === true && options.sqliteConnectionFactory) {\n return createSingletonConnectionPool({\n driverType,\n getConnection: () =>\n options.sqliteConnectionFactory(options.connectionOptions),\n });\n }\n\n return createAlwaysNewConnectionPool({\n driverType,\n getConnection: () =>\n options.sqliteConnectionFactory!(options.connectionOptions!),\n });\n}\n","import {\n registerDefaultMigratorOptions,\n type MigratorOptions,\n} from '../../../../core';\n\nexport const DefaultSQLiteMigratorOptions: MigratorOptions = {};\n\nregisterDefaultMigratorOptions('SQLite', DefaultSQLiteMigratorOptions);\n","import { exists, SQL, type ConnectionPool } from '../../../../core';\nexport * from './schema';\n\nexport const defaultPostgreSqlDatabase = 'postgres';\n\nexport const tableExistsSQL = (tableName: string): SQL =>\n SQL`\n SELECT EXISTS (\n SELECT 1\n FROM sqlite_master\n WHERE type = 'table' AND name = ${tableName}\n ) AS \"exists\"\n `;\n\nexport const tableExists = async (\n pool: ConnectionPool,\n tableName: string,\n): Promise<boolean> => exists(pool.execute.query(tableExistsSQL(tableName)));\n","import { type DatabaseDriverType } from '../../..';\n\nexport * from './connections';\nexport * from './execute';\nexport * from './pool';\nexport * from './schema';\nexport * from './sql';\nexport * from './transactions';\n\nexport type SQLiteDatabaseName = 'SQLite';\nexport const SQLiteDatabaseName = 'SQLite';\n\nexport type SQLiteDriverType<DriverName extends string = string> =\n DatabaseDriverType<SQLiteDatabaseName, DriverName>;\n\nexport type SQLiteDatabaseType = 'SQLite';\n","import type { DatabaseConnectionString } from '../../../all';\n\nexport type SQLiteConnectionString = DatabaseConnectionString<\n 'SQLite',\n `file:${string}` | `:memory:` | `/${string}` | `./${string}`\n>;\n\nexport const SQLiteConnectionString = (\n connectionString: string,\n): SQLiteConnectionString => {\n if (\n !connectionString.startsWith('file:') &&\n connectionString !== ':memory:' &&\n !connectionString.startsWith('/') &&\n !connectionString.startsWith('./')\n ) {\n throw new Error(\n `Invalid SQLite connection string: ${connectionString}. It should start with \"file:\", \":memory:\", \"/\", or \"./\".`,\n );\n }\n return connectionString as SQLiteConnectionString;\n};\n","import {\n SQLiteConnectionString,\n sqliteSQLExecutor,\n type SQLiteDriverType,\n} from '..';\nimport {\n createAmbientConnection,\n createConnection,\n type AnyConnection,\n type Connection,\n type ConnectionOptions,\n type DatabaseTransaction,\n type DatabaseTransactionOptions,\n type InferDbClientFromConnection,\n type InferDriverTypeFromConnection,\n type InitTransaction,\n type SQLCommandOptions,\n type SQLExecutor,\n} from '../../../../core';\nimport { sqliteTransaction } from '../transactions';\n\nexport type SQLiteCommandOptions = SQLCommandOptions & {\n ignoreChangesCount?: boolean;\n};\n\nexport type SQLiteParameters =\n | object\n | string\n | bigint\n | number\n | boolean\n | null;\n\nexport type SQLiteClient = {\n connect: () => Promise<void>;\n close: () => Promise<void>;\n} & SQLExecutor;\n\nexport type SQLitePoolClient = {\n release: () => void;\n} & SQLExecutor;\n\nexport type SQLiteClientFactory<\n SQLiteClientType extends SQLiteClient = SQLiteClient,\n ClientOptions = SQLiteClientOptions,\n> = (options: ClientOptions) => SQLiteClientType;\n\nexport type SQLiteClientOrPoolClient = SQLitePoolClient | SQLiteClient;\n\nexport interface SQLiteError extends Error {\n errno: number;\n}\n\nexport const isSQLiteError = (error: unknown): error is SQLiteError => {\n if (error instanceof Error && 'code' in error) {\n return true;\n }\n\n return false;\n};\n\nexport type SQLiteClientConnection<\n Self extends AnyConnection = AnyConnection,\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n SQLiteClientType extends SQLiteClient = SQLiteClient,\n TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>,\n TransactionOptionsType extends\n DatabaseTransactionOptions = DatabaseTransactionOptions,\n> = Connection<\n Self,\n DriverType,\n SQLiteClientType,\n TransactionType,\n TransactionOptionsType\n>;\n\nexport type SQLitePoolClientConnection<\n Self extends AnyConnection = AnyConnection,\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient,\n TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>,\n TransactionOptionsType extends\n DatabaseTransactionOptions = DatabaseTransactionOptions,\n> = Connection<\n Self,\n DriverType,\n SQLitePoolClientType,\n TransactionType,\n TransactionOptionsType\n>;\n\nexport type SQLiteConnection<\n Self extends AnyConnection = AnyConnection,\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n SQLiteClientType extends SQLiteClientOrPoolClient =\n | SQLiteClient\n | SQLitePoolClient,\n TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>,\n TransactionOptionsType extends\n DatabaseTransactionOptions = DatabaseTransactionOptions,\n> =\n | (SQLiteClientType extends SQLiteClient\n ? SQLiteClientConnection<\n Self,\n DriverType,\n SQLiteClientType,\n TransactionType,\n TransactionOptionsType\n >\n : never)\n | (SQLiteClientType extends SQLitePoolClient\n ? SQLitePoolClientConnection<\n Self,\n DriverType,\n SQLiteClientType,\n TransactionType,\n TransactionOptionsType\n >\n : never);\n\nexport type AnySQLiteClientConnection =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SQLiteClientConnection<any, any>;\n\nexport type AnySQLitePoolClientConnection =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SQLitePoolClientConnection<any, any, any, any, any>;\n\nexport type AnySQLiteConnection =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SQLiteConnection<any, any, any, any, any>;\n\nexport type SQLiteConnectionOptions<\n ConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionOptions<ConnectionType> & SQLiteClientOptions;\n\nexport type SQLiteClientConnectionDefinitionOptions<\n SQLiteConnectionType extends\n AnySQLiteClientConnection = AnySQLiteClientConnection,\n ConnectionOptions = SQLiteConnectionOptions,\n> = {\n driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;\n type: 'Client';\n sqliteClientFactory: SQLiteClientFactory<\n InferDbClientFromConnection<SQLiteConnectionType>,\n ConnectionOptions\n >;\n connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;\n};\n\nexport type SQLitePoolConnectionDefinitionOptions<\n SQLiteConnectionType extends\n AnySQLitePoolClientConnection = AnySQLitePoolClientConnection,\n ConnectionOptions = SQLiteConnectionOptions,\n> = {\n driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;\n type: 'PoolClient';\n sqliteClientFactory: SQLiteClientFactory<\n InferDbClientFromConnection<SQLiteConnectionType>,\n ConnectionOptions\n >;\n connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;\n};\n\nexport type SQLiteConnectionDefinitionOptions<\n SQLiteConnectionType extends\n AnySQLitePoolClientConnection = AnySQLitePoolClientConnection,\n ClientOptions = SQLiteClientOptions,\n> =\n | SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>\n | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;\n\nexport type SQLiteConnectionFactory<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = (options: ConnectionOptions) => SQLiteConnectionType;\n\nexport type TransactionNestingCounter = {\n increment: () => void;\n decrement: () => void;\n reset: () => void;\n level: number;\n};\n\nexport const transactionNestingCounter = (): TransactionNestingCounter => {\n let transactionLevel = 0;\n\n return {\n reset: () => {\n transactionLevel = 0;\n },\n increment: () => {\n transactionLevel++;\n },\n decrement: () => {\n transactionLevel--;\n\n if (transactionLevel < 0) {\n throw new Error('Transaction level is out of bounds');\n }\n },\n get level() {\n return transactionLevel;\n },\n };\n};\n\nexport type SqliteAmbientClientConnectionOptions<\n SQLiteConnectionType extends\n AnySQLiteClientConnection = AnySQLiteClientConnection,\n TransactionType extends\n DatabaseTransaction<SQLiteConnectionType> = DatabaseTransaction<SQLiteConnectionType>,\n TransactionOptionsType extends\n DatabaseTransactionOptions = DatabaseTransactionOptions,\n> = {\n driverType: SQLiteConnectionType['driverType'];\n client: InferDbClientFromConnection<SQLiteConnectionType>;\n initTransaction?: InitTransaction<\n SQLiteConnectionType,\n TransactionType,\n TransactionOptionsType\n >;\n allowNestedTransactions?: boolean;\n};\n\nexport const sqliteAmbientClientConnection = <\n SQLiteConnectionType extends\n AnySQLiteClientConnection = AnySQLiteClientConnection,\n>(\n options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>,\n) => {\n const { client, driverType, initTransaction, allowNestedTransactions } =\n options;\n\n return createAmbientConnection<SQLiteConnectionType>({\n driverType,\n client,\n initTransaction:\n initTransaction ??\n ((connection) =>\n sqliteTransaction(\n driverType,\n connection,\n allowNestedTransactions ?? false,\n )),\n executor: () => sqliteSQLExecutor(driverType),\n });\n};\n\nexport const sqliteClientConnection = <\n SQLiteConnectionType extends\n AnySQLiteClientConnection = AnySQLiteClientConnection,\n ClientOptions = SQLiteClientOptions,\n>(\n options: SQLiteClientConnectionDefinitionOptions<\n SQLiteConnectionType,\n ClientOptions\n >,\n): SQLiteConnectionType => {\n const { connectionOptions, sqliteClientFactory } = options;\n\n let client: InferDbClientFromConnection<SQLiteConnectionType> | null = null;\n\n const connect = async (): Promise<\n InferDbClientFromConnection<SQLiteConnectionType>\n > => {\n if (client) return Promise.resolve(client);\n\n client = sqliteClientFactory(connectionOptions as ClientOptions);\n\n if (client && 'connect' in client && typeof client.connect === 'function')\n await client.connect();\n\n return client;\n };\n\n return createConnection({\n driverType: options.driverType,\n connect,\n close: async () => {\n if (client && 'close' in client && typeof client.close === 'function')\n await client.close();\n else if (\n client &&\n 'release' in client &&\n typeof client.release === 'function'\n )\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n client.release();\n },\n initTransaction: (connection) =>\n sqliteTransaction(\n options.driverType,\n connection,\n connectionOptions.transactionOptions?.allowNestedTransactions ?? false,\n ),\n executor: () => sqliteSQLExecutor(options.driverType),\n });\n};\n\nexport const sqlitePoolClientConnection = <\n SQLiteConnectionType extends\n AnySQLiteClientConnection = AnySQLiteClientConnection,\n ClientOptions = SQLiteClientOptions,\n>(\n options: SQLitePoolConnectionDefinitionOptions<\n SQLiteConnectionType,\n ClientOptions\n >,\n): SQLiteConnectionType => {\n const { connectionOptions, sqliteClientFactory } = options;\n\n let client: InferDbClientFromConnection<SQLiteConnectionType> | null = null;\n\n const connect = async (): Promise<\n InferDbClientFromConnection<SQLiteConnectionType>\n > => {\n if (client) return Promise.resolve(client);\n\n client = sqliteClientFactory(connectionOptions as ClientOptions);\n\n await client.connect();\n\n return client;\n };\n\n return createConnection({\n driverType: options.driverType,\n connect,\n close: () =>\n client !== null\n ? Promise.resolve((client as unknown as SQLitePoolClient).release())\n : Promise.resolve(),\n initTransaction: (connection) =>\n sqliteTransaction(\n options.driverType,\n connection,\n connectionOptions.transactionOptions?.allowNestedTransactions ?? false,\n ),\n executor: () => sqliteSQLExecutor(options.driverType),\n });\n};\n\nexport function sqliteConnection<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ClientOptions = SQLiteClientOptions,\n>(\n options: SQLiteConnectionDefinitionOptions<\n SQLiteConnectionType,\n ClientOptions\n >,\n): SQLiteConnectionType {\n return options.type === 'Client'\n ? sqliteClientConnection(options)\n : sqlitePoolClientConnection(options);\n}\n\nexport type InMemorySQLiteDatabase = ':memory:';\nexport const InMemorySQLiteDatabase = SQLiteConnectionString(':memory:');\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type SQLiteClientOptions = {};\n\nexport * from './connectionString';\n","import {\n SQL,\n sqlExecutor,\n type DatabaseTransaction,\n type DatabaseTransactionOptions,\n type InferDbClientFromConnection,\n} from '../../../../core';\nimport { sqliteSQLExecutor } from '../../core/execute';\nimport {\n transactionNestingCounter,\n type AnySQLiteConnection,\n type SQLiteClientOrPoolClient,\n} from '../connections';\n\nexport type SQLiteTransaction<\n ConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = DatabaseTransaction<ConnectionType>;\n\nexport const sqliteTransaction =\n <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(\n driverType: ConnectionType['driverType'],\n connection: () => ConnectionType,\n allowNestedTransactions: boolean,\n ) =>\n (\n getClient: Promise<InferDbClientFromConnection<ConnectionType>>,\n options?: {\n close: (\n client: InferDbClientFromConnection<ConnectionType>,\n error?: unknown,\n ) => Promise<void>;\n } & DatabaseTransactionOptions,\n ): DatabaseTransaction<ConnectionType> => {\n const transactionCounter = transactionNestingCounter();\n allowNestedTransactions =\n options?.allowNestedTransactions ?? allowNestedTransactions;\n\n return {\n connection: connection(),\n driverType,\n begin: async function () {\n const client = (await getClient) as SQLiteClientOrPoolClient;\n\n if (allowNestedTransactions) {\n if (transactionCounter.level >= 1) {\n transactionCounter.increment();\n await client.query(\n SQL`SAVEPOINT transaction${SQL.plain(transactionCounter.level.toString())}`,\n );\n return;\n }\n\n transactionCounter.increment();\n }\n\n await client.query(SQL`BEGIN TRANSACTION`);\n },\n commit: async function () {\n const client = (await getClient) as SQLiteClientOrPoolClient;\n\n try {\n if (allowNestedTransactions) {\n if (transactionCounter.level > 1) {\n await client.query(\n SQL`RELEASE transaction${SQL.plain(transactionCounter.level.toString())}`,\n );\n transactionCounter.decrement();\n\n return;\n }\n\n transactionCounter.reset();\n }\n await client.query(SQL`COMMIT`);\n } finally {\n if (options?.close)\n await options?.close(\n client as InferDbClientFromConnection<ConnectionType>,\n );\n }\n },\n rollback: async function (error?: unknown) {\n const client = (await getClient) as SQLiteClientOrPoolClient;\n try {\n if (allowNestedTransactions) {\n if (transactionCounter.level > 1) {\n transactionCounter.decrement();\n return;\n }\n }\n\n await client.query(SQL`ROLLBACK`);\n } finally {\n if (options?.close)\n await options?.close(\n client as InferDbClientFromConnection<ConnectionType>,\n error,\n );\n }\n },\n execute: sqlExecutor(sqliteSQLExecutor(driverType), {\n connect: () => getClient,\n }),\n };\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,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