@event-driven-io/dumbo 0.13.0-beta.44 → 0.13.0-beta.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cloudflare.d.cts +3 -1103
- package/dist/cloudflare.d.ts +3 -1103
- package/dist/index-B5krjjrh.d.ts +1699 -0
- package/dist/index-BaLXbc2l.d.ts +74 -0
- package/dist/index-BoLWBnxd.d.cts +184 -0
- package/dist/index-C9B46a1u.d.ts +184 -0
- package/dist/index-_dj3upBo.d.cts +1699 -0
- package/dist/index-kYttgYkC.d.cts +74 -0
- package/dist/index.d.cts +2 -1694
- package/dist/index.d.ts +2 -1694
- package/dist/pg.d.cts +3 -1045
- package/dist/pg.d.ts +3 -1045
- package/dist/postgresql.d.cts +3 -1037
- package/dist/postgresql.d.ts +3 -1037
- package/dist/sqlite.d.cts +3 -1103
- package/dist/sqlite.d.ts +3 -1103
- package/dist/sqlite3.d.cts +4 -1103
- package/dist/sqlite3.d.ts +4 -1103
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Bt as DatabaseLockOptions, Ea as SQLProcessor, Ht as ReleaseDatabaseLockOptions, In as DumboError, Ji as SQL, Lt as AcquireDatabaseLockMode, Rt as AcquireDatabaseLockOptions, Vi as SQLFormatter, go as SQLPlain, i as DatabaseConnectionString, jt as MigratorOptions, lo as SQLArray, mo as SQLIn, pt as DatabaseDriverType, rn as SQLExecutor, xa as DefaultSQLColumnProcessors, zt as DatabaseLock } from "./index-B5krjjrh.js";
|
|
2
|
+
|
|
3
|
+
//#region src/storage/postgresql/core/connections/connectionString.d.ts
|
|
4
|
+
declare const defaultPostgreSQLConnectionString: PostgreSQLConnectionString;
|
|
5
|
+
type PostgreSQLConnectionString = DatabaseConnectionString<'PostgreSQL', `postgresql://${string}` | `postgres://${string}`>;
|
|
6
|
+
declare const PostgreSQLConnectionString: (connectionString: string) => PostgreSQLConnectionString;
|
|
7
|
+
/**
|
|
8
|
+
* Parse database name from a PostgreSQL connection string
|
|
9
|
+
*/
|
|
10
|
+
declare function parseDatabaseName(str: string): string | null;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/storage/postgresql/core/errors/errorMapper.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* Maps a PostgreSQL error (from the `pg` driver) to a typed DumboError
|
|
15
|
+
* based on the SQLSTATE code.
|
|
16
|
+
*
|
|
17
|
+
* SQLSTATE reference: https://www.postgresql.org/docs/current/errcodes-appendix.html
|
|
18
|
+
* Transient classification based on Npgsql's PostgresException.IsTransient.
|
|
19
|
+
*
|
|
20
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized PostgreSQL error.
|
|
21
|
+
*/
|
|
22
|
+
declare const mapPostgresError: (error: unknown) => DumboError;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/storage/postgresql/core/locks/advisoryLocks.d.ts
|
|
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
|
+
//#endregion
|
|
42
|
+
//#region src/storage/postgresql/core/schema/migrations.d.ts
|
|
43
|
+
declare const DefaultPostgreSQLMigratorOptions: MigratorOptions;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/storage/postgresql/core/schema/schema.d.ts
|
|
46
|
+
declare const defaultPostgreSqlDatabase = "postgres";
|
|
47
|
+
declare const tableExistsSQL: (tableName: string) => SQL;
|
|
48
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
49
|
+
declare const functionExistsSQL: (functionName: string) => SQL;
|
|
50
|
+
declare const functionExists: (execute: SQLExecutor, functionName: string) => Promise<boolean>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/storage/postgresql/core/sql/formatter/index.d.ts
|
|
53
|
+
declare const pgFormatter: SQLFormatter;
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/storage/postgresql/core/sql/json.d.ts
|
|
56
|
+
declare const PostgreSQLJSON: {
|
|
57
|
+
readonly field: (source: SQL, path: string) => SQL;
|
|
58
|
+
readonly path: (path: string) => SQLPlain;
|
|
59
|
+
readonly textField: (source: SQL, path: string) => SQL;
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/storage/postgresql/core/sql/processors/arrayProcessors.d.ts
|
|
63
|
+
declare const PostgreSQLArrayProcessor: SQLProcessor<SQLArray>;
|
|
64
|
+
declare const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn>;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/storage/postgresql/core/sql/processors/columProcessors.d.ts
|
|
67
|
+
declare const postgreSQLColumnProcessors: DefaultSQLColumnProcessors;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/storage/postgresql/core/index.d.ts
|
|
70
|
+
type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
71
|
+
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
72
|
+
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { parseDatabaseName as S, releaseAdvisoryLock as _, PostgreSQLExpandSQLInProcessor as a, PostgreSQLConnectionString as b, defaultPostgreSqlDatabase as c, tableExists as d, tableExistsSQL as f, advisoryLock as g, acquireAdvisoryLock as h, PostgreSQLArrayProcessor as i, functionExists as l, AdvisoryLock as m, PostgreSQLDriverType as n, PostgreSQLJSON as o, DefaultPostgreSQLMigratorOptions as p, postgreSQLColumnProcessors as r, pgFormatter as s, PostgreSQLDatabaseName as t, functionExistsSQL as u, tryAcquireAdvisoryLock as v, defaultPostgreSQLConnectionString as x, mapPostgresError as y };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { $ as DatabaseTransaction, $t as BatchSQLCommandOptions, G as InitTransaction, H as InferDriverTypeFromConnection, I as ConnectionOptions, In as DumboError, Mo as JSONSerializer, N as AnyConnection, P as Connection, U as InferTransactionFromConnection, V as InferDbClientFromConnection, Vi as SQLFormatter, en as DbSQLExecutor, et as DatabaseTransactionOptions, go as SQLPlain, i as DatabaseConnectionString, jt as MigratorOptions, nn as SQLCommandOptions, pt as DatabaseDriverType, rn as SQLExecutor, y as ConnectionPool } from "./index-_dj3upBo.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/storage/sqlite/core/execute/execute.d.ts
|
|
4
|
+
type SQLiteErrorMapper = (error: unknown) => DumboError;
|
|
5
|
+
declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
|
|
6
|
+
type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
|
|
7
|
+
declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, serializer: JSONSerializer, formatter?: SQLFormatter, errorMapper?: SQLiteErrorMapper) => SQLiteSQLExecutor<DriverType>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/storage/sqlite/core/transactions/index.d.ts
|
|
10
|
+
type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection, TransactionOptions extends SQLiteTransactionOptions = SQLiteTransactionOptions> = DatabaseTransaction<ConnectionType, TransactionOptions>;
|
|
11
|
+
type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';
|
|
12
|
+
type SQLiteTransactionOptions = DatabaseTransactionOptions & {
|
|
13
|
+
mode?: SQLiteTransactionMode;
|
|
14
|
+
useSavepoints?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean, serializer: JSONSerializer, defaultTransactionMode?: "IMMEDIATE" | "DEFERRED" | "EXCLUSIVE") => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
|
|
17
|
+
close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
|
|
18
|
+
} & SQLiteTransactionOptions) => InferTransactionFromConnection<ConnectionType>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/storage/sqlite/core/connections/connectionString.d.ts
|
|
21
|
+
type SQLitePragmaOptions = {
|
|
22
|
+
journal_mode?: 'DELETE' | 'TRUNCATE' | 'PERSIST' | 'MEMORY' | 'WAL' | 'OFF';
|
|
23
|
+
synchronous?: 'OFF' | 'NORMAL' | 'FULL' | 'EXTRA';
|
|
24
|
+
cache_size?: number;
|
|
25
|
+
foreign_keys?: boolean;
|
|
26
|
+
temp_store?: 'DEFAULT' | 'FILE' | 'MEMORY';
|
|
27
|
+
busy_timeout?: number;
|
|
28
|
+
mmap_size?: number;
|
|
29
|
+
};
|
|
30
|
+
type SQLiteConnectionString = DatabaseConnectionString<'SQLite', `file:${string}` | `:memory:` | `/${string}` | `./${string}`>;
|
|
31
|
+
declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnectionString;
|
|
32
|
+
declare const parsePragmasFromConnectionString: (connectionString: string | SQLiteConnectionString) => Partial<SQLitePragmaOptions>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/storage/sqlite/core/connections/index.d.ts
|
|
35
|
+
type SQLiteCommandOptions = SQLCommandOptions & {
|
|
36
|
+
ignoreChangesCount?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type BatchSQLiteCommandOptions = SQLiteCommandOptions & BatchSQLCommandOptions;
|
|
39
|
+
type SQLiteParameters = object | string | bigint | number | boolean | null;
|
|
40
|
+
type SQLiteClient = {
|
|
41
|
+
connect: () => Promise<void>;
|
|
42
|
+
close: () => Promise<void>;
|
|
43
|
+
} & SQLExecutor;
|
|
44
|
+
type SQLitePoolClient = {
|
|
45
|
+
release: () => void;
|
|
46
|
+
} & SQLExecutor;
|
|
47
|
+
type SQLiteClientFactory<SQLiteClientType extends SQLiteClient = SQLiteClient, ClientOptions = SQLiteClientOptions> = (options: ClientOptions) => SQLiteClientType;
|
|
48
|
+
type SQLiteClientOrPoolClient = SQLitePoolClient | SQLiteClient;
|
|
49
|
+
interface SQLiteError extends Error {
|
|
50
|
+
errno: number;
|
|
51
|
+
}
|
|
52
|
+
declare const isSQLiteError: (error: unknown) => error is SQLiteError;
|
|
53
|
+
type SQLiteClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClient = SQLiteClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLiteClientType, TransactionType>;
|
|
54
|
+
type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType>;
|
|
55
|
+
type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = (SQLiteClientType extends SQLiteClient ? SQLiteClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never) | (SQLiteClientType extends SQLitePoolClient ? SQLitePoolClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never);
|
|
56
|
+
type AnySQLiteClientConnection = SQLiteClientConnection<any, any>;
|
|
57
|
+
type AnySQLitePoolClientConnection = SQLitePoolClientConnection<any, any, any, any>;
|
|
58
|
+
type AnySQLiteConnection = SQLiteConnection<any, any, any, any>;
|
|
59
|
+
type SQLiteConnectionOptions<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionOptions<ConnectionType> & SQLiteClientOptions;
|
|
60
|
+
type SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
|
|
61
|
+
driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
|
|
62
|
+
type: 'Client';
|
|
63
|
+
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
64
|
+
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
65
|
+
serializer: JSONSerializer;
|
|
66
|
+
};
|
|
67
|
+
type SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
|
|
68
|
+
driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
|
|
69
|
+
type: 'PoolClient';
|
|
70
|
+
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
71
|
+
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
72
|
+
serializer: JSONSerializer;
|
|
73
|
+
};
|
|
74
|
+
type SQLiteConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ClientOptions = SQLiteClientOptions> = SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions> | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;
|
|
75
|
+
type SQLiteConnectionFactory<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (options: ConnectionOptions) => SQLiteConnectionType;
|
|
76
|
+
type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection> = {
|
|
77
|
+
driverType: SQLiteConnectionType['driverType'];
|
|
78
|
+
client: InferDbClientFromConnection<SQLiteConnectionType>;
|
|
79
|
+
initTransaction?: InitTransaction<SQLiteConnectionType>;
|
|
80
|
+
allowNestedTransactions?: boolean;
|
|
81
|
+
defaultTransactionMode?: SQLiteTransactionMode;
|
|
82
|
+
serializer: JSONSerializer;
|
|
83
|
+
errorMapper?: SQLiteErrorMapper;
|
|
84
|
+
};
|
|
85
|
+
declare const sqliteAmbientClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection>(options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>) => SQLiteConnectionType;
|
|
86
|
+
declare const sqliteClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
|
|
87
|
+
declare const sqlitePoolClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
|
|
88
|
+
declare function sqliteConnection<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>): SQLiteConnectionType;
|
|
89
|
+
type InMemorySQLiteDatabase = ':memory:';
|
|
90
|
+
declare const InMemorySQLiteDatabase: SQLiteConnectionString;
|
|
91
|
+
declare const DEFAULT_SQLITE_PRAGMA_OPTIONS: SQLitePragmaOptions;
|
|
92
|
+
type SQLiteClientOptions = {
|
|
93
|
+
pragmaOptions?: Partial<SQLitePragmaOptions>;
|
|
94
|
+
defaultTransactionMode?: SQLiteTransactionMode;
|
|
95
|
+
skipDatabasePragmas?: boolean;
|
|
96
|
+
readonly?: boolean;
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/storage/sqlite/core/errors/errorMapper.d.ts
|
|
100
|
+
/**
|
|
101
|
+
* Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed
|
|
102
|
+
* DumboError based on the SQLite result code.
|
|
103
|
+
*
|
|
104
|
+
* Result code reference: https://www.sqlite.org/rescode.html
|
|
105
|
+
*
|
|
106
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.
|
|
107
|
+
*/
|
|
108
|
+
declare const mapSqliteError: (error: unknown) => DumboError;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/storage/sqlite/core/pool/pool.d.ts
|
|
111
|
+
type SQLiteFileNameOrConnectionString = {
|
|
112
|
+
fileName: string | SQLiteConnectionString;
|
|
113
|
+
connectionString?: never;
|
|
114
|
+
} | {
|
|
115
|
+
connectionString: string | SQLiteConnectionString;
|
|
116
|
+
fileName?: never;
|
|
117
|
+
};
|
|
118
|
+
declare const isInMemoryDatabase: (options: Record<string, unknown>) => boolean;
|
|
119
|
+
type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
|
|
120
|
+
type SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = {
|
|
121
|
+
singleton?: true;
|
|
122
|
+
pooled?: false;
|
|
123
|
+
sqliteConnectionFactory?: never;
|
|
124
|
+
connection: SQLiteConnectionType;
|
|
125
|
+
connectionOptions?: never;
|
|
126
|
+
};
|
|
127
|
+
declare const sqliteAmbientConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(options: {
|
|
128
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
129
|
+
} & SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType["driverType"]>) => SQLiteAmbientConnectionPool<SQLiteConnectionType["driverType"]>;
|
|
130
|
+
type SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
|
|
131
|
+
singleton: true;
|
|
132
|
+
pooled?: true;
|
|
133
|
+
sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
|
|
134
|
+
connection?: never;
|
|
135
|
+
connectionOptions: ConnectionOptions;
|
|
136
|
+
};
|
|
137
|
+
type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
|
|
138
|
+
declare const sqliteSingletonConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
139
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
140
|
+
} & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
|
|
141
|
+
type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
|
|
142
|
+
singleton?: false;
|
|
143
|
+
pooled?: true;
|
|
144
|
+
sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
|
|
145
|
+
connection?: never;
|
|
146
|
+
connectionOptions: ConnectionOptions;
|
|
147
|
+
};
|
|
148
|
+
type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
|
|
149
|
+
declare const sqliteAlwaysNewConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
150
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
151
|
+
} & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
|
|
152
|
+
type SQLitePoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType>) & {
|
|
153
|
+
driverType: SQLiteConnectionType['driverType'];
|
|
154
|
+
serializer?: JSONSerializer;
|
|
155
|
+
};
|
|
156
|
+
type SQLitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = SQLiteAmbientConnectionPool<SQLiteConnectionType> | SQLiteSingletonConnectionPool<SQLiteConnectionType> | SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
|
|
157
|
+
type SQLitePoolFactoryOptions<SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions> = Omit<SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>, 'singleton'> & {
|
|
158
|
+
singleton?: boolean;
|
|
159
|
+
};
|
|
160
|
+
declare const toSqlitePoolOptions: <SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions>(options: SQLitePoolFactoryOptions<SQLiteConnectionType, ConnectionOptions>) => SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>;
|
|
161
|
+
declare function sqlitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions>(options: SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>): SQLitePool<SQLiteConnectionType>;
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/storage/sqlite/core/schema/migrations.d.ts
|
|
164
|
+
declare const DefaultSQLiteMigratorOptions: MigratorOptions;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/storage/sqlite/core/schema/schema.d.ts
|
|
167
|
+
declare const defaultSQLiteDatabase = ":memory:";
|
|
168
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/storage/sqlite/core/sql/formatter/index.d.ts
|
|
171
|
+
declare const sqliteFormatter: SQLFormatter;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/storage/sqlite/core/sql/json.d.ts
|
|
174
|
+
declare const SQLiteJSON: {
|
|
175
|
+
readonly path: (path: string) => SQLPlain;
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/storage/sqlite/core/index.d.ts
|
|
179
|
+
type SQLiteDatabaseName = 'SQLite';
|
|
180
|
+
declare const SQLiteDatabaseName = "SQLite";
|
|
181
|
+
type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
|
|
182
|
+
type SQLiteDatabaseType = 'SQLite';
|
|
183
|
+
//#endregion
|
|
184
|
+
export { parsePragmasFromConnectionString as $, SQLiteClientConnection as A, SQLiteError as B, AnySQLiteClientConnection as C, DEFAULT_SQLITE_PRAGMA_OPTIONS as D, BatchSQLiteCommandOptions as E, SQLiteCommandOptions as F, SqliteAmbientClientConnectionOptions as G, SQLitePoolClient as H, SQLiteConnection as I, sqliteClientConnection as J, isSQLiteError as K, SQLiteConnectionDefinitionOptions as L, SQLiteClientFactory as M, SQLiteClientOptions as N, InMemorySQLiteDatabase as O, SQLiteClientOrPoolClient as P, SQLitePragmaOptions as Q, SQLiteConnectionFactory as R, mapSqliteError as S, AnySQLitePoolClientConnection as T, SQLitePoolClientConnection as U, SQLiteParameters as V, SQLitePoolConnectionDefinitionOptions as W, sqlitePoolClientConnection as X, sqliteConnection as Y, SQLiteConnectionString as Z, sqliteAlwaysNewConnectionPool as _, sqliteFormatter as a, SQLiteSQLExecutor as at, sqliteSingletonConnectionPool as b, DefaultSQLiteMigratorOptions as c, SQLiteFileNameOrConnectionString as d, SQLiteTransaction as et, SQLitePool as f, isInMemoryDatabase as g, SQLiteSingletonConnectionPool as h, SQLiteJSON as i, SQLiteErrorMapper as it, SQLiteClientConnectionDefinitionOptions as j, SQLiteClient as k, SQLiteAlwaysNewConnectionPool as l, SQLitePoolOptions as m, SQLiteDatabaseType as n, SQLiteTransactionOptions as nt, defaultSQLiteDatabase as o, sqliteExecute as ot, SQLitePoolFactoryOptions as p, sqliteAmbientClientConnection as q, SQLiteDriverType as r, sqliteTransaction as rt, tableExists as s, sqliteSQLExecutor as st, SQLiteDatabaseName as t, SQLiteTransactionMode as tt, SQLiteAmbientConnectionPool as u, sqliteAmbientConnectionPool as v, AnySQLiteConnection as w, toSqlitePoolOptions as x, sqlitePool as y, SQLiteConnectionOptions as z };
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { $ as DatabaseTransaction, $t as BatchSQLCommandOptions, G as InitTransaction, H as InferDriverTypeFromConnection, I as ConnectionOptions, In as DumboError, Mo as JSONSerializer, N as AnyConnection, P as Connection, U as InferTransactionFromConnection, V as InferDbClientFromConnection, Vi as SQLFormatter, en as DbSQLExecutor, et as DatabaseTransactionOptions, go as SQLPlain, i as DatabaseConnectionString, jt as MigratorOptions, nn as SQLCommandOptions, pt as DatabaseDriverType, rn as SQLExecutor, y as ConnectionPool } from "./index-B5krjjrh.js";
|
|
2
|
+
|
|
3
|
+
//#region src/storage/sqlite/core/execute/execute.d.ts
|
|
4
|
+
type SQLiteErrorMapper = (error: unknown) => DumboError;
|
|
5
|
+
declare const sqliteExecute: <Result = void>(database: SQLiteClient, handle: (client: SQLiteClient) => Promise<Result>) => Promise<Result>;
|
|
6
|
+
type SQLiteSQLExecutor<DriverType extends SQLiteDriverType = SQLiteDriverType> = DbSQLExecutor<DriverType, SQLiteClient>;
|
|
7
|
+
declare const sqliteSQLExecutor: <DriverType extends SQLiteDriverType = SQLiteDriverType>(driverType: DriverType, serializer: JSONSerializer, formatter?: SQLFormatter, errorMapper?: SQLiteErrorMapper) => SQLiteSQLExecutor<DriverType>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/storage/sqlite/core/transactions/index.d.ts
|
|
10
|
+
type SQLiteTransaction<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection, TransactionOptions extends SQLiteTransactionOptions = SQLiteTransactionOptions> = DatabaseTransaction<ConnectionType, TransactionOptions>;
|
|
11
|
+
type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';
|
|
12
|
+
type SQLiteTransactionOptions = DatabaseTransactionOptions & {
|
|
13
|
+
mode?: SQLiteTransactionMode;
|
|
14
|
+
useSavepoints?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const sqliteTransaction: <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(driverType: ConnectionType["driverType"], connection: () => ConnectionType, allowNestedTransactions: boolean, serializer: JSONSerializer, defaultTransactionMode?: "IMMEDIATE" | "DEFERRED" | "EXCLUSIVE") => (getClient: Promise<InferDbClientFromConnection<ConnectionType>>, options?: {
|
|
17
|
+
close: (client: InferDbClientFromConnection<ConnectionType>, error?: unknown) => Promise<void>;
|
|
18
|
+
} & SQLiteTransactionOptions) => InferTransactionFromConnection<ConnectionType>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/storage/sqlite/core/connections/connectionString.d.ts
|
|
21
|
+
type SQLitePragmaOptions = {
|
|
22
|
+
journal_mode?: 'DELETE' | 'TRUNCATE' | 'PERSIST' | 'MEMORY' | 'WAL' | 'OFF';
|
|
23
|
+
synchronous?: 'OFF' | 'NORMAL' | 'FULL' | 'EXTRA';
|
|
24
|
+
cache_size?: number;
|
|
25
|
+
foreign_keys?: boolean;
|
|
26
|
+
temp_store?: 'DEFAULT' | 'FILE' | 'MEMORY';
|
|
27
|
+
busy_timeout?: number;
|
|
28
|
+
mmap_size?: number;
|
|
29
|
+
};
|
|
30
|
+
type SQLiteConnectionString = DatabaseConnectionString<'SQLite', `file:${string}` | `:memory:` | `/${string}` | `./${string}`>;
|
|
31
|
+
declare const SQLiteConnectionString: (connectionString: string) => SQLiteConnectionString;
|
|
32
|
+
declare const parsePragmasFromConnectionString: (connectionString: string | SQLiteConnectionString) => Partial<SQLitePragmaOptions>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/storage/sqlite/core/connections/index.d.ts
|
|
35
|
+
type SQLiteCommandOptions = SQLCommandOptions & {
|
|
36
|
+
ignoreChangesCount?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type BatchSQLiteCommandOptions = SQLiteCommandOptions & BatchSQLCommandOptions;
|
|
39
|
+
type SQLiteParameters = object | string | bigint | number | boolean | null;
|
|
40
|
+
type SQLiteClient = {
|
|
41
|
+
connect: () => Promise<void>;
|
|
42
|
+
close: () => Promise<void>;
|
|
43
|
+
} & SQLExecutor;
|
|
44
|
+
type SQLitePoolClient = {
|
|
45
|
+
release: () => void;
|
|
46
|
+
} & SQLExecutor;
|
|
47
|
+
type SQLiteClientFactory<SQLiteClientType extends SQLiteClient = SQLiteClient, ClientOptions = SQLiteClientOptions> = (options: ClientOptions) => SQLiteClientType;
|
|
48
|
+
type SQLiteClientOrPoolClient = SQLitePoolClient | SQLiteClient;
|
|
49
|
+
interface SQLiteError extends Error {
|
|
50
|
+
errno: number;
|
|
51
|
+
}
|
|
52
|
+
declare const isSQLiteError: (error: unknown) => error is SQLiteError;
|
|
53
|
+
type SQLiteClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClient = SQLiteClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLiteClientType, TransactionType>;
|
|
54
|
+
type SQLitePoolClientConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType>;
|
|
55
|
+
type SQLiteConnection<Self extends AnyConnection = AnyConnection, DriverType extends SQLiteDriverType = SQLiteDriverType, SQLiteClientType extends SQLiteClientOrPoolClient = SQLiteClient | SQLitePoolClient, TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>> = (SQLiteClientType extends SQLiteClient ? SQLiteClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never) | (SQLiteClientType extends SQLitePoolClient ? SQLitePoolClientConnection<Self, DriverType, SQLiteClientType, TransactionType> : never);
|
|
56
|
+
type AnySQLiteClientConnection = SQLiteClientConnection<any, any>;
|
|
57
|
+
type AnySQLitePoolClientConnection = SQLitePoolClientConnection<any, any, any, any>;
|
|
58
|
+
type AnySQLiteConnection = SQLiteConnection<any, any, any, any>;
|
|
59
|
+
type SQLiteConnectionOptions<ConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionOptions<ConnectionType> & SQLiteClientOptions;
|
|
60
|
+
type SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
|
|
61
|
+
driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
|
|
62
|
+
type: 'Client';
|
|
63
|
+
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
64
|
+
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
65
|
+
serializer: JSONSerializer;
|
|
66
|
+
};
|
|
67
|
+
type SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ConnectionOptions = SQLiteConnectionOptions> = {
|
|
68
|
+
driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;
|
|
69
|
+
type: 'PoolClient';
|
|
70
|
+
sqliteClientFactory: SQLiteClientFactory<InferDbClientFromConnection<SQLiteConnectionType>, ConnectionOptions>;
|
|
71
|
+
connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;
|
|
72
|
+
serializer: JSONSerializer;
|
|
73
|
+
};
|
|
74
|
+
type SQLiteConnectionDefinitionOptions<SQLiteConnectionType extends AnySQLitePoolClientConnection = AnySQLitePoolClientConnection, ClientOptions = SQLiteClientOptions> = SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions> | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;
|
|
75
|
+
type SQLiteConnectionFactory<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (options: ConnectionOptions) => SQLiteConnectionType;
|
|
76
|
+
type SqliteAmbientClientConnectionOptions<SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection> = {
|
|
77
|
+
driverType: SQLiteConnectionType['driverType'];
|
|
78
|
+
client: InferDbClientFromConnection<SQLiteConnectionType>;
|
|
79
|
+
initTransaction?: InitTransaction<SQLiteConnectionType>;
|
|
80
|
+
allowNestedTransactions?: boolean;
|
|
81
|
+
defaultTransactionMode?: SQLiteTransactionMode;
|
|
82
|
+
serializer: JSONSerializer;
|
|
83
|
+
errorMapper?: SQLiteErrorMapper;
|
|
84
|
+
};
|
|
85
|
+
declare const sqliteAmbientClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection>(options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>) => SQLiteConnectionType;
|
|
86
|
+
declare const sqliteClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
|
|
87
|
+
declare const sqlitePoolClientConnection: <SQLiteConnectionType extends AnySQLiteClientConnection = AnySQLiteClientConnection, ClientOptions = SQLiteClientOptions>(options: SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>) => SQLiteConnectionType;
|
|
88
|
+
declare function sqliteConnection<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ClientOptions = SQLiteClientOptions>(options: SQLiteConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>): SQLiteConnectionType;
|
|
89
|
+
type InMemorySQLiteDatabase = ':memory:';
|
|
90
|
+
declare const InMemorySQLiteDatabase: SQLiteConnectionString;
|
|
91
|
+
declare const DEFAULT_SQLITE_PRAGMA_OPTIONS: SQLitePragmaOptions;
|
|
92
|
+
type SQLiteClientOptions = {
|
|
93
|
+
pragmaOptions?: Partial<SQLitePragmaOptions>;
|
|
94
|
+
defaultTransactionMode?: SQLiteTransactionMode;
|
|
95
|
+
skipDatabasePragmas?: boolean;
|
|
96
|
+
readonly?: boolean;
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/storage/sqlite/core/errors/errorMapper.d.ts
|
|
100
|
+
/**
|
|
101
|
+
* Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed
|
|
102
|
+
* DumboError based on the SQLite result code.
|
|
103
|
+
*
|
|
104
|
+
* Result code reference: https://www.sqlite.org/rescode.html
|
|
105
|
+
*
|
|
106
|
+
* Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.
|
|
107
|
+
*/
|
|
108
|
+
declare const mapSqliteError: (error: unknown) => DumboError;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/storage/sqlite/core/pool/pool.d.ts
|
|
111
|
+
type SQLiteFileNameOrConnectionString = {
|
|
112
|
+
fileName: string | SQLiteConnectionString;
|
|
113
|
+
connectionString?: never;
|
|
114
|
+
} | {
|
|
115
|
+
connectionString: string | SQLiteConnectionString;
|
|
116
|
+
fileName?: never;
|
|
117
|
+
};
|
|
118
|
+
declare const isInMemoryDatabase: (options: Record<string, unknown>) => boolean;
|
|
119
|
+
type SQLiteAmbientConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
|
|
120
|
+
type SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = {
|
|
121
|
+
singleton?: true;
|
|
122
|
+
pooled?: false;
|
|
123
|
+
sqliteConnectionFactory?: never;
|
|
124
|
+
connection: SQLiteConnectionType;
|
|
125
|
+
connectionOptions?: never;
|
|
126
|
+
};
|
|
127
|
+
declare const sqliteAmbientConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(options: {
|
|
128
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
129
|
+
} & SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType["driverType"]>) => SQLiteAmbientConnectionPool<SQLiteConnectionType["driverType"]>;
|
|
130
|
+
type SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
|
|
131
|
+
singleton: true;
|
|
132
|
+
pooled?: true;
|
|
133
|
+
sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
|
|
134
|
+
connection?: never;
|
|
135
|
+
connectionOptions: ConnectionOptions;
|
|
136
|
+
};
|
|
137
|
+
type SQLiteSingletonConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
|
|
138
|
+
declare const sqliteSingletonConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
139
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
140
|
+
} & SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteSingletonConnectionPool<SQLiteConnectionType>;
|
|
141
|
+
type SQLiteAlwaysNewPoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = {
|
|
142
|
+
singleton?: false;
|
|
143
|
+
pooled?: true;
|
|
144
|
+
sqliteConnectionFactory: SQLiteConnectionFactory<SQLiteConnectionType, ConnectionOptions>;
|
|
145
|
+
connection?: never;
|
|
146
|
+
connectionOptions: ConnectionOptions;
|
|
147
|
+
};
|
|
148
|
+
type SQLiteAlwaysNewConnectionPool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = ConnectionPool<SQLiteConnectionType>;
|
|
149
|
+
declare const sqliteAlwaysNewConnectionPool: <SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> = SQLiteConnectionOptions & Record<string, unknown>>(options: {
|
|
150
|
+
driverType: SQLiteConnectionType["driverType"];
|
|
151
|
+
} & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>) => SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
|
|
152
|
+
type SQLitePoolOptions<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions> = (SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteSingletonConnectionPoolOptions<SQLiteConnectionType, ConnectionOptions> | SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType>) & {
|
|
153
|
+
driverType: SQLiteConnectionType['driverType'];
|
|
154
|
+
serializer?: JSONSerializer;
|
|
155
|
+
};
|
|
156
|
+
type SQLitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection> = SQLiteAmbientConnectionPool<SQLiteConnectionType> | SQLiteSingletonConnectionPool<SQLiteConnectionType> | SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;
|
|
157
|
+
type SQLitePoolFactoryOptions<SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions> = Omit<SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>, 'singleton'> & {
|
|
158
|
+
singleton?: boolean;
|
|
159
|
+
};
|
|
160
|
+
declare const toSqlitePoolOptions: <SQLiteConnectionType extends AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions>(options: SQLitePoolFactoryOptions<SQLiteConnectionType, ConnectionOptions>) => SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>;
|
|
161
|
+
declare function sqlitePool<SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection, ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions>(options: SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>): SQLitePool<SQLiteConnectionType>;
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/storage/sqlite/core/schema/migrations.d.ts
|
|
164
|
+
declare const DefaultSQLiteMigratorOptions: MigratorOptions;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/storage/sqlite/core/schema/schema.d.ts
|
|
167
|
+
declare const defaultSQLiteDatabase = ":memory:";
|
|
168
|
+
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/storage/sqlite/core/sql/formatter/index.d.ts
|
|
171
|
+
declare const sqliteFormatter: SQLFormatter;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/storage/sqlite/core/sql/json.d.ts
|
|
174
|
+
declare const SQLiteJSON: {
|
|
175
|
+
readonly path: (path: string) => SQLPlain;
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/storage/sqlite/core/index.d.ts
|
|
179
|
+
type SQLiteDatabaseName = 'SQLite';
|
|
180
|
+
declare const SQLiteDatabaseName = "SQLite";
|
|
181
|
+
type SQLiteDriverType<DriverName extends string = string> = DatabaseDriverType<SQLiteDatabaseName, DriverName>;
|
|
182
|
+
type SQLiteDatabaseType = 'SQLite';
|
|
183
|
+
//#endregion
|
|
184
|
+
export { parsePragmasFromConnectionString as $, SQLiteClientConnection as A, SQLiteError as B, AnySQLiteClientConnection as C, DEFAULT_SQLITE_PRAGMA_OPTIONS as D, BatchSQLiteCommandOptions as E, SQLiteCommandOptions as F, SqliteAmbientClientConnectionOptions as G, SQLitePoolClient as H, SQLiteConnection as I, sqliteClientConnection as J, isSQLiteError as K, SQLiteConnectionDefinitionOptions as L, SQLiteClientFactory as M, SQLiteClientOptions as N, InMemorySQLiteDatabase as O, SQLiteClientOrPoolClient as P, SQLitePragmaOptions as Q, SQLiteConnectionFactory as R, mapSqliteError as S, AnySQLitePoolClientConnection as T, SQLitePoolClientConnection as U, SQLiteParameters as V, SQLitePoolConnectionDefinitionOptions as W, sqlitePoolClientConnection as X, sqliteConnection as Y, SQLiteConnectionString as Z, sqliteAlwaysNewConnectionPool as _, sqliteFormatter as a, SQLiteSQLExecutor as at, sqliteSingletonConnectionPool as b, DefaultSQLiteMigratorOptions as c, SQLiteFileNameOrConnectionString as d, SQLiteTransaction as et, SQLitePool as f, isInMemoryDatabase as g, SQLiteSingletonConnectionPool as h, SQLiteJSON as i, SQLiteErrorMapper as it, SQLiteClientConnectionDefinitionOptions as j, SQLiteClient as k, SQLiteAlwaysNewConnectionPool as l, SQLitePoolOptions as m, SQLiteDatabaseType as n, SQLiteTransactionOptions as nt, defaultSQLiteDatabase as o, sqliteExecute as ot, SQLitePoolFactoryOptions as p, sqliteAmbientClientConnection as q, SQLiteDriverType as r, sqliteTransaction as rt, tableExists as s, sqliteSQLExecutor as st, SQLiteDatabaseName as t, SQLiteTransactionMode as tt, SQLiteAmbientConnectionPool as u, sqliteAmbientConnectionPool as v, AnySQLiteConnection as w, toSqlitePoolOptions as x, sqlitePool as y, SQLiteConnectionOptions as z };
|