@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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { e as DatabaseMetadata, e5 as DatabaseConnectionString, m as DumboError, aX as SQLExecutor, b5 as AcquireDatabaseLockOptions, b6 as ReleaseDatabaseLockOptions, b8 as DatabaseLock, b3 as DatabaseLockOptions, b4 as AcquireDatabaseLockMode, M as MigratorOptions, dv as SQL, d as SQLFormatter, a as SQLProcessor, n as SQLArray, o as SQLIn, z as DatabaseDriverType } from './connectionString-oeg1LD5V.cjs';
|
|
2
|
+
import { D as DefaultSQLColumnProcessors } from './columnProcessors-Difrrk4c.cjs';
|
|
3
|
+
|
|
4
|
+
declare const postgreSQLMetadata: DatabaseMetadata<true, true, true>;
|
|
5
|
+
|
|
6
|
+
declare const defaultPostgreSQLConnectionString: PostgreSQLConnectionString;
|
|
7
|
+
type PostgreSQLConnectionString = DatabaseConnectionString<'PostgreSQL', `postgresql://${string}` | `postgres://${string}`>;
|
|
8
|
+
declare const PostgreSQLConnectionString: (connectionString: string) => PostgreSQLConnectionString;
|
|
9
|
+
/**
|
|
10
|
+
* Parse database name from a PostgreSQL connection string
|
|
11
|
+
*/
|
|
12
|
+
declare function parseDatabaseName(str: string): string | null;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Maps a PostgreSQL error (from the `pg` driver) to a typed DumboError
|
|
16
|
+
* based on the SQLSTATE code.
|
|
17
|
+
*
|
|
18
|
+
* SQLSTATE reference: https://www.postgresql.org/docs/current/errcodes-appendix.html
|
|
19
|
+
* Transient classification based on Npgsql's PostgresException.IsTransient.
|
|
20
|
+
*
|
|
21
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized PostgreSQL error.
|
|
22
|
+
*/
|
|
23
|
+
declare const mapPostgresError: (error: unknown) => DumboError;
|
|
24
|
+
|
|
25
|
+
declare const tryAcquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<boolean>;
|
|
26
|
+
declare const releaseAdvisoryLock: (execute: SQLExecutor, options: ReleaseDatabaseLockOptions) => Promise<boolean>;
|
|
27
|
+
declare const acquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<void>;
|
|
28
|
+
declare const AdvisoryLock: DatabaseLock;
|
|
29
|
+
declare const advisoryLock: (execute: SQLExecutor, options: DatabaseLockOptions) => {
|
|
30
|
+
acquire: (acquireOptions?: {
|
|
31
|
+
mode: AcquireDatabaseLockMode;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
tryAcquire: (acquireOptions?: {
|
|
34
|
+
mode: AcquireDatabaseLockMode;
|
|
35
|
+
}) => Promise<boolean>;
|
|
36
|
+
release: () => Promise<boolean>;
|
|
37
|
+
withAcquire: <Result>(handle: () => Promise<Result>, acquireOptions?: {
|
|
38
|
+
mode: AcquireDatabaseLockMode;
|
|
39
|
+
}) => Promise<Result>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
declare const DefaultPostgreSQLMigratorOptions: MigratorOptions;
|
|
43
|
+
|
|
44
|
+
declare const defaultPostgreSqlDatabase = "postgres";
|
|
45
|
+
declare const tableExistsSQL: (tableName: string) => SQL;
|
|
46
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
47
|
+
declare const functionExistsSQL: (functionName: string) => SQL;
|
|
48
|
+
declare const functionExists: (execute: SQLExecutor, functionName: string) => Promise<boolean>;
|
|
49
|
+
|
|
50
|
+
declare const pgFormatter: SQLFormatter;
|
|
51
|
+
|
|
52
|
+
declare const PostgreSQLArrayProcessor: SQLProcessor<SQLArray>;
|
|
53
|
+
declare const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn>;
|
|
54
|
+
|
|
55
|
+
declare const postgreSQLColumnProcessors: DefaultSQLColumnProcessors;
|
|
56
|
+
|
|
57
|
+
type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
58
|
+
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
59
|
+
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
60
|
+
|
|
61
|
+
export { AdvisoryLock, DefaultPostgreSQLMigratorOptions, PostgreSQLArrayProcessor, PostgreSQLConnectionString, PostgreSQLDatabaseName, type PostgreSQLDriverType, PostgreSQLExpandSQLInProcessor, acquireAdvisoryLock, advisoryLock, defaultPostgreSQLConnectionString, defaultPostgreSqlDatabase, functionExists, functionExistsSQL, mapPostgresError, parseDatabaseName, pgFormatter, postgreSQLColumnProcessors, postgreSQLMetadata, releaseAdvisoryLock, tableExists, tableExistsSQL, tryAcquireAdvisoryLock };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { e as DatabaseMetadata, e5 as DatabaseConnectionString, m as DumboError, aX as SQLExecutor, b5 as AcquireDatabaseLockOptions, b6 as ReleaseDatabaseLockOptions, b8 as DatabaseLock, b3 as DatabaseLockOptions, b4 as AcquireDatabaseLockMode, M as MigratorOptions, dv as SQL, d as SQLFormatter, a as SQLProcessor, n as SQLArray, o as SQLIn, z as DatabaseDriverType } from './connectionString-oeg1LD5V.js';
|
|
2
|
+
import { D as DefaultSQLColumnProcessors } from './columnProcessors-C7fRa54L.js';
|
|
3
|
+
|
|
4
|
+
declare const postgreSQLMetadata: DatabaseMetadata<true, true, true>;
|
|
5
|
+
|
|
6
|
+
declare const defaultPostgreSQLConnectionString: PostgreSQLConnectionString;
|
|
7
|
+
type PostgreSQLConnectionString = DatabaseConnectionString<'PostgreSQL', `postgresql://${string}` | `postgres://${string}`>;
|
|
8
|
+
declare const PostgreSQLConnectionString: (connectionString: string) => PostgreSQLConnectionString;
|
|
9
|
+
/**
|
|
10
|
+
* Parse database name from a PostgreSQL connection string
|
|
11
|
+
*/
|
|
12
|
+
declare function parseDatabaseName(str: string): string | null;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Maps a PostgreSQL error (from the `pg` driver) to a typed DumboError
|
|
16
|
+
* based on the SQLSTATE code.
|
|
17
|
+
*
|
|
18
|
+
* SQLSTATE reference: https://www.postgresql.org/docs/current/errcodes-appendix.html
|
|
19
|
+
* Transient classification based on Npgsql's PostgresException.IsTransient.
|
|
20
|
+
*
|
|
21
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized PostgreSQL error.
|
|
22
|
+
*/
|
|
23
|
+
declare const mapPostgresError: (error: unknown) => DumboError;
|
|
24
|
+
|
|
25
|
+
declare const tryAcquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<boolean>;
|
|
26
|
+
declare const releaseAdvisoryLock: (execute: SQLExecutor, options: ReleaseDatabaseLockOptions) => Promise<boolean>;
|
|
27
|
+
declare const acquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<void>;
|
|
28
|
+
declare const AdvisoryLock: DatabaseLock;
|
|
29
|
+
declare const advisoryLock: (execute: SQLExecutor, options: DatabaseLockOptions) => {
|
|
30
|
+
acquire: (acquireOptions?: {
|
|
31
|
+
mode: AcquireDatabaseLockMode;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
tryAcquire: (acquireOptions?: {
|
|
34
|
+
mode: AcquireDatabaseLockMode;
|
|
35
|
+
}) => Promise<boolean>;
|
|
36
|
+
release: () => Promise<boolean>;
|
|
37
|
+
withAcquire: <Result>(handle: () => Promise<Result>, acquireOptions?: {
|
|
38
|
+
mode: AcquireDatabaseLockMode;
|
|
39
|
+
}) => Promise<Result>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
declare const DefaultPostgreSQLMigratorOptions: MigratorOptions;
|
|
43
|
+
|
|
44
|
+
declare const defaultPostgreSqlDatabase = "postgres";
|
|
45
|
+
declare const tableExistsSQL: (tableName: string) => SQL;
|
|
46
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
47
|
+
declare const functionExistsSQL: (functionName: string) => SQL;
|
|
48
|
+
declare const functionExists: (execute: SQLExecutor, functionName: string) => Promise<boolean>;
|
|
49
|
+
|
|
50
|
+
declare const pgFormatter: SQLFormatter;
|
|
51
|
+
|
|
52
|
+
declare const PostgreSQLArrayProcessor: SQLProcessor<SQLArray>;
|
|
53
|
+
declare const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn>;
|
|
54
|
+
|
|
55
|
+
declare const postgreSQLColumnProcessors: DefaultSQLColumnProcessors;
|
|
56
|
+
|
|
57
|
+
type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
58
|
+
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
59
|
+
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
60
|
+
|
|
61
|
+
export { AdvisoryLock, DefaultPostgreSQLMigratorOptions, PostgreSQLArrayProcessor, PostgreSQLConnectionString, PostgreSQLDatabaseName, type PostgreSQLDriverType, PostgreSQLExpandSQLInProcessor, acquireAdvisoryLock, advisoryLock, defaultPostgreSQLConnectionString, defaultPostgreSqlDatabase, functionExists, functionExistsSQL, mapPostgresError, parseDatabaseName, pgFormatter, postgreSQLColumnProcessors, postgreSQLMetadata, releaseAdvisoryLock, tableExists, tableExistsSQL, tryAcquireAdvisoryLock };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AdvisoryLock,
|
|
3
|
+
DefaultPostgreSQLMigratorOptions,
|
|
4
|
+
PostgreSQLArrayProcessor,
|
|
5
|
+
PostgreSQLDatabaseName,
|
|
6
|
+
PostgreSQLExpandSQLInProcessor,
|
|
7
|
+
acquireAdvisoryLock,
|
|
8
|
+
advisoryLock,
|
|
9
|
+
mapPostgresError,
|
|
10
|
+
pgFormatter,
|
|
11
|
+
postgreSQLColumnProcessors,
|
|
12
|
+
releaseAdvisoryLock,
|
|
13
|
+
tryAcquireAdvisoryLock
|
|
14
|
+
} from "./chunk-65DKXURG.js";
|
|
15
|
+
import {
|
|
16
|
+
PostgreSQLConnectionString,
|
|
17
|
+
defaultPostgreSQLConnectionString,
|
|
18
|
+
defaultPostgreSqlDatabase,
|
|
19
|
+
functionExists,
|
|
20
|
+
functionExistsSQL,
|
|
21
|
+
parseDatabaseName,
|
|
22
|
+
postgreSQLMetadata,
|
|
23
|
+
tableExists,
|
|
24
|
+
tableExistsSQL
|
|
25
|
+
} from "./chunk-FC4JR2R3.js";
|
|
26
|
+
import "./chunk-XO5T5N5S.js";
|
|
27
|
+
export {
|
|
28
|
+
AdvisoryLock,
|
|
29
|
+
DefaultPostgreSQLMigratorOptions,
|
|
30
|
+
PostgreSQLArrayProcessor,
|
|
31
|
+
PostgreSQLConnectionString,
|
|
32
|
+
PostgreSQLDatabaseName,
|
|
33
|
+
PostgreSQLExpandSQLInProcessor,
|
|
34
|
+
acquireAdvisoryLock,
|
|
35
|
+
advisoryLock,
|
|
36
|
+
defaultPostgreSQLConnectionString,
|
|
37
|
+
defaultPostgreSqlDatabase,
|
|
38
|
+
functionExists,
|
|
39
|
+
functionExistsSQL,
|
|
40
|
+
mapPostgresError,
|
|
41
|
+
parseDatabaseName,
|
|
42
|
+
pgFormatter,
|
|
43
|
+
postgreSQLColumnProcessors,
|
|
44
|
+
postgreSQLMetadata,
|
|
45
|
+
releaseAdvisoryLock,
|
|
46
|
+
tableExists,
|
|
47
|
+
tableExistsSQL,
|
|
48
|
+
tryAcquireAdvisoryLock
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=postgresql.js.map
|
package/dist/sqlite.cjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var _chunkAMACBMAZcjs = require('./chunk-AMACBMAZ.cjs');
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
var _chunkR7P7CNMKcjs = require('./chunk-R7P7CNMK.cjs');
|
|
29
|
+
require('./chunk-XOQHZABK.cjs');
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
exports.DefaultSQLiteMigratorOptions = _chunkAMACBMAZcjs.DefaultSQLiteMigratorOptions; exports.InMemorySQLiteDatabase = _chunkAMACBMAZcjs.InMemorySQLiteDatabase; exports.SQLiteConnectionString = _chunkAMACBMAZcjs.SQLiteConnectionString; exports.SQLiteDatabaseName = _chunkAMACBMAZcjs.SQLiteDatabaseName; exports.defaultSQLiteDatabase = _chunkR7P7CNMKcjs.defaultSQLiteDatabase; exports.isInMemoryDatabase = _chunkAMACBMAZcjs.isInMemoryDatabase; exports.isSQLiteError = _chunkAMACBMAZcjs.isSQLiteError; exports.mapSqliteError = _chunkAMACBMAZcjs.mapSqliteError; 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;
|
|
56
|
+
//# sourceMappingURL=sqlite.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/sqlite.cjs"],"names":[],"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,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;AACF,6pDAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/sqlite.cjs"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as DatabaseMetadata, e5 as DatabaseConnectionString, aT as SQLCommandOptions, aU as BatchSQLCommandOptions, aX as SQLExecutor, A as AnyConnection, h as DatabaseTransaction, g as DatabaseTransactionOptions, C as Connection, O as ConnectionOptions, L as InferDriverTypeFromConnection, N as InferDbClientFromConnection, J as JSONSerializer, U as InitTransaction, m as DumboError, l as DbSQLExecutor, d as SQLFormatter, i as ConnectionPool, I as InferTransactionFromConnection, j as InferTransactionOptionsFromConnection, M as MigratorOptions, z as DatabaseDriverType } from './connectionString-oeg1LD5V.cjs';
|
|
2
|
+
|
|
3
|
+
declare const sqliteMetadata: DatabaseMetadata<false, false, false>;
|
|
2
4
|
|
|
3
5
|
type SQLiteConnectionString = DatabaseConnectionString<'SQLite', `file:${string}` | `:memory:` | `/${string}` | `./${string}`>;
|
|
4
6
|
declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnectionString;
|
|
@@ -6,6 +8,7 @@ declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnec
|
|
|
6
8
|
type SQLiteCommandOptions = SQLCommandOptions & {
|
|
7
9
|
ignoreChangesCount?: boolean;
|
|
8
10
|
};
|
|
11
|
+
type BatchSQLiteCommandOptions = SQLiteCommandOptions & BatchSQLCommandOptions;
|
|
9
12
|
type SQLiteParameters = object | string | bigint | number | boolean | null;
|
|
10
13
|
type SQLiteClient = {
|
|
11
14
|
connect: () => Promise<void>;
|
|
@@ -32,12 +35,14 @@ type SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType extends AnySQL
|
|
|
32
35
|
type: 'Client';
|
|
33
36
|
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
34
37
|
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
38
|
+
serializer: JSONSerializer;
|
|
35
39
|
};
|
|
36
40
|
type SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
|
|
37
41
|
driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
|
|
38
42
|
type: 'PoolClient';
|
|
39
43
|
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
40
44
|
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
45
|
+
serializer: JSONSerializer;
|
|
41
46
|
};
|
|
42
47
|
type SQLiteConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ClientOptions = SQLiteClientOptions> = SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions> | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;
|
|
43
48
|
type SQLiteConnectionFactory<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (options: ConnectionOptions) => SQLiteConnectionType;
|
|
@@ -53,6 +58,8 @@ type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLite
|
|
|
53
58
|
client: InferDbClientFromConnection<SQLiteConnectionType>;
|
|
54
59
|
initTransaction?: InitTransaction<SQLiteConnectionType, TransactionType, TransactionOptionsType>;
|
|
55
60
|
allowNestedTransactions?: boolean;
|
|
61
|
+
serializer: JSONSerializer;
|
|
62
|
+
errorMapper?: SQLiteErrorMapper;
|
|
56
63
|
};
|
|
57
64
|
declare const sqliteAmbientClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection>(options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>) => SQLiteConnectionType;
|
|
58
65
|
declare const sqliteClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
|
|
@@ -62,9 +69,20 @@ type InMemorySQLiteDatabase = ':memory:';
|
|
|
62
69
|
declare const InMemorySQLiteDatabase: SQLiteConnectionString;
|
|
63
70
|
type SQLiteClientOptions = {};
|
|
64
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed
|
|
74
|
+
* DumboError based on the SQLite result code.
|
|
75
|
+
*
|
|
76
|
+
* Result code reference: https://www.sqlite.org/rescode.html
|
|
77
|
+
*
|
|
78
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.
|
|
79
|
+
*/
|
|
80
|
+
declare const mapSqliteError: (error: unknown) => DumboError;
|
|
81
|
+
|
|
82
|
+
type SQLiteErrorMapper = (error: unknown) => DumboError;
|
|
65
83
|
declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
|
|
66
84
|
type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
|
|
67
|
-
declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, formatter?: SQLFormatter) => SQLiteSQLExecutor<DriverType>;
|
|
85
|
+
declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, serializer: JSONSerializer, formatter?: SQLFormatter, errorMapper?: SQLiteErrorMapper) => SQLiteSQLExecutor<DriverType>;
|
|
68
86
|
|
|
69
87
|
type SQLiteFileNameOrConnectionString = {
|
|
70
88
|
fileName: string | SQLiteConnectionString;
|
|
@@ -74,7 +92,7 @@ type SQLiteFileNameOrConnectionString = {
|
|
|
74
92
|
fileName?: never;
|
|
75
93
|
};
|
|
76
94
|
declare const isInMemoryDatabase: (options: Record<string, unknown>) => boolean;
|
|
77
|
-
type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType
|
|
95
|
+
type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType, InferTransactionFromConnection<SQLiteConnectionType>, InferTransactionOptionsFromConnection<SQLiteConnectionType>>;
|
|
78
96
|
type SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = {
|
|
79
97
|
singleton?: true;
|
|
80
98
|
pooled?: false;
|
|
@@ -92,7 +110,7 @@ type SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType extends AnySQLite
|
|
|
92
110
|
connection?: never;
|
|
93
111
|
connectionOptions: ConnectionOptions;
|
|
94
112
|
};
|
|
95
|
-
type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType
|
|
113
|
+
type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType, InferTransactionFromConnection<SQLiteConnectionType>, InferTransactionOptionsFromConnection<SQLiteConnectionType>>;
|
|
96
114
|
declare const sqliteSingletonConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
97
115
|
driverType: SQLiteConnectionType["driverType"];
|
|
98
116
|
} & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
|
|
@@ -103,7 +121,7 @@ type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection
|
|
|
103
121
|
connection?: never;
|
|
104
122
|
connectionOptions: ConnectionOptions;
|
|
105
123
|
};
|
|
106
|
-
type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType
|
|
124
|
+
type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType, InferTransactionFromConnection<SQLiteConnectionType>, InferTransactionOptionsFromConnection<SQLiteConnectionType>>;
|
|
107
125
|
declare const sqliteAlwaysNewConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
108
126
|
driverType: SQLiteConnectionType["driverType"];
|
|
109
127
|
} & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
|
|
@@ -120,14 +138,17 @@ declare function sqlitePool<SQLiteConnectionType extends AnySQLiteConnection = A
|
|
|
120
138
|
|
|
121
139
|
declare const DefaultSQLiteMigratorOptions: MigratorOptions;
|
|
122
140
|
|
|
123
|
-
declare const
|
|
124
|
-
declare const
|
|
125
|
-
declare const tableExists: (pool: ConnectionPool, tableName: string) => Promise<boolean>;
|
|
141
|
+
declare const defaultSQLiteDatabase = ":memory:";
|
|
142
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
126
143
|
|
|
127
144
|
declare const sqliteFormatter: SQLFormatter;
|
|
128
145
|
|
|
129
146
|
type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = DatabaseTransaction<ConnectionType>;
|
|
130
|
-
|
|
147
|
+
type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';
|
|
148
|
+
type SQLiteTransactionOptions = DatabaseTransactionOptions & {
|
|
149
|
+
mode?: SQLiteTransactionMode;
|
|
150
|
+
};
|
|
151
|
+
declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean, serializer: JSONSerializer) => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
|
|
131
152
|
close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
|
|
132
153
|
} & DatabaseTransactionOptions) => DatabaseTransaction<ConnectionType>;
|
|
133
154
|
|
|
@@ -136,4 +157,4 @@ declare const SQLiteDatabaseName = "SQLite";
|
|
|
136
157
|
type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
|
|
137
158
|
type SQLiteDatabaseType = 'SQLite';
|
|
138
159
|
|
|
139
|
-
export { type
|
|
160
|
+
export { type AnySQLiteClientConnection, type AnySQLiteConnection, type AnySQLitePoolClientConnection, type BatchSQLiteCommandOptions, DefaultSQLiteMigratorOptions, InMemorySQLiteDatabase, type SQLiteAlwaysNewConnectionPool, type SQLiteAmbientConnectionPool, type SQLiteClient, type SQLiteClientConnection, type SQLiteClientConnectionDefinitionOptions, type SQLiteClientFactory, type SQLiteClientOptions, type SQLiteClientOrPoolClient, type SQLiteCommandOptions, type SQLiteConnection, type SQLiteConnectionDefinitionOptions, type SQLiteConnectionFactory, type SQLiteConnectionOptions, SQLiteConnectionString, SQLiteDatabaseName, type SQLiteDatabaseType, type SQLiteDriverType, type SQLiteError, type SQLiteErrorMapper, type SQLiteFileNameOrConnectionString, type SQLiteParameters, type SQLitePool, type SQLitePoolClient, type SQLitePoolClientConnection, type SQLitePoolConnectionDefinitionOptions, type SQLitePoolFactoryOptions, type SQLitePoolOptions, type SQLiteSQLExecutor, type SQLiteSingletonConnectionPool, type SQLiteTransaction, type SQLiteTransactionMode, type SQLiteTransactionOptions, type SqliteAmbientClientConnectionOptions, type TransactionNestingCounter, defaultSQLiteDatabase, isInMemoryDatabase, isSQLiteError, mapSqliteError, sqliteAlwaysNewConnectionPool, sqliteAmbientClientConnection, sqliteAmbientConnectionPool, sqliteClientConnection, sqliteConnection, sqliteExecute, sqliteFormatter, sqliteMetadata, sqlitePool, sqlitePoolClientConnection, sqliteSQLExecutor, sqliteSingletonConnectionPool, sqliteTransaction, tableExists, toSqlitePoolOptions, transactionNestingCounter };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as DatabaseMetadata, e5 as DatabaseConnectionString, aT as SQLCommandOptions, aU as BatchSQLCommandOptions, aX as SQLExecutor, A as AnyConnection, h as DatabaseTransaction, g as DatabaseTransactionOptions, C as Connection, O as ConnectionOptions, L as InferDriverTypeFromConnection, N as InferDbClientFromConnection, J as JSONSerializer, U as InitTransaction, m as DumboError, l as DbSQLExecutor, d as SQLFormatter, i as ConnectionPool, I as InferTransactionFromConnection, j as InferTransactionOptionsFromConnection, M as MigratorOptions, z as DatabaseDriverType } from './connectionString-oeg1LD5V.js';
|
|
2
|
+
|
|
3
|
+
declare const sqliteMetadata: DatabaseMetadata<false, false, false>;
|
|
2
4
|
|
|
3
5
|
type SQLiteConnectionString = DatabaseConnectionString<'SQLite', `file:${string}` | `:memory:` | `/${string}` | `./${string}`>;
|
|
4
6
|
declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnectionString;
|
|
@@ -6,6 +8,7 @@ declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnec
|
|
|
6
8
|
type SQLiteCommandOptions = SQLCommandOptions & {
|
|
7
9
|
ignoreChangesCount?: boolean;
|
|
8
10
|
};
|
|
11
|
+
type BatchSQLiteCommandOptions = SQLiteCommandOptions & BatchSQLCommandOptions;
|
|
9
12
|
type SQLiteParameters = object | string | bigint | number | boolean | null;
|
|
10
13
|
type SQLiteClient = {
|
|
11
14
|
connect: () => Promise<void>;
|
|
@@ -32,12 +35,14 @@ type SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType extends AnySQL
|
|
|
32
35
|
type: 'Client';
|
|
33
36
|
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
34
37
|
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
38
|
+
serializer: JSONSerializer;
|
|
35
39
|
};
|
|
36
40
|
type SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
|
|
37
41
|
driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
|
|
38
42
|
type: 'PoolClient';
|
|
39
43
|
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
40
44
|
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
45
|
+
serializer: JSONSerializer;
|
|
41
46
|
};
|
|
42
47
|
type SQLiteConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ClientOptions = SQLiteClientOptions> = SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions> | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;
|
|
43
48
|
type SQLiteConnectionFactory<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (options: ConnectionOptions) => SQLiteConnectionType;
|
|
@@ -53,6 +58,8 @@ type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLite
|
|
|
53
58
|
client: InferDbClientFromConnection<SQLiteConnectionType>;
|
|
54
59
|
initTransaction?: InitTransaction<SQLiteConnectionType, TransactionType, TransactionOptionsType>;
|
|
55
60
|
allowNestedTransactions?: boolean;
|
|
61
|
+
serializer: JSONSerializer;
|
|
62
|
+
errorMapper?: SQLiteErrorMapper;
|
|
56
63
|
};
|
|
57
64
|
declare const sqliteAmbientClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection>(options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>) => SQLiteConnectionType;
|
|
58
65
|
declare const sqliteClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
|
|
@@ -62,9 +69,20 @@ type InMemorySQLiteDatabase = ':memory:';
|
|
|
62
69
|
declare const InMemorySQLiteDatabase: SQLiteConnectionString;
|
|
63
70
|
type SQLiteClientOptions = {};
|
|
64
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed
|
|
74
|
+
* DumboError based on the SQLite result code.
|
|
75
|
+
*
|
|
76
|
+
* Result code reference: https://www.sqlite.org/rescode.html
|
|
77
|
+
*
|
|
78
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.
|
|
79
|
+
*/
|
|
80
|
+
declare const mapSqliteError: (error: unknown) => DumboError;
|
|
81
|
+
|
|
82
|
+
type SQLiteErrorMapper = (error: unknown) => DumboError;
|
|
65
83
|
declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
|
|
66
84
|
type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
|
|
67
|
-
declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, formatter?: SQLFormatter) => SQLiteSQLExecutor<DriverType>;
|
|
85
|
+
declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, serializer: JSONSerializer, formatter?: SQLFormatter, errorMapper?: SQLiteErrorMapper) => SQLiteSQLExecutor<DriverType>;
|
|
68
86
|
|
|
69
87
|
type SQLiteFileNameOrConnectionString = {
|
|
70
88
|
fileName: string | SQLiteConnectionString;
|
|
@@ -74,7 +92,7 @@ type SQLiteFileNameOrConnectionString = {
|
|
|
74
92
|
fileName?: never;
|
|
75
93
|
};
|
|
76
94
|
declare const isInMemoryDatabase: (options: Record<string, unknown>) => boolean;
|
|
77
|
-
type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType
|
|
95
|
+
type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType, InferTransactionFromConnection<SQLiteConnectionType>, InferTransactionOptionsFromConnection<SQLiteConnectionType>>;
|
|
78
96
|
type SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = {
|
|
79
97
|
singleton?: true;
|
|
80
98
|
pooled?: false;
|
|
@@ -92,7 +110,7 @@ type SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType extends AnySQLite
|
|
|
92
110
|
connection?: never;
|
|
93
111
|
connectionOptions: ConnectionOptions;
|
|
94
112
|
};
|
|
95
|
-
type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType
|
|
113
|
+
type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType, InferTransactionFromConnection<SQLiteConnectionType>, InferTransactionOptionsFromConnection<SQLiteConnectionType>>;
|
|
96
114
|
declare const sqliteSingletonConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
97
115
|
driverType: SQLiteConnectionType["driverType"];
|
|
98
116
|
} & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
|
|
@@ -103,7 +121,7 @@ type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection
|
|
|
103
121
|
connection?: never;
|
|
104
122
|
connectionOptions: ConnectionOptions;
|
|
105
123
|
};
|
|
106
|
-
type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType
|
|
124
|
+
type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType, InferTransactionFromConnection<SQLiteConnectionType>, InferTransactionOptionsFromConnection<SQLiteConnectionType>>;
|
|
107
125
|
declare const sqliteAlwaysNewConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
108
126
|
driverType: SQLiteConnectionType["driverType"];
|
|
109
127
|
} & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
|
|
@@ -120,14 +138,17 @@ declare function sqlitePool<SQLiteConnectionType extends AnySQLiteConnection = A
|
|
|
120
138
|
|
|
121
139
|
declare const DefaultSQLiteMigratorOptions: MigratorOptions;
|
|
122
140
|
|
|
123
|
-
declare const
|
|
124
|
-
declare const
|
|
125
|
-
declare const tableExists: (pool: ConnectionPool, tableName: string) => Promise<boolean>;
|
|
141
|
+
declare const defaultSQLiteDatabase = ":memory:";
|
|
142
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
126
143
|
|
|
127
144
|
declare const sqliteFormatter: SQLFormatter;
|
|
128
145
|
|
|
129
146
|
type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = DatabaseTransaction<ConnectionType>;
|
|
130
|
-
|
|
147
|
+
type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';
|
|
148
|
+
type SQLiteTransactionOptions = DatabaseTransactionOptions & {
|
|
149
|
+
mode?: SQLiteTransactionMode;
|
|
150
|
+
};
|
|
151
|
+
declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean, serializer: JSONSerializer) => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
|
|
131
152
|
close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
|
|
132
153
|
} & DatabaseTransactionOptions) => DatabaseTransaction<ConnectionType>;
|
|
133
154
|
|
|
@@ -136,4 +157,4 @@ declare const SQLiteDatabaseName = "SQLite";
|
|
|
136
157
|
type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
|
|
137
158
|
type SQLiteDatabaseType = 'SQLite';
|
|
138
159
|
|
|
139
|
-
export { type
|
|
160
|
+
export { type AnySQLiteClientConnection, type AnySQLiteConnection, type AnySQLitePoolClientConnection, type BatchSQLiteCommandOptions, DefaultSQLiteMigratorOptions, InMemorySQLiteDatabase, type SQLiteAlwaysNewConnectionPool, type SQLiteAmbientConnectionPool, type SQLiteClient, type SQLiteClientConnection, type SQLiteClientConnectionDefinitionOptions, type SQLiteClientFactory, type SQLiteClientOptions, type SQLiteClientOrPoolClient, type SQLiteCommandOptions, type SQLiteConnection, type SQLiteConnectionDefinitionOptions, type SQLiteConnectionFactory, type SQLiteConnectionOptions, SQLiteConnectionString, SQLiteDatabaseName, type SQLiteDatabaseType, type SQLiteDriverType, type SQLiteError, type SQLiteErrorMapper, type SQLiteFileNameOrConnectionString, type SQLiteParameters, type SQLitePool, type SQLitePoolClient, type SQLitePoolClientConnection, type SQLitePoolConnectionDefinitionOptions, type SQLitePoolFactoryOptions, type SQLitePoolOptions, type SQLiteSQLExecutor, type SQLiteSingletonConnectionPool, type SQLiteTransaction, type SQLiteTransactionMode, type SQLiteTransactionOptions, type SqliteAmbientClientConnectionOptions, type TransactionNestingCounter, defaultSQLiteDatabase, isInMemoryDatabase, isSQLiteError, mapSqliteError, sqliteAlwaysNewConnectionPool, sqliteAmbientClientConnection, sqliteAmbientConnectionPool, sqliteClientConnection, sqliteConnection, sqliteExecute, sqliteFormatter, sqliteMetadata, sqlitePool, sqlitePoolClientConnection, sqliteSQLExecutor, sqliteSingletonConnectionPool, sqliteTransaction, tableExists, toSqlitePoolOptions, transactionNestingCounter };
|
package/dist/sqlite.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultSQLiteMigratorOptions,
|
|
3
|
+
InMemorySQLiteDatabase,
|
|
4
|
+
SQLiteConnectionString,
|
|
5
|
+
SQLiteDatabaseName,
|
|
6
|
+
isInMemoryDatabase,
|
|
7
|
+
isSQLiteError,
|
|
8
|
+
mapSqliteError,
|
|
9
|
+
sqliteAlwaysNewConnectionPool,
|
|
10
|
+
sqliteAmbientClientConnection,
|
|
11
|
+
sqliteAmbientConnectionPool,
|
|
12
|
+
sqliteClientConnection,
|
|
13
|
+
sqliteConnection,
|
|
14
|
+
sqliteExecute,
|
|
15
|
+
sqliteFormatter,
|
|
16
|
+
sqlitePool,
|
|
17
|
+
sqlitePoolClientConnection,
|
|
18
|
+
sqliteSQLExecutor,
|
|
19
|
+
sqliteSingletonConnectionPool,
|
|
20
|
+
sqliteTransaction,
|
|
21
|
+
toSqlitePoolOptions,
|
|
22
|
+
transactionNestingCounter
|
|
23
|
+
} from "./chunk-T4A6BQRA.js";
|
|
24
|
+
import {
|
|
25
|
+
defaultSQLiteDatabase,
|
|
26
|
+
sqliteMetadata,
|
|
27
|
+
tableExists
|
|
28
|
+
} from "./chunk-IVJ3SNPJ.js";
|
|
29
|
+
import "./chunk-XO5T5N5S.js";
|
|
30
|
+
export {
|
|
31
|
+
DefaultSQLiteMigratorOptions,
|
|
32
|
+
InMemorySQLiteDatabase,
|
|
33
|
+
SQLiteConnectionString,
|
|
34
|
+
SQLiteDatabaseName,
|
|
35
|
+
defaultSQLiteDatabase,
|
|
36
|
+
isInMemoryDatabase,
|
|
37
|
+
isSQLiteError,
|
|
38
|
+
mapSqliteError,
|
|
39
|
+
sqliteAlwaysNewConnectionPool,
|
|
40
|
+
sqliteAmbientClientConnection,
|
|
41
|
+
sqliteAmbientConnectionPool,
|
|
42
|
+
sqliteClientConnection,
|
|
43
|
+
sqliteConnection,
|
|
44
|
+
sqliteExecute,
|
|
45
|
+
sqliteFormatter,
|
|
46
|
+
sqliteMetadata,
|
|
47
|
+
sqlitePool,
|
|
48
|
+
sqlitePoolClientConnection,
|
|
49
|
+
sqliteSQLExecutor,
|
|
50
|
+
sqliteSingletonConnectionPool,
|
|
51
|
+
sqliteTransaction,
|
|
52
|
+
tableExists,
|
|
53
|
+
toSqlitePoolOptions,
|
|
54
|
+
transactionNestingCounter
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=sqlite.js.map
|