@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/pg.d.cts
CHANGED
|
@@ -1,68 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PostgreSQLDriverType } from './postgresql.cjs';
|
|
2
|
+
export { AdvisoryLock, DefaultPostgreSQLMigratorOptions, PostgreSQLArrayProcessor, PostgreSQLConnectionString, PostgreSQLDatabaseName, PostgreSQLExpandSQLInProcessor, acquireAdvisoryLock, advisoryLock, defaultPostgreSQLConnectionString, defaultPostgreSqlDatabase, functionExists, functionExistsSQL, mapPostgresError, parseDatabaseName, pgFormatter, postgreSQLColumnProcessors, postgreSQLMetadata, releaseAdvisoryLock, tableExists, tableExistsSQL, tryAcquireAdvisoryLock } from './postgresql.cjs';
|
|
3
|
+
import { g as DatabaseTransactionOptions, h as DatabaseTransaction, A as AnyConnection, J as JSONSerializer, C as Connection, i as ConnectionPool, I as InferTransactionFromConnection, j as InferTransactionOptionsFromConnection, k as JSONSerializationOptions, l as DbSQLExecutor, c as DumboDatabaseDriver } from './connectionString-oeg1LD5V.cjs';
|
|
2
4
|
import pg from 'pg';
|
|
3
|
-
import
|
|
5
|
+
import './columnProcessors-Difrrk4c.cjs';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare const tryAcquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<boolean>;
|
|
11
|
-
declare const releaseAdvisoryLock: (execute: SQLExecutor, options: ReleaseDatabaseLockOptions) => Promise<boolean>;
|
|
12
|
-
declare const acquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<void>;
|
|
13
|
-
declare const AdvisoryLock: DatabaseLock;
|
|
14
|
-
declare const advisoryLock: (execute: SQLExecutor, options: DatabaseLockOptions) => {
|
|
15
|
-
acquire: (acquireOptions?: {
|
|
16
|
-
mode: AcquireDatabaseLockMode;
|
|
17
|
-
}) => Promise<void>;
|
|
18
|
-
tryAcquire: (acquireOptions?: {
|
|
19
|
-
mode: AcquireDatabaseLockMode;
|
|
20
|
-
}) => Promise<boolean>;
|
|
21
|
-
release: () => Promise<boolean>;
|
|
22
|
-
withAcquire: <Result>(handle: () => Promise<Result>, acquireOptions?: {
|
|
23
|
-
mode: AcquireDatabaseLockMode;
|
|
24
|
-
}) => Promise<Result>;
|
|
7
|
+
type PgTransaction = DatabaseTransaction<PgConnection>;
|
|
8
|
+
type PgIsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SERIALIZABLE';
|
|
9
|
+
type PgTransactionOptions = DatabaseTransactionOptions & {
|
|
10
|
+
isolationLevel?: PgIsolationLevel;
|
|
25
11
|
};
|
|
12
|
+
declare const pgTransaction: <ConnectionType extends AnyConnection = AnyConnection>(connection: () => ConnectionType, serializer: JSONSerializer) => <DbClient extends PgPoolOrClient = PgPoolOrClient>(getClient: Promise<DbClient>, options?: {
|
|
13
|
+
close: (client: DbClient, error?: unknown) => Promise<void>;
|
|
14
|
+
} & PgTransactionOptions) => DatabaseTransaction<ConnectionType>;
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
declare const postgreSQLColumnProcessors: DefaultSQLColumnProcessors;
|
|
38
|
-
|
|
39
|
-
type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
40
|
-
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
41
|
-
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
42
|
-
|
|
43
|
-
type NodePostgresDriverType = PostgreSQLDriverType<'pg'>;
|
|
44
|
-
declare const NodePostgresDriverType: NodePostgresDriverType;
|
|
45
|
-
type NodePostgresPoolClient = pg.PoolClient;
|
|
46
|
-
type NodePostgresClient = pg.Client;
|
|
47
|
-
type NodePostgresClientOrPoolClient = NodePostgresPoolClient | NodePostgresClient;
|
|
48
|
-
type NodePostgresPoolOrClient = pg.Pool | NodePostgresPoolClient | NodePostgresClient;
|
|
49
|
-
type NodePostgresClientConnection = Connection<NodePostgresClientConnection, NodePostgresDriverType, NodePostgresClient>;
|
|
50
|
-
type NodePostgresPoolClientConnection = Connection<NodePostgresPoolClientConnection, NodePostgresDriverType, NodePostgresPoolClient>;
|
|
51
|
-
type NodePostgresConnection = NodePostgresPoolClientConnection | NodePostgresClientConnection;
|
|
52
|
-
type NodePostgresPoolClientOptions = {
|
|
16
|
+
type PgDriverType = PostgreSQLDriverType<'pg'>;
|
|
17
|
+
declare const PgDriverType: PgDriverType;
|
|
18
|
+
type PgPoolClient = pg.PoolClient;
|
|
19
|
+
type PgClient = pg.Client;
|
|
20
|
+
type PgClientOrPoolClient = PgPoolClient | PgClient;
|
|
21
|
+
type PgPoolOrClient = pg.Pool | PgPoolClient | PgClient;
|
|
22
|
+
type PgClientConnection = Connection<PgClientConnection, PgDriverType, PgClient, DatabaseTransaction<PgClientConnection>, PgTransactionOptions>;
|
|
23
|
+
type PgPoolClientConnection = Connection<PgPoolClientConnection, PgDriverType, PgPoolClient, DatabaseTransaction<PgPoolClientConnection>, PgTransactionOptions>;
|
|
24
|
+
type PgConnection = PgPoolClientConnection | PgClientConnection;
|
|
25
|
+
type PgPoolClientOptions = {
|
|
53
26
|
type: 'PoolClient';
|
|
54
|
-
connect: () => Promise<
|
|
55
|
-
close: (client:
|
|
27
|
+
connect: () => Promise<PgPoolClient>;
|
|
28
|
+
close: (client: PgPoolClient) => Promise<void>;
|
|
56
29
|
};
|
|
57
|
-
type
|
|
30
|
+
type PgClientOptions = {
|
|
58
31
|
type: 'Client';
|
|
59
|
-
connect: () => Promise<
|
|
60
|
-
close: (client:
|
|
32
|
+
connect: () => Promise<PgClient>;
|
|
33
|
+
close: (client: PgClient) => Promise<void>;
|
|
61
34
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
35
|
+
type PgClientConnectionOptions = PgClientOptions & {
|
|
36
|
+
serializer: JSONSerializer;
|
|
37
|
+
};
|
|
38
|
+
type PgPoolClientConnectionOptions = PgPoolClientOptions & {
|
|
39
|
+
serializer: JSONSerializer;
|
|
40
|
+
};
|
|
41
|
+
declare const pgClientConnection: (options: PgClientConnectionOptions) => PgClientConnection;
|
|
42
|
+
declare const pgPoolClientConnection: (options: PgPoolClientConnectionOptions) => PgPoolClientConnection;
|
|
43
|
+
type PgConnectionOptions = PgPoolClientConnectionOptions | PgClientConnectionOptions;
|
|
44
|
+
declare function pgConnection(options: PgPoolClientConnectionOptions): PgPoolClientConnection;
|
|
45
|
+
declare function pgConnection(options: PgClientConnectionOptions): PgClientConnection;
|
|
66
46
|
type ConnectionCheckResult = {
|
|
67
47
|
successful: true;
|
|
68
48
|
} | {
|
|
@@ -73,28 +53,32 @@ type ConnectionCheckResult = {
|
|
|
73
53
|
};
|
|
74
54
|
declare const checkConnection: (connectionString: string) => Promise<ConnectionCheckResult>;
|
|
75
55
|
|
|
76
|
-
type
|
|
77
|
-
type
|
|
78
|
-
type
|
|
79
|
-
type
|
|
80
|
-
declare const
|
|
56
|
+
type PgNativePool = ConnectionPool<PgPoolClientConnection, InferTransactionFromConnection<PgPoolClientConnection>, InferTransactionOptionsFromConnection<PgPoolClientConnection>>;
|
|
57
|
+
type PgAmbientClientPool = ConnectionPool<PgClientConnection, InferTransactionFromConnection<PgClientConnection>, InferTransactionOptionsFromConnection<PgClientConnection>>;
|
|
58
|
+
type PgAmbientConnectionPool = ConnectionPool<PgPoolClientConnection | PgClientConnection>;
|
|
59
|
+
type PgPool = PgNativePool | PgAmbientClientPool | PgAmbientConnectionPool;
|
|
60
|
+
declare const pgNativePool: (options: {
|
|
81
61
|
connectionString: string;
|
|
82
62
|
database?: string | undefined;
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
serializer: JSONSerializer;
|
|
64
|
+
}) => PgNativePool;
|
|
65
|
+
declare const pgAmbientNativePool: (options: {
|
|
85
66
|
pool: pg.Pool;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
67
|
+
serializer: JSONSerializer;
|
|
68
|
+
}) => PgNativePool;
|
|
69
|
+
declare const pgAmbientConnectionPool: (options: {
|
|
70
|
+
connection: PgPoolClientConnection | PgClientConnection;
|
|
71
|
+
}) => PgAmbientConnectionPool;
|
|
72
|
+
declare const pgClientPool: (options: {
|
|
91
73
|
connectionString: string;
|
|
92
74
|
database?: string | undefined;
|
|
93
|
-
|
|
94
|
-
|
|
75
|
+
serializer: JSONSerializer;
|
|
76
|
+
}) => PgAmbientClientPool;
|
|
77
|
+
declare const pgAmbientClientPool: (options: {
|
|
95
78
|
client: pg.Client;
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
serializer: JSONSerializer;
|
|
80
|
+
}) => PgAmbientClientPool;
|
|
81
|
+
type PgPoolPooledOptions = {
|
|
98
82
|
connectionString: string;
|
|
99
83
|
database?: string;
|
|
100
84
|
pooled: true;
|
|
@@ -111,7 +95,7 @@ type NodePostgresPoolPooledOptions = {
|
|
|
111
95
|
connectionString: string;
|
|
112
96
|
database?: string;
|
|
113
97
|
};
|
|
114
|
-
type
|
|
98
|
+
type PgPoolNotPooledOptions = {
|
|
115
99
|
connectionString: string;
|
|
116
100
|
database?: string;
|
|
117
101
|
pooled: false;
|
|
@@ -127,45 +111,37 @@ type NodePostgresPoolNotPooledOptions = {
|
|
|
127
111
|
} | {
|
|
128
112
|
connectionString: string;
|
|
129
113
|
database?: string;
|
|
130
|
-
connection:
|
|
114
|
+
connection: PgPoolClientConnection | PgClientConnection;
|
|
131
115
|
pooled?: false;
|
|
132
116
|
};
|
|
133
|
-
type
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
declare
|
|
137
|
-
declare
|
|
138
|
-
declare const getPool: (connectionStringOrOptions: string | pg.PoolConfig) => pg.Pool;
|
|
139
|
-
declare const endPool: ({ connectionString, database, force, }: {
|
|
117
|
+
type PgPoolOptions = (PgPoolPooledOptions | PgPoolNotPooledOptions) & JSONSerializationOptions;
|
|
118
|
+
declare function pgPool(options: PgPoolPooledOptions): PgNativePool;
|
|
119
|
+
declare function pgPool(options: PgPoolNotPooledOptions): PgAmbientClientPool;
|
|
120
|
+
declare const getPgPool: (connectionStringOrOptions: string | pg.PoolConfig) => pg.Pool;
|
|
121
|
+
declare const endPgPool: ({ connectionString, database, force, }: {
|
|
140
122
|
connectionString: string;
|
|
141
123
|
database?: string | undefined;
|
|
142
124
|
force?: boolean;
|
|
143
125
|
}) => Promise<void>;
|
|
144
126
|
declare const onEndPool: (lookupKey: string, pool: pg.Pool) => Promise<void>;
|
|
145
|
-
declare const
|
|
146
|
-
|
|
147
|
-
type NodePostgresTransaction = DatabaseTransaction<NodePostgresConnection>;
|
|
148
|
-
declare const nodePostgresTransaction: <ConnectionType extends AnyConnection = AnyConnection>(connection: () => ConnectionType) => <DbClient extends NodePostgresPoolOrClient = NodePostgresPoolOrClient>(getClient: Promise<DbClient>, options?: {
|
|
149
|
-
close: (client: DbClient, error?: unknown) => Promise<void>;
|
|
150
|
-
} & DatabaseTransactionOptions) => DatabaseTransaction<ConnectionType>;
|
|
151
|
-
|
|
152
|
-
declare const isNodePostgresNativePool: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Pool;
|
|
153
|
-
declare const isNodePostgresClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Client;
|
|
154
|
-
declare const isNodePostgresPoolClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.PoolClient;
|
|
155
|
-
declare const nodePostgresExecute: <Result = void>(poolOrClient: pg.Pool | pg.PoolClient | pg.Client, handle: (client: pg.PoolClient | pg.Client) => Promise<Result>) => Promise<Result>;
|
|
156
|
-
type NodePostgresSQLExecutor = DbSQLExecutor<NodePostgresDriverType, NodePostgresClientOrPoolClient>;
|
|
157
|
-
declare const nodePostgresSQLExecutor: () => NodePostgresSQLExecutor;
|
|
127
|
+
declare const endAllPgPools: () => Promise<void[]>;
|
|
158
128
|
|
|
159
|
-
declare const
|
|
129
|
+
declare const isPgNativePool: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Pool;
|
|
130
|
+
declare const isPgClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Client;
|
|
131
|
+
declare const isPgPoolClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.PoolClient;
|
|
132
|
+
declare const pgExecute: <Result = void>(poolOrClient: pg.Pool | pg.PoolClient | pg.Client, handle: (client: pg.PoolClient | pg.Client) => Promise<Result>) => Promise<Result>;
|
|
133
|
+
type PgSQLExecutor = DbSQLExecutor<PgDriverType, PgClientOrPoolClient>;
|
|
134
|
+
declare const pgSQLExecutor: ({ serializer, }: {
|
|
135
|
+
serializer: JSONSerializer;
|
|
136
|
+
}) => PgSQLExecutor;
|
|
160
137
|
|
|
161
|
-
declare const
|
|
162
|
-
|
|
138
|
+
declare const setPgTypeParser: (client: pg.Client | pg.PoolClient, options?: {
|
|
139
|
+
parseBigInts?: boolean;
|
|
140
|
+
serializer: JSONSerializer;
|
|
141
|
+
}) => void;
|
|
163
142
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
type
|
|
167
|
-
type PostgresPoolOptions = NodePostgresPoolOptions;
|
|
168
|
-
declare const postgresPool: typeof nodePostgresPool;
|
|
169
|
-
declare const connectionPool: typeof nodePostgresPool;
|
|
143
|
+
declare const pgDumboDriver: DumboDatabaseDriver<PgConnection, PgPoolOptions, PgPool>;
|
|
144
|
+
declare const usePgDumboDriver: () => void;
|
|
145
|
+
type PgDumboOptions = PgPoolOptions;
|
|
170
146
|
|
|
171
|
-
export {
|
|
147
|
+
export { type ConnectionCheckResult, type PgAmbientClientPool, type PgAmbientConnectionPool, type PgClient, type PgClientConnection, type PgClientConnectionOptions, type PgClientOptions, type PgClientOrPoolClient, type PgConnection, type PgConnectionOptions, PgDriverType, type PgDumboOptions, type PgIsolationLevel, type PgNativePool, type PgPool, type PgPoolClient, type PgPoolClientConnection, type PgPoolClientConnectionOptions, type PgPoolClientOptions, type PgPoolNotPooledOptions, type PgPoolOptions, type PgPoolOrClient, type PgPoolPooledOptions, type PgSQLExecutor, type PgTransaction, type PgTransactionOptions, PostgreSQLDriverType, checkConnection, endAllPgPools, endPgPool, getPgPool, isPgClient, isPgNativePool, isPgPoolClient, onEndPool, pgAmbientClientPool, pgAmbientConnectionPool, pgAmbientNativePool, pgClientConnection, pgClientPool, pgConnection, pgDumboDriver, pgExecute, pgNativePool, pgPool, pgPoolClientConnection, pgSQLExecutor, pgTransaction, setPgTypeParser, usePgDumboDriver };
|
package/dist/pg.d.ts
CHANGED
|
@@ -1,68 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PostgreSQLDriverType } from './postgresql.js';
|
|
2
|
+
export { AdvisoryLock, DefaultPostgreSQLMigratorOptions, PostgreSQLArrayProcessor, PostgreSQLConnectionString, PostgreSQLDatabaseName, PostgreSQLExpandSQLInProcessor, acquireAdvisoryLock, advisoryLock, defaultPostgreSQLConnectionString, defaultPostgreSqlDatabase, functionExists, functionExistsSQL, mapPostgresError, parseDatabaseName, pgFormatter, postgreSQLColumnProcessors, postgreSQLMetadata, releaseAdvisoryLock, tableExists, tableExistsSQL, tryAcquireAdvisoryLock } from './postgresql.js';
|
|
3
|
+
import { g as DatabaseTransactionOptions, h as DatabaseTransaction, A as AnyConnection, J as JSONSerializer, C as Connection, i as ConnectionPool, I as InferTransactionFromConnection, j as InferTransactionOptionsFromConnection, k as JSONSerializationOptions, l as DbSQLExecutor, c as DumboDatabaseDriver } from './connectionString-oeg1LD5V.js';
|
|
2
4
|
import pg from 'pg';
|
|
3
|
-
import
|
|
5
|
+
import './columnProcessors-C7fRa54L.js';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare const tryAcquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<boolean>;
|
|
11
|
-
declare const releaseAdvisoryLock: (execute: SQLExecutor, options: ReleaseDatabaseLockOptions) => Promise<boolean>;
|
|
12
|
-
declare const acquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<void>;
|
|
13
|
-
declare const AdvisoryLock: DatabaseLock;
|
|
14
|
-
declare const advisoryLock: (execute: SQLExecutor, options: DatabaseLockOptions) => {
|
|
15
|
-
acquire: (acquireOptions?: {
|
|
16
|
-
mode: AcquireDatabaseLockMode;
|
|
17
|
-
}) => Promise<void>;
|
|
18
|
-
tryAcquire: (acquireOptions?: {
|
|
19
|
-
mode: AcquireDatabaseLockMode;
|
|
20
|
-
}) => Promise<boolean>;
|
|
21
|
-
release: () => Promise<boolean>;
|
|
22
|
-
withAcquire: <Result>(handle: () => Promise<Result>, acquireOptions?: {
|
|
23
|
-
mode: AcquireDatabaseLockMode;
|
|
24
|
-
}) => Promise<Result>;
|
|
7
|
+
type PgTransaction = DatabaseTransaction<PgConnection>;
|
|
8
|
+
type PgIsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SERIALIZABLE';
|
|
9
|
+
type PgTransactionOptions = DatabaseTransactionOptions & {
|
|
10
|
+
isolationLevel?: PgIsolationLevel;
|
|
25
11
|
};
|
|
12
|
+
declare const pgTransaction: <ConnectionType extends AnyConnection = AnyConnection>(connection: () => ConnectionType, serializer: JSONSerializer) => <DbClient extends PgPoolOrClient = PgPoolOrClient>(getClient: Promise<DbClient>, options?: {
|
|
13
|
+
close: (client: DbClient, error?: unknown) => Promise<void>;
|
|
14
|
+
} & PgTransactionOptions) => DatabaseTransaction<ConnectionType>;
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
declare const postgreSQLColumnProcessors: DefaultSQLColumnProcessors;
|
|
38
|
-
|
|
39
|
-
type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
40
|
-
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
41
|
-
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
42
|
-
|
|
43
|
-
type NodePostgresDriverType = PostgreSQLDriverType<'pg'>;
|
|
44
|
-
declare const NodePostgresDriverType: NodePostgresDriverType;
|
|
45
|
-
type NodePostgresPoolClient = pg.PoolClient;
|
|
46
|
-
type NodePostgresClient = pg.Client;
|
|
47
|
-
type NodePostgresClientOrPoolClient = NodePostgresPoolClient | NodePostgresClient;
|
|
48
|
-
type NodePostgresPoolOrClient = pg.Pool | NodePostgresPoolClient | NodePostgresClient;
|
|
49
|
-
type NodePostgresClientConnection = Connection<NodePostgresClientConnection, NodePostgresDriverType, NodePostgresClient>;
|
|
50
|
-
type NodePostgresPoolClientConnection = Connection<NodePostgresPoolClientConnection, NodePostgresDriverType, NodePostgresPoolClient>;
|
|
51
|
-
type NodePostgresConnection = NodePostgresPoolClientConnection | NodePostgresClientConnection;
|
|
52
|
-
type NodePostgresPoolClientOptions = {
|
|
16
|
+
type PgDriverType = PostgreSQLDriverType<'pg'>;
|
|
17
|
+
declare const PgDriverType: PgDriverType;
|
|
18
|
+
type PgPoolClient = pg.PoolClient;
|
|
19
|
+
type PgClient = pg.Client;
|
|
20
|
+
type PgClientOrPoolClient = PgPoolClient | PgClient;
|
|
21
|
+
type PgPoolOrClient = pg.Pool | PgPoolClient | PgClient;
|
|
22
|
+
type PgClientConnection = Connection<PgClientConnection, PgDriverType, PgClient, DatabaseTransaction<PgClientConnection>, PgTransactionOptions>;
|
|
23
|
+
type PgPoolClientConnection = Connection<PgPoolClientConnection, PgDriverType, PgPoolClient, DatabaseTransaction<PgPoolClientConnection>, PgTransactionOptions>;
|
|
24
|
+
type PgConnection = PgPoolClientConnection | PgClientConnection;
|
|
25
|
+
type PgPoolClientOptions = {
|
|
53
26
|
type: 'PoolClient';
|
|
54
|
-
connect: () => Promise<
|
|
55
|
-
close: (client:
|
|
27
|
+
connect: () => Promise<PgPoolClient>;
|
|
28
|
+
close: (client: PgPoolClient) => Promise<void>;
|
|
56
29
|
};
|
|
57
|
-
type
|
|
30
|
+
type PgClientOptions = {
|
|
58
31
|
type: 'Client';
|
|
59
|
-
connect: () => Promise<
|
|
60
|
-
close: (client:
|
|
32
|
+
connect: () => Promise<PgClient>;
|
|
33
|
+
close: (client: PgClient) => Promise<void>;
|
|
61
34
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
35
|
+
type PgClientConnectionOptions = PgClientOptions & {
|
|
36
|
+
serializer: JSONSerializer;
|
|
37
|
+
};
|
|
38
|
+
type PgPoolClientConnectionOptions = PgPoolClientOptions & {
|
|
39
|
+
serializer: JSONSerializer;
|
|
40
|
+
};
|
|
41
|
+
declare const pgClientConnection: (options: PgClientConnectionOptions) => PgClientConnection;
|
|
42
|
+
declare const pgPoolClientConnection: (options: PgPoolClientConnectionOptions) => PgPoolClientConnection;
|
|
43
|
+
type PgConnectionOptions = PgPoolClientConnectionOptions | PgClientConnectionOptions;
|
|
44
|
+
declare function pgConnection(options: PgPoolClientConnectionOptions): PgPoolClientConnection;
|
|
45
|
+
declare function pgConnection(options: PgClientConnectionOptions): PgClientConnection;
|
|
66
46
|
type ConnectionCheckResult = {
|
|
67
47
|
successful: true;
|
|
68
48
|
} | {
|
|
@@ -73,28 +53,32 @@ type ConnectionCheckResult = {
|
|
|
73
53
|
};
|
|
74
54
|
declare const checkConnection: (connectionString: string) => Promise<ConnectionCheckResult>;
|
|
75
55
|
|
|
76
|
-
type
|
|
77
|
-
type
|
|
78
|
-
type
|
|
79
|
-
type
|
|
80
|
-
declare const
|
|
56
|
+
type PgNativePool = ConnectionPool<PgPoolClientConnection, InferTransactionFromConnection<PgPoolClientConnection>, InferTransactionOptionsFromConnection<PgPoolClientConnection>>;
|
|
57
|
+
type PgAmbientClientPool = ConnectionPool<PgClientConnection, InferTransactionFromConnection<PgClientConnection>, InferTransactionOptionsFromConnection<PgClientConnection>>;
|
|
58
|
+
type PgAmbientConnectionPool = ConnectionPool<PgPoolClientConnection | PgClientConnection>;
|
|
59
|
+
type PgPool = PgNativePool | PgAmbientClientPool | PgAmbientConnectionPool;
|
|
60
|
+
declare const pgNativePool: (options: {
|
|
81
61
|
connectionString: string;
|
|
82
62
|
database?: string | undefined;
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
serializer: JSONSerializer;
|
|
64
|
+
}) => PgNativePool;
|
|
65
|
+
declare const pgAmbientNativePool: (options: {
|
|
85
66
|
pool: pg.Pool;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
67
|
+
serializer: JSONSerializer;
|
|
68
|
+
}) => PgNativePool;
|
|
69
|
+
declare const pgAmbientConnectionPool: (options: {
|
|
70
|
+
connection: PgPoolClientConnection | PgClientConnection;
|
|
71
|
+
}) => PgAmbientConnectionPool;
|
|
72
|
+
declare const pgClientPool: (options: {
|
|
91
73
|
connectionString: string;
|
|
92
74
|
database?: string | undefined;
|
|
93
|
-
|
|
94
|
-
|
|
75
|
+
serializer: JSONSerializer;
|
|
76
|
+
}) => PgAmbientClientPool;
|
|
77
|
+
declare const pgAmbientClientPool: (options: {
|
|
95
78
|
client: pg.Client;
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
serializer: JSONSerializer;
|
|
80
|
+
}) => PgAmbientClientPool;
|
|
81
|
+
type PgPoolPooledOptions = {
|
|
98
82
|
connectionString: string;
|
|
99
83
|
database?: string;
|
|
100
84
|
pooled: true;
|
|
@@ -111,7 +95,7 @@ type NodePostgresPoolPooledOptions = {
|
|
|
111
95
|
connectionString: string;
|
|
112
96
|
database?: string;
|
|
113
97
|
};
|
|
114
|
-
type
|
|
98
|
+
type PgPoolNotPooledOptions = {
|
|
115
99
|
connectionString: string;
|
|
116
100
|
database?: string;
|
|
117
101
|
pooled: false;
|
|
@@ -127,45 +111,37 @@ type NodePostgresPoolNotPooledOptions = {
|
|
|
127
111
|
} | {
|
|
128
112
|
connectionString: string;
|
|
129
113
|
database?: string;
|
|
130
|
-
connection:
|
|
114
|
+
connection: PgPoolClientConnection | PgClientConnection;
|
|
131
115
|
pooled?: false;
|
|
132
116
|
};
|
|
133
|
-
type
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
declare
|
|
137
|
-
declare
|
|
138
|
-
declare const getPool: (connectionStringOrOptions: string | pg.PoolConfig) => pg.Pool;
|
|
139
|
-
declare const endPool: ({ connectionString, database, force, }: {
|
|
117
|
+
type PgPoolOptions = (PgPoolPooledOptions | PgPoolNotPooledOptions) & JSONSerializationOptions;
|
|
118
|
+
declare function pgPool(options: PgPoolPooledOptions): PgNativePool;
|
|
119
|
+
declare function pgPool(options: PgPoolNotPooledOptions): PgAmbientClientPool;
|
|
120
|
+
declare const getPgPool: (connectionStringOrOptions: string | pg.PoolConfig) => pg.Pool;
|
|
121
|
+
declare const endPgPool: ({ connectionString, database, force, }: {
|
|
140
122
|
connectionString: string;
|
|
141
123
|
database?: string | undefined;
|
|
142
124
|
force?: boolean;
|
|
143
125
|
}) => Promise<void>;
|
|
144
126
|
declare const onEndPool: (lookupKey: string, pool: pg.Pool) => Promise<void>;
|
|
145
|
-
declare const
|
|
146
|
-
|
|
147
|
-
type NodePostgresTransaction = DatabaseTransaction<NodePostgresConnection>;
|
|
148
|
-
declare const nodePostgresTransaction: <ConnectionType extends AnyConnection = AnyConnection>(connection: () => ConnectionType) => <DbClient extends NodePostgresPoolOrClient = NodePostgresPoolOrClient>(getClient: Promise<DbClient>, options?: {
|
|
149
|
-
close: (client: DbClient, error?: unknown) => Promise<void>;
|
|
150
|
-
} & DatabaseTransactionOptions) => DatabaseTransaction<ConnectionType>;
|
|
151
|
-
|
|
152
|
-
declare const isNodePostgresNativePool: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Pool;
|
|
153
|
-
declare const isNodePostgresClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Client;
|
|
154
|
-
declare const isNodePostgresPoolClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.PoolClient;
|
|
155
|
-
declare const nodePostgresExecute: <Result = void>(poolOrClient: pg.Pool | pg.PoolClient | pg.Client, handle: (client: pg.PoolClient | pg.Client) => Promise<Result>) => Promise<Result>;
|
|
156
|
-
type NodePostgresSQLExecutor = DbSQLExecutor<NodePostgresDriverType, NodePostgresClientOrPoolClient>;
|
|
157
|
-
declare const nodePostgresSQLExecutor: () => NodePostgresSQLExecutor;
|
|
127
|
+
declare const endAllPgPools: () => Promise<void[]>;
|
|
158
128
|
|
|
159
|
-
declare const
|
|
129
|
+
declare const isPgNativePool: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Pool;
|
|
130
|
+
declare const isPgClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.Client;
|
|
131
|
+
declare const isPgPoolClient: (poolOrClient: pg.Pool | pg.PoolClient | pg.Client) => poolOrClient is pg.PoolClient;
|
|
132
|
+
declare const pgExecute: <Result = void>(poolOrClient: pg.Pool | pg.PoolClient | pg.Client, handle: (client: pg.PoolClient | pg.Client) => Promise<Result>) => Promise<Result>;
|
|
133
|
+
type PgSQLExecutor = DbSQLExecutor<PgDriverType, PgClientOrPoolClient>;
|
|
134
|
+
declare const pgSQLExecutor: ({ serializer, }: {
|
|
135
|
+
serializer: JSONSerializer;
|
|
136
|
+
}) => PgSQLExecutor;
|
|
160
137
|
|
|
161
|
-
declare const
|
|
162
|
-
|
|
138
|
+
declare const setPgTypeParser: (client: pg.Client | pg.PoolClient, options?: {
|
|
139
|
+
parseBigInts?: boolean;
|
|
140
|
+
serializer: JSONSerializer;
|
|
141
|
+
}) => void;
|
|
163
142
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
type
|
|
167
|
-
type PostgresPoolOptions = NodePostgresPoolOptions;
|
|
168
|
-
declare const postgresPool: typeof nodePostgresPool;
|
|
169
|
-
declare const connectionPool: typeof nodePostgresPool;
|
|
143
|
+
declare const pgDumboDriver: DumboDatabaseDriver<PgConnection, PgPoolOptions, PgPool>;
|
|
144
|
+
declare const usePgDumboDriver: () => void;
|
|
145
|
+
type PgDumboOptions = PgPoolOptions;
|
|
170
146
|
|
|
171
|
-
export {
|
|
147
|
+
export { type ConnectionCheckResult, type PgAmbientClientPool, type PgAmbientConnectionPool, type PgClient, type PgClientConnection, type PgClientConnectionOptions, type PgClientOptions, type PgClientOrPoolClient, type PgConnection, type PgConnectionOptions, PgDriverType, type PgDumboOptions, type PgIsolationLevel, type PgNativePool, type PgPool, type PgPoolClient, type PgPoolClientConnection, type PgPoolClientConnectionOptions, type PgPoolClientOptions, type PgPoolNotPooledOptions, type PgPoolOptions, type PgPoolOrClient, type PgPoolPooledOptions, type PgSQLExecutor, type PgTransaction, type PgTransactionOptions, PostgreSQLDriverType, checkConnection, endAllPgPools, endPgPool, getPgPool, isPgClient, isPgNativePool, isPgPoolClient, onEndPool, pgAmbientClientPool, pgAmbientConnectionPool, pgAmbientNativePool, pgClientConnection, pgClientPool, pgConnection, pgDumboDriver, pgExecute, pgNativePool, pgPool, pgPoolClientConnection, pgSQLExecutor, pgTransaction, setPgTypeParser, usePgDumboDriver };
|