@event-driven-io/dumbo 0.13.0-beta.2 → 0.13.0-beta.21
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-65DKXURG.js +481 -0
- package/dist/chunk-65DKXURG.js.map +1 -0
- package/dist/chunk-7WEBHXZD.cjs +481 -0
- package/dist/chunk-7WEBHXZD.cjs.map +1 -0
- package/dist/chunk-AMACBMAZ.cjs +556 -0
- package/dist/chunk-AMACBMAZ.cjs.map +1 -0
- package/dist/chunk-FC4JR2R3.js +83 -0
- package/dist/chunk-FC4JR2R3.js.map +1 -0
- package/dist/chunk-H7ZKIJHB.cjs +83 -0
- package/dist/chunk-H7ZKIJHB.cjs.map +1 -0
- package/dist/chunk-IVJ3SNPJ.js +34 -0
- package/dist/chunk-IVJ3SNPJ.js.map +1 -0
- package/dist/chunk-R7P7CNMK.cjs +34 -0
- package/dist/chunk-R7P7CNMK.cjs.map +1 -0
- package/dist/{chunk-XVV3OOQX.js → chunk-T4A6BQRA.js} +209 -58
- package/dist/chunk-T4A6BQRA.js.map +1 -0
- package/dist/{chunk-N7RWT46K.js → chunk-XO5T5N5S.js} +2135 -1613
- package/dist/chunk-XO5T5N5S.js.map +1 -0
- package/dist/{chunk-OJ34O3Q2.cjs → chunk-XOQHZABK.cjs} +2161 -1639
- package/dist/chunk-XOQHZABK.cjs.map +1 -0
- package/dist/cloudflare.cjs +451 -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 +451 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/{columnProcessors-DMPpTPqM.d.ts → columnProcessors-C7fRa54L.d.ts} +1 -1
- package/dist/{columnProcessors-BX-sH7ah.d.cts → columnProcessors-Difrrk4c.d.cts} +1 -1
- package/dist/{connectionString-B1wm0TFc.d.cts → connectionString-oeg1LD5V.d.cts} +352 -137
- package/dist/{connectionString-B1wm0TFc.d.ts → connectionString-oeg1LD5V.d.ts} +352 -137
- package/dist/index.cjs +96 -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 +101 -9
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +382 -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 +434 -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 +56 -0
- package/dist/sqlite.cjs.map +1 -0
- package/dist/{index-C0h0c380.d.cts → sqlite.d.cts} +31 -10
- package/dist/{index-C2z_XBn6.d.ts → sqlite.d.ts} +31 -10
- package/dist/sqlite.js +56 -0
- package/dist/sqlite3.cjs +240 -11
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +39 -19
- package/dist/sqlite3.d.ts +39 -19
- package/dist/sqlite3.js +251 -22
- package/dist/sqlite3.js.map +1 -1
- package/package.json +69 -29
- 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.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/sqlite3.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var _chunkL2YZQAG3cjs = require('./chunk-L2YZQAG3.cjs');
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
@@ -21,19 +20,254 @@ var _chunkL2YZQAG3cjs = require('./chunk-L2YZQAG3.cjs');
|
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
|
|
23
|
+
var _chunkAMACBMAZcjs = require('./chunk-AMACBMAZ.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
var _chunkR7P7CNMKcjs = require('./chunk-R7P7CNMK.cjs');
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
var _chunkXOQHZABKcjs = require('./chunk-XOQHZABK.cjs');
|
|
36
|
+
|
|
37
|
+
// src/storage/sqlite/sqlite3/connections/connection.ts
|
|
38
|
+
var _sqlite3 = require('sqlite3'); var _sqlite32 = _interopRequireDefault(_sqlite3);
|
|
39
|
+
var SQLite3DriverType = "SQLite:sqlite3";
|
|
40
|
+
var sqlite3Client = (options) => {
|
|
41
|
+
let db;
|
|
42
|
+
let isClosed = false;
|
|
43
|
+
const { serializer } = options;
|
|
44
|
+
const connect = () => db ? Promise.resolve() : new Promise((resolve, reject) => {
|
|
45
|
+
try {
|
|
46
|
+
db = new _sqlite32.default.Database(
|
|
47
|
+
_nullishCoalesce(_nullishCoalesce(options.fileName, () => ( options.connectionString)), () => ( _chunkAMACBMAZcjs.InMemorySQLiteDatabase)),
|
|
48
|
+
_sqlite32.default.OPEN_URI | _sqlite32.default.OPEN_READWRITE | _sqlite32.default.OPEN_CREATE,
|
|
49
|
+
(err) => {
|
|
50
|
+
if (err) {
|
|
51
|
+
reject(err);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
db.run("PRAGMA journal_mode = WAL;", (err) => {
|
|
57
|
+
if (err) {
|
|
58
|
+
reject(err);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
resolve();
|
|
62
|
+
});
|
|
63
|
+
} catch (error) {
|
|
64
|
+
reject(error);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const executeQuery = (sql, params) => new Promise((resolve, reject) => {
|
|
68
|
+
try {
|
|
69
|
+
db.all(sql, _nullishCoalesce(params, () => ( [])), (err, result) => {
|
|
70
|
+
if (err) {
|
|
71
|
+
reject(err);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
resolve(result);
|
|
75
|
+
});
|
|
76
|
+
} catch (error) {
|
|
77
|
+
reject(error);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const executeCommand = (sql, params, options2) => new Promise((resolve, reject) => {
|
|
81
|
+
try {
|
|
82
|
+
if (_optionalChain([options2, 'optionalAccess', _ => _.ignoreChangesCount]) === true) {
|
|
83
|
+
db.run(
|
|
84
|
+
sql,
|
|
85
|
+
_nullishCoalesce(params, () => ( [])),
|
|
86
|
+
function(err, rows) {
|
|
87
|
+
if (err) {
|
|
88
|
+
reject(err);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
resolve({
|
|
92
|
+
rowCount: 0,
|
|
93
|
+
rows: _nullishCoalesce(rows, () => ( []))
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
db.serialize(() => {
|
|
99
|
+
db.all(sql, _nullishCoalesce(params, () => ( [])), (err, rows) => {
|
|
100
|
+
if (err) {
|
|
101
|
+
reject(err);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
db.get(
|
|
105
|
+
"SELECT changes() as changes",
|
|
106
|
+
(changesErr, row) => {
|
|
107
|
+
if (changesErr) {
|
|
108
|
+
reject(changesErr);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
resolve({
|
|
112
|
+
rowCount: _nullishCoalesce(_optionalChain([row, 'optionalAccess', _2 => _2.changes]), () => ( 0)),
|
|
113
|
+
rows: _nullishCoalesce(rows, () => ( []))
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
} catch (error) {
|
|
120
|
+
reject(error);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
connect,
|
|
125
|
+
close: () => {
|
|
126
|
+
if (isClosed) {
|
|
127
|
+
return Promise.resolve();
|
|
128
|
+
}
|
|
129
|
+
isClosed = true;
|
|
130
|
+
if (db)
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
db.close((err) => {
|
|
133
|
+
if (err) {
|
|
134
|
+
reject(err);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
resolve();
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
return Promise.resolve();
|
|
141
|
+
},
|
|
142
|
+
query: async (sql, _options) => {
|
|
143
|
+
const { query, params } = _chunkAMACBMAZcjs.sqliteFormatter.format(sql, {
|
|
144
|
+
serializer
|
|
145
|
+
});
|
|
146
|
+
const result = await executeQuery(
|
|
147
|
+
query,
|
|
148
|
+
params
|
|
149
|
+
);
|
|
150
|
+
return { rowCount: result.length, rows: result };
|
|
151
|
+
},
|
|
152
|
+
batchQuery: async (sqls, _options) => {
|
|
153
|
+
const results = [];
|
|
154
|
+
for (const sql of sqls) {
|
|
155
|
+
const { query, params } = _chunkAMACBMAZcjs.sqliteFormatter.format(sql, {
|
|
156
|
+
serializer
|
|
157
|
+
});
|
|
158
|
+
const result = await executeQuery(
|
|
159
|
+
query,
|
|
160
|
+
params
|
|
161
|
+
);
|
|
162
|
+
results.push({ rowCount: result.length, rows: result });
|
|
163
|
+
}
|
|
164
|
+
return results;
|
|
165
|
+
},
|
|
166
|
+
command: async (sql, options2) => {
|
|
167
|
+
const { query, params } = _chunkAMACBMAZcjs.sqliteFormatter.format(sql, {
|
|
168
|
+
serializer
|
|
169
|
+
});
|
|
170
|
+
return executeCommand(
|
|
171
|
+
query,
|
|
172
|
+
params,
|
|
173
|
+
options2
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
batchCommand: async (sqls, options2) => {
|
|
177
|
+
const results = [];
|
|
178
|
+
for (let i = 0; i < sqls.length; i++) {
|
|
179
|
+
const { query, params } = _chunkAMACBMAZcjs.sqliteFormatter.format(sqls[i], {
|
|
180
|
+
serializer
|
|
181
|
+
});
|
|
182
|
+
const result = await executeCommand(
|
|
183
|
+
query,
|
|
184
|
+
params,
|
|
185
|
+
options2
|
|
186
|
+
);
|
|
187
|
+
results.push(result);
|
|
188
|
+
if (_optionalChain([options2, 'optionalAccess', _3 => _3.assertChanges]) && (_nullishCoalesce(result.rowCount, () => ( 0))) === 0) {
|
|
189
|
+
throw new (0, _chunkXOQHZABKcjs.BatchCommandNoChangesError)(i);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return results;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
var checkConnection = async (fileName, serializer) => {
|
|
197
|
+
const client = sqlite3Client({
|
|
198
|
+
fileName,
|
|
199
|
+
serializer
|
|
200
|
+
});
|
|
201
|
+
try {
|
|
202
|
+
await client.query(_chunkXOQHZABKcjs.SQL`SELECT 1`);
|
|
203
|
+
return { successful: true };
|
|
204
|
+
} catch (error) {
|
|
205
|
+
const code = error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
206
|
+
return {
|
|
207
|
+
successful: false,
|
|
208
|
+
errorType: code === "SQLITE_CANTOPEN" ? "ConnectionRefused" : code === "SQLITE_AUTH" ? "Authentication" : "Unknown",
|
|
209
|
+
code,
|
|
210
|
+
error
|
|
211
|
+
};
|
|
212
|
+
} finally {
|
|
213
|
+
await client.close();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
var sqlite3Connection = (options) => _chunkAMACBMAZcjs.sqliteConnection.call(void 0, {
|
|
217
|
+
type: "Client",
|
|
218
|
+
driverType: SQLite3DriverType,
|
|
219
|
+
sqliteClientFactory: (connectionOptions) => {
|
|
220
|
+
if ("client" in connectionOptions && connectionOptions.client) {
|
|
221
|
+
return connectionOptions.client;
|
|
222
|
+
}
|
|
223
|
+
return sqlite3Client({
|
|
224
|
+
...connectionOptions,
|
|
225
|
+
serializer: options.serializer
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
connectionOptions: options,
|
|
229
|
+
serializer: options.serializer
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// src/storage/sqlite/sqlite3/index.ts
|
|
233
|
+
var sqlite3Pool = (options) => _chunkAMACBMAZcjs.sqlitePool.call(void 0,
|
|
234
|
+
_chunkAMACBMAZcjs.toSqlitePoolOptions.call(void 0, {
|
|
235
|
+
...options,
|
|
236
|
+
driverType: SQLite3DriverType,
|
|
237
|
+
..."connection" in options ? {} : {
|
|
238
|
+
connectionOptions: options,
|
|
239
|
+
sqliteConnectionFactory: (opts) => sqlite3Connection({
|
|
240
|
+
...opts,
|
|
241
|
+
serializer: _nullishCoalesce(options.serializer, () => ( _chunkXOQHZABKcjs.JSONSerializer))
|
|
242
|
+
})
|
|
243
|
+
}
|
|
244
|
+
})
|
|
245
|
+
);
|
|
246
|
+
var tryParseConnectionString = (connectionString) => {
|
|
247
|
+
try {
|
|
248
|
+
return _chunkAMACBMAZcjs.SQLiteConnectionString.call(void 0, connectionString);
|
|
249
|
+
} catch (e) {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
var sqlite3DumboDriver = {
|
|
254
|
+
driverType: SQLite3DriverType,
|
|
255
|
+
createPool: (options) => sqlite3Pool(options),
|
|
256
|
+
sqlFormatter: _chunkAMACBMAZcjs.sqliteFormatter,
|
|
257
|
+
defaultMigratorOptions: _chunkAMACBMAZcjs.DefaultSQLiteMigratorOptions,
|
|
258
|
+
canHandle: _chunkXOQHZABKcjs.canHandleDriverWithConnectionString.call(void 0,
|
|
259
|
+
SQLite3DriverType,
|
|
260
|
+
tryParseConnectionString
|
|
261
|
+
),
|
|
262
|
+
databaseMetadata: _chunkR7P7CNMKcjs.sqliteMetadata
|
|
263
|
+
};
|
|
264
|
+
var useSqlite3DumboDriver = () => {
|
|
265
|
+
_chunkXOQHZABKcjs.dumboDatabaseDriverRegistry.register(SQLite3DriverType, sqlite3DumboDriver);
|
|
266
|
+
};
|
|
267
|
+
useSqlite3DumboDriver();
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
37
271
|
|
|
38
272
|
|
|
39
273
|
|
|
@@ -63,10 +297,5 @@ require('./chunk-OJ34O3Q2.cjs');
|
|
|
63
297
|
|
|
64
298
|
|
|
65
299
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
exports.DefaultSQLiteMigratorOptions = _chunkIYEHOE4Scjs.DefaultSQLiteMigratorOptions; exports.InMemorySQLiteDatabase = _chunkIYEHOE4Scjs.InMemorySQLiteDatabase; exports.SQLite3DriverType = _chunkL2YZQAG3cjs.SQLite3DriverType; exports.SQLiteConnectionString = _chunkIYEHOE4Scjs.SQLiteConnectionString; exports.SQLiteDatabaseName = _chunkIYEHOE4Scjs.SQLiteDatabaseName; exports.checkConnection = _chunkL2YZQAG3cjs.checkConnection; exports.connectionPool = _chunkL2YZQAG3cjs.sqlite3Pool; exports.databaseDriver = _chunkL2YZQAG3cjs.sqlite3DatabaseDriver; exports.defaultPostgreSqlDatabase = _chunkIYEHOE4Scjs.defaultPostgreSqlDatabase; exports.isInMemoryDatabase = _chunkIYEHOE4Scjs.isInMemoryDatabase; exports.isSQLiteError = _chunkIYEHOE4Scjs.isSQLiteError; exports.sqlite3Client = _chunkL2YZQAG3cjs.sqlite3Client; exports.sqlite3Connection = _chunkL2YZQAG3cjs.sqlite3Connection; exports.sqlite3DatabaseDriver = _chunkL2YZQAG3cjs.sqlite3DatabaseDriver; exports.sqlite3Pool = _chunkL2YZQAG3cjs.sqlite3Pool; exports.sqliteAlwaysNewConnectionPool = _chunkIYEHOE4Scjs.sqliteAlwaysNewConnectionPool; exports.sqliteAmbientClientConnection = _chunkIYEHOE4Scjs.sqliteAmbientClientConnection; exports.sqliteAmbientConnectionPool = _chunkIYEHOE4Scjs.sqliteAmbientConnectionPool; exports.sqliteClient = _chunkL2YZQAG3cjs.sqlite3Client; exports.sqliteClientConnection = _chunkIYEHOE4Scjs.sqliteClientConnection; exports.sqliteConnection = _chunkIYEHOE4Scjs.sqliteConnection; exports.sqliteExecute = _chunkIYEHOE4Scjs.sqliteExecute; exports.sqliteFormatter = _chunkIYEHOE4Scjs.sqliteFormatter; exports.sqlitePool = _chunkIYEHOE4Scjs.sqlitePool; exports.sqlitePoolClientConnection = _chunkIYEHOE4Scjs.sqlitePoolClientConnection; exports.sqliteSQLExecutor = _chunkIYEHOE4Scjs.sqliteSQLExecutor; exports.sqliteSingletonConnectionPool = _chunkIYEHOE4Scjs.sqliteSingletonConnectionPool; exports.sqliteTransaction = _chunkIYEHOE4Scjs.sqliteTransaction; exports.tableExists = _chunkIYEHOE4Scjs.tableExists; exports.tableExistsSQL = _chunkIYEHOE4Scjs.tableExistsSQL; exports.toSqlitePoolOptions = _chunkIYEHOE4Scjs.toSqlitePoolOptions; exports.transactionNestingCounter = _chunkIYEHOE4Scjs.transactionNestingCounter; exports.useSqlite3DatabaseDriver = _chunkL2YZQAG3cjs.useSqlite3DatabaseDriver;
|
|
300
|
+
exports.DefaultSQLiteMigratorOptions = _chunkAMACBMAZcjs.DefaultSQLiteMigratorOptions; exports.InMemorySQLiteDatabase = _chunkAMACBMAZcjs.InMemorySQLiteDatabase; exports.SQLite3DriverType = SQLite3DriverType; exports.SQLiteConnectionString = _chunkAMACBMAZcjs.SQLiteConnectionString; exports.SQLiteDatabaseName = _chunkAMACBMAZcjs.SQLiteDatabaseName; exports.checkConnection = checkConnection; exports.defaultSQLiteDatabase = _chunkR7P7CNMKcjs.defaultSQLiteDatabase; exports.isInMemoryDatabase = _chunkAMACBMAZcjs.isInMemoryDatabase; exports.isSQLiteError = _chunkAMACBMAZcjs.isSQLiteError; exports.mapSqliteError = _chunkAMACBMAZcjs.mapSqliteError; exports.sqlite3Client = sqlite3Client; exports.sqlite3Connection = sqlite3Connection; exports.sqlite3DumboDriver = sqlite3DumboDriver; exports.sqlite3Pool = sqlite3Pool; exports.sqliteAlwaysNewConnectionPool = _chunkAMACBMAZcjs.sqliteAlwaysNewConnectionPool; exports.sqliteAmbientClientConnection = _chunkAMACBMAZcjs.sqliteAmbientClientConnection; exports.sqliteAmbientConnectionPool = _chunkAMACBMAZcjs.sqliteAmbientConnectionPool; exports.sqliteClientConnection = _chunkAMACBMAZcjs.sqliteClientConnection; exports.sqliteConnection = _chunkAMACBMAZcjs.sqliteConnection; exports.sqliteExecute = _chunkAMACBMAZcjs.sqliteExecute; exports.sqliteFormatter = _chunkAMACBMAZcjs.sqliteFormatter; exports.sqliteMetadata = _chunkR7P7CNMKcjs.sqliteMetadata; exports.sqlitePool = _chunkAMACBMAZcjs.sqlitePool; exports.sqlitePoolClientConnection = _chunkAMACBMAZcjs.sqlitePoolClientConnection; exports.sqliteSQLExecutor = _chunkAMACBMAZcjs.sqliteSQLExecutor; exports.sqliteSingletonConnectionPool = _chunkAMACBMAZcjs.sqliteSingletonConnectionPool; exports.sqliteTransaction = _chunkAMACBMAZcjs.sqliteTransaction; exports.tableExists = _chunkR7P7CNMKcjs.tableExists; exports.toSqlitePoolOptions = _chunkAMACBMAZcjs.toSqlitePoolOptions; exports.transactionNestingCounter = _chunkAMACBMAZcjs.transactionNestingCounter; exports.useSqlite3DumboDriver = useSqlite3DumboDriver;
|
|
72
301
|
//# sourceMappingURL=sqlite3.cjs.map
|
package/dist/sqlite3.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/sqlite3.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,iuEAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/sqlite3.cjs"}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/sqlite3.cjs","../src/storage/sqlite/sqlite3/connections/connection.ts","../src/storage/sqlite/sqlite3/index.ts"],"names":["options"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACpCA,oFAAoB;AA8Bb,IAAM,kBAAA,EAAuC,gBAAA;AA6B7C,IAAM,cAAA,EAAgB,CAC3B,OAAA,EAAA,GAGiB;AACjB,EAAA,IAAI,EAAA;AAEJ,EAAA,IAAI,SAAA,EAAW,KAAA;AAEf,EAAA,MAAM,EAAE,WAAW,EAAA,EAAI,OAAA;AAEvB,EAAA,MAAM,QAAA,EAA+B,CAAA,EAAA,GACnC,GAAA,EACI,OAAA,CAAQ,OAAA,CAAQ,EAAA,EAChB,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,EAAA,GAAW;AAC/B,IAAA,IAAI;AACF,MAAA,GAAA,EAAK,IAAI,iBAAA,CAAQ,QAAA;AAAA,0CACf,OAAA,CAAQ,QAAA,UACN,OAAA,CAAQ,kBAAA,UACR,0CAAA;AA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GAAM;AACzC,EAAA,6CAAA,CAA4B,QAAA,CAAS,iBAAA,EAAmB,kBAAkB,CAAA;AAC5E,CAAA;AAMA,qBAAA,CAAsB,CAAA;AFsLtB;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,w9DAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/sqlite3.cjs","sourcesContent":[null,"import sqlite3 from 'sqlite3';\nimport type { JSONSerializer } from '../../../../core';\nimport {\n BatchCommandNoChangesError,\n SQL,\n type Connection,\n type QueryResult,\n type QueryResultRow,\n type SQLQueryOptions,\n} from '../../../../core';\nimport type {\n SQLiteClient,\n SQLiteClientOrPoolClient,\n SQLiteConnectionOptions,\n SQLiteDriverType,\n SQLiteFileNameOrConnectionString,\n SQLiteTransaction,\n SQLiteTransactionOptions,\n} from '../../core';\nimport {\n InMemorySQLiteDatabase,\n sqliteConnection,\n type BatchSQLiteCommandOptions,\n type SQLiteClientOptions,\n type SQLiteCommandOptions,\n type SQLiteParameters,\n} from '../../core/connections';\nimport { sqliteFormatter } from '../../core/sql/formatter';\n\nexport type SQLite3DriverType = SQLiteDriverType<'sqlite3'>;\nexport const SQLite3DriverType: SQLite3DriverType = 'SQLite:sqlite3';\n\nexport type ConnectionCheckResult =\n | { successful: true }\n | {\n successful: false;\n code: string | undefined;\n errorType: 'ConnectionRefused' | 'Authentication' | 'Unknown';\n error: unknown;\n };\n\nexport type SQLite3ClientOptions = SQLiteClientOptions &\n SQLiteFileNameOrConnectionString;\n\nexport type SQLite3Client = SQLiteClientOrPoolClient;\n\nexport type SQLite3ConnectionOptions = SQLiteConnectionOptions &\n ((SQLite3ClientOptions & { client?: never }) | { client: SQLite3Client });\n\nexport type SQLite3Connection<\n ClientType extends SQLiteClientOrPoolClient = SQLiteClientOrPoolClient,\n> = Connection<\n SQLite3Connection,\n SQLite3DriverType,\n ClientType,\n SQLiteTransaction<SQLite3Connection>,\n SQLiteTransactionOptions\n>;\n\nexport const sqlite3Client = (\n options: SQLite3ClientOptions & {\n serializer: JSONSerializer;\n },\n): SQLiteClient => {\n let db: sqlite3.Database;\n\n let isClosed = false;\n\n const { serializer } = options;\n\n const connect: () => Promise<void> = () =>\n db\n ? Promise.resolve() // If db is already initialized, resolve immediately\n : new Promise((resolve, reject) => {\n try {\n db = new sqlite3.Database(\n options.fileName ??\n options.connectionString ??\n InMemorySQLiteDatabase,\n sqlite3.OPEN_URI | sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE,\n (err) => {\n if (err) {\n reject(err);\n return;\n }\n },\n );\n db.run('PRAGMA journal_mode = WAL;', (err) => {\n if (err) {\n reject(err);\n return;\n }\n\n resolve();\n });\n } catch (error) {\n reject(error as Error);\n }\n });\n\n const executeQuery = <T>(\n sql: string,\n params?: SQLiteParameters[],\n ): Promise<T[]> =>\n new Promise((resolve, reject) => {\n try {\n db.all(sql, params ?? [], (err: Error | null, result: T[]) => {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(result);\n });\n } catch (error) {\n reject(error as Error);\n }\n });\n\n const executeCommand = <Result extends QueryResultRow = QueryResultRow>(\n sql: string,\n params?: SQLiteParameters[],\n options?: SQLiteCommandOptions,\n ): Promise<QueryResult<Result>> =>\n new Promise((resolve, reject) => {\n try {\n if (options?.ignoreChangesCount === true) {\n db.run(\n sql,\n params ?? [],\n function (err: Error | null, rows: Result[]) {\n if (err) {\n reject(err);\n return;\n }\n resolve({\n rowCount: 0,\n rows: rows ?? [],\n });\n },\n );\n }\n // OD: 2026-01-21\n // This is needed as SQLite does not return changes count properly\n // We need to query it separately with SELECT changes()\n // This may be fixed eventually in sqlite3 library as Node.js team did here:\n // https://github.com/nodejs/node/issues/57344\n // But for now, we do it manually, as a workaround\n // We also serialize it to avoid race conditions\n db.serialize(() => {\n db.all(sql, params ?? [], (err: Error | null, rows: Result[]) => {\n if (err) {\n reject(err);\n return;\n }\n db.get(\n 'SELECT changes() as changes',\n (changesErr: Error | null, row: { changes: number } | null) => {\n if (changesErr) {\n reject(changesErr);\n return;\n }\n resolve({\n rowCount: row?.changes ?? 0,\n rows: rows ?? [],\n });\n },\n );\n });\n });\n } catch (error) {\n reject(error as Error);\n }\n });\n\n return {\n connect,\n close: (): Promise<void> => {\n if (isClosed) {\n return Promise.resolve();\n }\n isClosed = true;\n if (db)\n return new Promise((resolve, reject) => {\n db.close((err: Error | null) => {\n if (err) {\n reject(err);\n return;\n }\n\n resolve();\n });\n });\n return Promise.resolve();\n },\n query: async <Result extends QueryResultRow = QueryResultRow>(\n sql: SQL,\n _options?: SQLQueryOptions,\n ): Promise<QueryResult<Result>> => {\n const { query, params } = sqliteFormatter.format(sql, {\n serializer,\n });\n const result = await executeQuery<Result>(\n query,\n params as SQLiteParameters[],\n );\n return { rowCount: result.length, rows: result };\n },\n batchQuery: async <Result extends QueryResultRow = QueryResultRow>(\n sqls: SQL[],\n _options?: SQLQueryOptions,\n ): Promise<QueryResult<Result>[]> => {\n const results: QueryResult<Result>[] = [];\n for (const sql of sqls) {\n const { query, params } = sqliteFormatter.format(sql, {\n serializer,\n });\n const result = await executeQuery<Result>(\n query,\n params as SQLiteParameters[],\n );\n results.push({ rowCount: result.length, rows: result });\n }\n return results;\n },\n command: async <Result extends QueryResultRow = QueryResultRow>(\n sql: SQL,\n options?: SQLiteCommandOptions,\n ): Promise<QueryResult<Result>> => {\n const { query, params } = sqliteFormatter.format(sql, {\n serializer,\n });\n\n return executeCommand<Result>(\n query,\n params as SQLiteParameters[],\n options,\n );\n },\n batchCommand: async <Result extends QueryResultRow = QueryResultRow>(\n sqls: SQL[],\n options?: BatchSQLiteCommandOptions,\n ): Promise<QueryResult<Result>[]> => {\n const results: QueryResult<Result>[] = [];\n\n for (let i = 0; i < sqls.length; i++) {\n const { query, params } = sqliteFormatter.format(sqls[i]!, {\n serializer,\n });\n const result = await executeCommand<Result>(\n query,\n params as SQLiteParameters[],\n options,\n );\n results.push(result);\n\n if (options?.assertChanges && (result.rowCount ?? 0) === 0) {\n throw new BatchCommandNoChangesError(i);\n }\n }\n return results;\n },\n };\n};\n\nexport const checkConnection = async (\n fileName: string,\n serializer: JSONSerializer,\n): Promise<ConnectionCheckResult> => {\n const client = sqlite3Client({\n fileName,\n serializer,\n });\n\n try {\n await client.query(SQL`SELECT 1`);\n return { successful: true };\n } catch (error) {\n const code =\n error instanceof Error &&\n 'code' in error &&\n typeof error.code === 'string'\n ? error.code\n : undefined;\n\n return {\n successful: false,\n errorType:\n code === 'SQLITE_CANTOPEN'\n ? 'ConnectionRefused'\n : code === 'SQLITE_AUTH'\n ? 'Authentication'\n : 'Unknown',\n code,\n error,\n };\n } finally {\n await client.close();\n }\n};\n\nexport const sqlite3Connection = (\n options: SQLite3ConnectionOptions & { serializer: JSONSerializer },\n) =>\n sqliteConnection<SQLite3Connection, SQLite3ConnectionOptions>({\n type: 'Client',\n driverType: SQLite3DriverType,\n sqliteClientFactory: (connectionOptions) => {\n if ('client' in connectionOptions && connectionOptions.client) {\n return connectionOptions.client;\n }\n return sqlite3Client({\n ...connectionOptions,\n serializer: options.serializer,\n });\n },\n connectionOptions: options,\n serializer: options.serializer,\n });\n","export * from './connections';\nimport {\n canHandleDriverWithConnectionString,\n dumboDatabaseDriverRegistry,\n JSONSerializer,\n type DumboConnectionOptions,\n type DumboDatabaseDriver,\n} from '../../../core';\nimport {\n DefaultSQLiteMigratorOptions,\n SQLiteConnectionString,\n sqliteFormatter,\n sqliteMetadata,\n sqlitePool,\n toSqlitePoolOptions,\n type SQLitePool,\n type SQLitePoolOptions,\n} from '../core';\nimport {\n sqlite3Connection,\n SQLite3DriverType,\n type SQLite3Connection,\n type SQLite3ConnectionOptions,\n} from './connections';\n\nexport type SQLite3DumboOptions = Omit<\n SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>,\n 'driverType'\n> &\n SQLite3ConnectionOptions & { serializer?: JSONSerializer };\n\nexport type SQLite3PoolOptions = SQLite3DumboOptions;\n\nexport type Sqlite3Pool = SQLitePool<SQLite3Connection>;\n\nexport const sqlite3Pool = (options: SQLite3DumboOptions) =>\n sqlitePool(\n toSqlitePoolOptions({\n ...options,\n driverType: SQLite3DriverType,\n ...('connection' in options\n ? {}\n : {\n connectionOptions: options as SQLite3ConnectionOptions,\n sqliteConnectionFactory: (opts: SQLite3ConnectionOptions) =>\n sqlite3Connection({\n ...opts,\n serializer: options.serializer ?? JSONSerializer,\n }),\n }),\n }),\n );\n\nconst tryParseConnectionString = (connectionString: string) => {\n try {\n return SQLiteConnectionString(connectionString);\n } catch {\n return null;\n }\n};\n\nexport const sqlite3DumboDriver = {\n driverType: SQLite3DriverType,\n createPool: (options) => sqlite3Pool(options as SQLite3DumboOptions),\n sqlFormatter: sqliteFormatter,\n defaultMigratorOptions: DefaultSQLiteMigratorOptions,\n canHandle: canHandleDriverWithConnectionString(\n SQLite3DriverType,\n tryParseConnectionString,\n ),\n databaseMetadata: sqliteMetadata,\n} satisfies DumboDatabaseDriver<\n SQLite3Connection,\n SQLite3DumboOptions,\n Sqlite3Pool\n>;\n\nexport const useSqlite3DumboDriver = () => {\n dumboDatabaseDriverRegistry.register(SQLite3DriverType, sqlite3DumboDriver);\n};\n\nexport type SQLite3DumboConnectionOptions = DumboConnectionOptions<\n typeof sqlite3DumboDriver\n> & { connectionString: string | SQLiteConnectionString };\n\nuseSqlite3DumboDriver();\n\nexport * from './connections';\nexport * from './formatter';\nexport * from './transactions';\n"]}
|
package/dist/sqlite3.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { C as Connection,
|
|
1
|
+
import { SQLiteDriverType, SQLiteClientOptions, SQLiteFileNameOrConnectionString, SQLiteClientOrPoolClient, SQLiteConnectionOptions, SQLiteTransaction, SQLiteTransactionOptions, SQLiteClient, SQLitePoolOptions, SQLitePool, SQLiteConnectionString } from './sqlite.cjs';
|
|
2
|
+
export { AnySQLiteClientConnection, AnySQLiteConnection, AnySQLitePoolClientConnection, BatchSQLiteCommandOptions, DefaultSQLiteMigratorOptions, InMemorySQLiteDatabase, SQLiteAlwaysNewConnectionPool, SQLiteAmbientConnectionPool, SQLiteClientConnection, SQLiteClientConnectionDefinitionOptions, SQLiteClientFactory, SQLiteCommandOptions, SQLiteConnection, SQLiteConnectionDefinitionOptions, SQLiteConnectionFactory, SQLiteDatabaseName, SQLiteDatabaseType, SQLiteError, SQLiteErrorMapper, SQLiteParameters, SQLitePoolClient, SQLitePoolClientConnection, SQLitePoolConnectionDefinitionOptions, SQLitePoolFactoryOptions, SQLiteSQLExecutor, SQLiteSingletonConnectionPool, SQLiteTransactionMode, SqliteAmbientClientConnectionOptions, TransactionNestingCounter, defaultSQLiteDatabase, isInMemoryDatabase, isSQLiteError, mapSqliteError, sqliteAlwaysNewConnectionPool, sqliteAmbientClientConnection, sqliteAmbientConnectionPool, sqliteClientConnection, sqliteConnection, sqliteExecute, sqliteFormatter, sqliteMetadata, sqlitePool, sqlitePoolClientConnection, sqliteSQLExecutor, sqliteSingletonConnectionPool, sqliteTransaction, tableExists, toSqlitePoolOptions, transactionNestingCounter } from './sqlite.cjs';
|
|
3
|
+
import { C as Connection, J as JSONSerializer, c as DumboDatabaseDriver, d as SQLFormatter, M as MigratorOptions, e as DatabaseMetadata, f as DumboConnectionOptions } from './connectionString-oeg1LD5V.cjs';
|
|
4
4
|
|
|
5
5
|
type SQLite3DriverType = SQLiteDriverType<'sqlite3'>;
|
|
6
6
|
declare const SQLite3DriverType: SQLite3DriverType;
|
|
@@ -19,66 +19,86 @@ type SQLite3ConnectionOptions = SQLiteConnectionOptions & ((SQLite3ClientOptions
|
|
|
19
19
|
}) | {
|
|
20
20
|
client: SQLite3Client;
|
|
21
21
|
});
|
|
22
|
-
type SQLite3Connection<ClientType extends SQLiteClientOrPoolClient = SQLiteClientOrPoolClient> = Connection<SQLite3Connection, SQLite3DriverType, ClientType, SQLiteTransaction<SQLite3Connection>,
|
|
23
|
-
declare const sqlite3Client: (options: SQLite3ClientOptions
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
type SQLite3Connection<ClientType extends SQLiteClientOrPoolClient = SQLiteClientOrPoolClient> = Connection<SQLite3Connection, SQLite3DriverType, ClientType, SQLiteTransaction<SQLite3Connection>, SQLiteTransactionOptions>;
|
|
23
|
+
declare const sqlite3Client: (options: SQLite3ClientOptions & {
|
|
24
|
+
serializer: JSONSerializer;
|
|
25
|
+
}) => SQLiteClient;
|
|
26
|
+
declare const checkConnection: (fileName: string, serializer: JSONSerializer) => Promise<ConnectionCheckResult>;
|
|
27
|
+
declare const sqlite3Connection: (options: SQLite3ConnectionOptions & {
|
|
28
|
+
serializer: JSONSerializer;
|
|
29
|
+
}) => SQLite3Connection<SQLiteClientOrPoolClient>;
|
|
26
30
|
|
|
27
|
-
type SQLite3DumboOptions = Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, 'driverType'> & SQLite3ConnectionOptions
|
|
31
|
+
type SQLite3DumboOptions = Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, 'driverType'> & SQLite3ConnectionOptions & {
|
|
32
|
+
serializer?: JSONSerializer;
|
|
33
|
+
};
|
|
34
|
+
type SQLite3PoolOptions = SQLite3DumboOptions;
|
|
35
|
+
type Sqlite3Pool = SQLitePool<SQLite3Connection>;
|
|
28
36
|
declare const sqlite3Pool: (options: SQLite3DumboOptions) => SQLitePool<SQLite3Connection>;
|
|
29
|
-
declare const
|
|
37
|
+
declare const sqlite3DumboDriver: {
|
|
30
38
|
driverType: "SQLite:sqlite3";
|
|
31
39
|
createPool: (options: ({
|
|
32
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
40
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
33
41
|
driverType?: "SQLite:sqlite3";
|
|
34
42
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
35
43
|
fileName: string | SQLiteConnectionString;
|
|
36
44
|
connectionString?: never;
|
|
37
45
|
} & {
|
|
38
46
|
client?: never;
|
|
47
|
+
} & {
|
|
48
|
+
serializer?: JSONSerializer;
|
|
39
49
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
40
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
50
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
41
51
|
driverType?: "SQLite:sqlite3";
|
|
42
52
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
43
53
|
connectionString: string | SQLiteConnectionString;
|
|
44
54
|
fileName?: never;
|
|
45
55
|
} & {
|
|
46
56
|
client?: never;
|
|
57
|
+
} & {
|
|
58
|
+
serializer?: JSONSerializer;
|
|
47
59
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
48
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
60
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
49
61
|
driverType?: "SQLite:sqlite3";
|
|
50
62
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
51
63
|
client: SQLite3Client;
|
|
64
|
+
} & {
|
|
65
|
+
serializer?: JSONSerializer;
|
|
52
66
|
}, "driverType" | "driver" | "connectionString">)) => SQLitePool<SQLite3Connection>;
|
|
53
67
|
sqlFormatter: SQLFormatter;
|
|
54
68
|
defaultMigratorOptions: MigratorOptions;
|
|
55
|
-
getDatabaseNameOrDefault: () => SQLiteConnectionString;
|
|
56
69
|
canHandle: (options: ({
|
|
57
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
70
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
58
71
|
driverType?: "SQLite:sqlite3";
|
|
59
72
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
60
73
|
fileName: string | SQLiteConnectionString;
|
|
61
74
|
connectionString?: never;
|
|
62
75
|
} & {
|
|
63
76
|
client?: never;
|
|
77
|
+
} & {
|
|
78
|
+
serializer?: JSONSerializer;
|
|
64
79
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
65
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
80
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
66
81
|
driverType?: "SQLite:sqlite3";
|
|
67
82
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
68
83
|
connectionString: string | SQLiteConnectionString;
|
|
69
84
|
fileName?: never;
|
|
70
85
|
} & {
|
|
71
86
|
client?: never;
|
|
87
|
+
} & {
|
|
88
|
+
serializer?: JSONSerializer;
|
|
72
89
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
73
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
90
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
74
91
|
driverType?: "SQLite:sqlite3";
|
|
75
92
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
76
93
|
client: SQLite3Client;
|
|
94
|
+
} & {
|
|
95
|
+
serializer?: JSONSerializer;
|
|
77
96
|
}, "driverType" | "driver" | "connectionString">)) => boolean;
|
|
97
|
+
databaseMetadata: DatabaseMetadata<false, false, false>;
|
|
78
98
|
};
|
|
79
|
-
declare const
|
|
80
|
-
type SQLite3DumboConnectionOptions = DumboConnectionOptions<typeof
|
|
99
|
+
declare const useSqlite3DumboDriver: () => void;
|
|
100
|
+
type SQLite3DumboConnectionOptions = DumboConnectionOptions<typeof sqlite3DumboDriver> & {
|
|
81
101
|
connectionString: string | SQLiteConnectionString;
|
|
82
102
|
};
|
|
83
103
|
|
|
84
|
-
export { type ConnectionCheckResult, type SQLite3Client, type SQLite3ClientOptions, type SQLite3Connection, type SQLite3ConnectionOptions, SQLite3DriverType, type SQLite3DumboConnectionOptions, type SQLite3DumboOptions, SQLiteClient, SQLiteClientOptions, SQLiteClientOrPoolClient, SQLiteConnectionOptions, SQLiteConnectionString, SQLiteDriverType, SQLiteFileNameOrConnectionString, SQLitePool, SQLitePoolOptions, SQLiteTransaction,
|
|
104
|
+
export { type ConnectionCheckResult, type SQLite3Client, type SQLite3ClientOptions, type SQLite3Connection, type SQLite3ConnectionOptions, SQLite3DriverType, type SQLite3DumboConnectionOptions, type SQLite3DumboOptions, type SQLite3PoolOptions, SQLiteClient, SQLiteClientOptions, SQLiteClientOrPoolClient, SQLiteConnectionOptions, SQLiteConnectionString, SQLiteDriverType, SQLiteFileNameOrConnectionString, SQLitePool, SQLitePoolOptions, SQLiteTransaction, SQLiteTransactionOptions, type Sqlite3Pool, checkConnection, sqlite3Client, sqlite3Connection, sqlite3DumboDriver, sqlite3Pool, useSqlite3DumboDriver };
|
package/dist/sqlite3.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { C as Connection,
|
|
1
|
+
import { SQLiteDriverType, SQLiteClientOptions, SQLiteFileNameOrConnectionString, SQLiteClientOrPoolClient, SQLiteConnectionOptions, SQLiteTransaction, SQLiteTransactionOptions, SQLiteClient, SQLitePoolOptions, SQLitePool, SQLiteConnectionString } from './sqlite.js';
|
|
2
|
+
export { AnySQLiteClientConnection, AnySQLiteConnection, AnySQLitePoolClientConnection, BatchSQLiteCommandOptions, DefaultSQLiteMigratorOptions, InMemorySQLiteDatabase, SQLiteAlwaysNewConnectionPool, SQLiteAmbientConnectionPool, SQLiteClientConnection, SQLiteClientConnectionDefinitionOptions, SQLiteClientFactory, SQLiteCommandOptions, SQLiteConnection, SQLiteConnectionDefinitionOptions, SQLiteConnectionFactory, SQLiteDatabaseName, SQLiteDatabaseType, SQLiteError, SQLiteErrorMapper, SQLiteParameters, SQLitePoolClient, SQLitePoolClientConnection, SQLitePoolConnectionDefinitionOptions, SQLitePoolFactoryOptions, SQLiteSQLExecutor, SQLiteSingletonConnectionPool, SQLiteTransactionMode, SqliteAmbientClientConnectionOptions, TransactionNestingCounter, defaultSQLiteDatabase, isInMemoryDatabase, isSQLiteError, mapSqliteError, sqliteAlwaysNewConnectionPool, sqliteAmbientClientConnection, sqliteAmbientConnectionPool, sqliteClientConnection, sqliteConnection, sqliteExecute, sqliteFormatter, sqliteMetadata, sqlitePool, sqlitePoolClientConnection, sqliteSQLExecutor, sqliteSingletonConnectionPool, sqliteTransaction, tableExists, toSqlitePoolOptions, transactionNestingCounter } from './sqlite.js';
|
|
3
|
+
import { C as Connection, J as JSONSerializer, c as DumboDatabaseDriver, d as SQLFormatter, M as MigratorOptions, e as DatabaseMetadata, f as DumboConnectionOptions } from './connectionString-oeg1LD5V.js';
|
|
4
4
|
|
|
5
5
|
type SQLite3DriverType = SQLiteDriverType<'sqlite3'>;
|
|
6
6
|
declare const SQLite3DriverType: SQLite3DriverType;
|
|
@@ -19,66 +19,86 @@ type SQLite3ConnectionOptions = SQLiteConnectionOptions & ((SQLite3ClientOptions
|
|
|
19
19
|
}) | {
|
|
20
20
|
client: SQLite3Client;
|
|
21
21
|
});
|
|
22
|
-
type SQLite3Connection<ClientType extends SQLiteClientOrPoolClient = SQLiteClientOrPoolClient> = Connection<SQLite3Connection, SQLite3DriverType, ClientType, SQLiteTransaction<SQLite3Connection>,
|
|
23
|
-
declare const sqlite3Client: (options: SQLite3ClientOptions
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
type SQLite3Connection<ClientType extends SQLiteClientOrPoolClient = SQLiteClientOrPoolClient> = Connection<SQLite3Connection, SQLite3DriverType, ClientType, SQLiteTransaction<SQLite3Connection>, SQLiteTransactionOptions>;
|
|
23
|
+
declare const sqlite3Client: (options: SQLite3ClientOptions & {
|
|
24
|
+
serializer: JSONSerializer;
|
|
25
|
+
}) => SQLiteClient;
|
|
26
|
+
declare const checkConnection: (fileName: string, serializer: JSONSerializer) => Promise<ConnectionCheckResult>;
|
|
27
|
+
declare const sqlite3Connection: (options: SQLite3ConnectionOptions & {
|
|
28
|
+
serializer: JSONSerializer;
|
|
29
|
+
}) => SQLite3Connection<SQLiteClientOrPoolClient>;
|
|
26
30
|
|
|
27
|
-
type SQLite3DumboOptions = Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, 'driverType'> & SQLite3ConnectionOptions
|
|
31
|
+
type SQLite3DumboOptions = Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, 'driverType'> & SQLite3ConnectionOptions & {
|
|
32
|
+
serializer?: JSONSerializer;
|
|
33
|
+
};
|
|
34
|
+
type SQLite3PoolOptions = SQLite3DumboOptions;
|
|
35
|
+
type Sqlite3Pool = SQLitePool<SQLite3Connection>;
|
|
28
36
|
declare const sqlite3Pool: (options: SQLite3DumboOptions) => SQLitePool<SQLite3Connection>;
|
|
29
|
-
declare const
|
|
37
|
+
declare const sqlite3DumboDriver: {
|
|
30
38
|
driverType: "SQLite:sqlite3";
|
|
31
39
|
createPool: (options: ({
|
|
32
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
40
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
33
41
|
driverType?: "SQLite:sqlite3";
|
|
34
42
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
35
43
|
fileName: string | SQLiteConnectionString;
|
|
36
44
|
connectionString?: never;
|
|
37
45
|
} & {
|
|
38
46
|
client?: never;
|
|
47
|
+
} & {
|
|
48
|
+
serializer?: JSONSerializer;
|
|
39
49
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
40
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
50
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
41
51
|
driverType?: "SQLite:sqlite3";
|
|
42
52
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
43
53
|
connectionString: string | SQLiteConnectionString;
|
|
44
54
|
fileName?: never;
|
|
45
55
|
} & {
|
|
46
56
|
client?: never;
|
|
57
|
+
} & {
|
|
58
|
+
serializer?: JSONSerializer;
|
|
47
59
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
48
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
60
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
49
61
|
driverType?: "SQLite:sqlite3";
|
|
50
62
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
51
63
|
client: SQLite3Client;
|
|
64
|
+
} & {
|
|
65
|
+
serializer?: JSONSerializer;
|
|
52
66
|
}, "driverType" | "driver" | "connectionString">)) => SQLitePool<SQLite3Connection>;
|
|
53
67
|
sqlFormatter: SQLFormatter;
|
|
54
68
|
defaultMigratorOptions: MigratorOptions;
|
|
55
|
-
getDatabaseNameOrDefault: () => SQLiteConnectionString;
|
|
56
69
|
canHandle: (options: ({
|
|
57
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
70
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
58
71
|
driverType?: "SQLite:sqlite3";
|
|
59
72
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
60
73
|
fileName: string | SQLiteConnectionString;
|
|
61
74
|
connectionString?: never;
|
|
62
75
|
} & {
|
|
63
76
|
client?: never;
|
|
77
|
+
} & {
|
|
78
|
+
serializer?: JSONSerializer;
|
|
64
79
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
65
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
80
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
66
81
|
driverType?: "SQLite:sqlite3";
|
|
67
82
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
68
83
|
connectionString: string | SQLiteConnectionString;
|
|
69
84
|
fileName?: never;
|
|
70
85
|
} & {
|
|
71
86
|
client?: never;
|
|
87
|
+
} & {
|
|
88
|
+
serializer?: JSONSerializer;
|
|
72
89
|
}, "driverType" | "driver" | "connectionString">) | ({
|
|
73
|
-
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions,
|
|
90
|
+
driver?: DumboDatabaseDriver<SQLite3Connection, SQLite3DumboOptions, Sqlite3Pool>;
|
|
74
91
|
driverType?: "SQLite:sqlite3";
|
|
75
92
|
} & Omit<Omit<SQLitePoolOptions<SQLite3Connection, SQLite3ConnectionOptions>, "driverType"> & SQLiteConnectionOptions & {
|
|
76
93
|
client: SQLite3Client;
|
|
94
|
+
} & {
|
|
95
|
+
serializer?: JSONSerializer;
|
|
77
96
|
}, "driverType" | "driver" | "connectionString">)) => boolean;
|
|
97
|
+
databaseMetadata: DatabaseMetadata<false, false, false>;
|
|
78
98
|
};
|
|
79
|
-
declare const
|
|
80
|
-
type SQLite3DumboConnectionOptions = DumboConnectionOptions<typeof
|
|
99
|
+
declare const useSqlite3DumboDriver: () => void;
|
|
100
|
+
type SQLite3DumboConnectionOptions = DumboConnectionOptions<typeof sqlite3DumboDriver> & {
|
|
81
101
|
connectionString: string | SQLiteConnectionString;
|
|
82
102
|
};
|
|
83
103
|
|
|
84
|
-
export { type ConnectionCheckResult, type SQLite3Client, type SQLite3ClientOptions, type SQLite3Connection, type SQLite3ConnectionOptions, SQLite3DriverType, type SQLite3DumboConnectionOptions, type SQLite3DumboOptions, SQLiteClient, SQLiteClientOptions, SQLiteClientOrPoolClient, SQLiteConnectionOptions, SQLiteConnectionString, SQLiteDriverType, SQLiteFileNameOrConnectionString, SQLitePool, SQLitePoolOptions, SQLiteTransaction,
|
|
104
|
+
export { type ConnectionCheckResult, type SQLite3Client, type SQLite3ClientOptions, type SQLite3Connection, type SQLite3ConnectionOptions, SQLite3DriverType, type SQLite3DumboConnectionOptions, type SQLite3DumboOptions, type SQLite3PoolOptions, SQLiteClient, SQLiteClientOptions, SQLiteClientOrPoolClient, SQLiteConnectionOptions, SQLiteConnectionString, SQLiteDriverType, SQLiteFileNameOrConnectionString, SQLitePool, SQLitePoolOptions, SQLiteTransaction, SQLiteTransactionOptions, type Sqlite3Pool, checkConnection, sqlite3Client, sqlite3Connection, sqlite3DumboDriver, sqlite3Pool, useSqlite3DumboDriver };
|