@event-driven-io/dumbo 0.13.0-beta.2 → 0.13.0-beta.20
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-3B24ORM3.js +34 -0
- package/dist/chunk-3B24ORM3.js.map +1 -0
- package/dist/chunk-FXETEUW2.cjs +34 -0
- package/dist/chunk-FXETEUW2.cjs.map +1 -0
- package/dist/chunk-JDP6VMRY.cjs +556 -0
- package/dist/chunk-JDP6VMRY.cjs.map +1 -0
- package/dist/{chunk-OJ34O3Q2.cjs → chunk-PYTHH6WO.cjs} +2161 -1639
- package/dist/chunk-PYTHH6WO.cjs.map +1 -0
- package/dist/chunk-SQXAAA3N.cjs +481 -0
- package/dist/chunk-SQXAAA3N.cjs.map +1 -0
- package/dist/chunk-U445U32Q.js +83 -0
- package/dist/chunk-U445U32Q.js.map +1 -0
- package/dist/{chunk-XVV3OOQX.js → chunk-USPL7TWB.js} +209 -58
- package/dist/chunk-USPL7TWB.js.map +1 -0
- package/dist/chunk-V3QUMPUM.js +481 -0
- package/dist/chunk-V3QUMPUM.js.map +1 -0
- package/dist/chunk-VIQJEUVF.cjs +83 -0
- package/dist/chunk-VIQJEUVF.cjs.map +1 -0
- package/dist/{chunk-N7RWT46K.js → chunk-ZH6YVE3B.js} +2132 -1610
- package/dist/chunk-ZH6YVE3B.js.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-BwcyMnUX.d.ts} +1 -1
- package/dist/{columnProcessors-BX-sH7ah.d.cts → columnProcessors-CO9z2XBz.d.cts} +1 -1
- package/dist/{connectionString-B1wm0TFc.d.cts → connectionString-DHJiGj2D.d.cts} +339 -129
- package/dist/{connectionString-B1wm0TFc.d.ts → connectionString-DHJiGj2D.d.ts} +339 -129
- 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 +99 -7
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +375 -9
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +76 -104
- package/dist/pg.d.ts +76 -104
- package/dist/pg.js +427 -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} +24 -7
- package/dist/{index-C2z_XBn6.d.ts → sqlite.d.ts} +24 -7
- package/dist/sqlite.js +56 -0
- package/dist/sqlite3.cjs +240 -11
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +38 -18
- package/dist/sqlite3.d.ts +38 -18
- 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/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }require('./chunk-VIQJEUVF.cjs');
|
|
2
|
+
require('./chunk-FXETEUW2.cjs');
|
|
2
3
|
|
|
3
4
|
|
|
4
|
-
var _chunkA7TC7IOPcjs = require('./chunk-A7TC7IOP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -133,7 +133,6 @@ var _chunkA7TC7IOPcjs = require('./chunk-A7TC7IOP.cjs');
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
var _chunkOJ34O3Q2cjs = require('./chunk-OJ34O3Q2.cjs');
|
|
137
136
|
|
|
138
137
|
|
|
139
138
|
|
|
@@ -160,8 +159,45 @@ var _chunkOJ34O3Q2cjs = require('./chunk-OJ34O3Q2.cjs');
|
|
|
160
159
|
|
|
161
160
|
|
|
162
161
|
|
|
162
|
+
var _chunkPYTHH6WOcjs = require('./chunk-PYTHH6WO.cjs');
|
|
163
163
|
|
|
164
|
+
// src/storage/all/connections/connectionString.ts
|
|
165
|
+
var parseConnectionString = (connectionString) => {
|
|
166
|
+
if (connectionString.startsWith("postgresql://") || connectionString.startsWith("postgres://")) {
|
|
167
|
+
return {
|
|
168
|
+
databaseType: "PostgreSQL",
|
|
169
|
+
driverName: "pg"
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
if (connectionString.startsWith("file:") || connectionString === ":memory:" || connectionString.startsWith("/") || connectionString.startsWith("./")) {
|
|
173
|
+
return {
|
|
174
|
+
databaseType: "SQLite",
|
|
175
|
+
driverName: "sqlite3"
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (connectionString.startsWith("d1:")) {
|
|
179
|
+
return {
|
|
180
|
+
databaseType: "SQLite",
|
|
181
|
+
driverName: "d1"
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
throw new Error(
|
|
185
|
+
`Unsupported database connection string: ${connectionString}`
|
|
186
|
+
);
|
|
187
|
+
};
|
|
164
188
|
|
|
189
|
+
// src/storage/all/index.ts
|
|
190
|
+
function dumbo(options) {
|
|
191
|
+
const { driverType } = options;
|
|
192
|
+
const driver = _nullishCoalesce(options.driver, () => ( _chunkPYTHH6WOcjs.dumboDatabaseDriverRegistry.tryGet(options)));
|
|
193
|
+
if (driver === null) {
|
|
194
|
+
throw new Error(`No plugin found for driver type: ${driverType}`);
|
|
195
|
+
}
|
|
196
|
+
return driver.createPool({
|
|
197
|
+
...options,
|
|
198
|
+
driverType: driver.driverType
|
|
199
|
+
});
|
|
200
|
+
}
|
|
165
201
|
|
|
166
202
|
|
|
167
203
|
|
|
@@ -267,5 +303,61 @@ var _chunkOJ34O3Q2cjs = require('./chunk-OJ34O3Q2.cjs');
|
|
|
267
303
|
|
|
268
304
|
|
|
269
305
|
|
|
270
|
-
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
exports.ANSISQLIdentifierQuote = _chunkPYTHH6WOcjs.ANSISQLIdentifierQuote; exports.ANSISQLParamPlaceholder = _chunkPYTHH6WOcjs.ANSISQLParamPlaceholder; exports.AdminShutdownError = _chunkPYTHH6WOcjs.AdminShutdownError; exports.AutoIncrementSQLColumnToken = _chunkPYTHH6WOcjs.AutoIncrementSQLColumnToken; exports.BatchCommandNoChangesError = _chunkPYTHH6WOcjs.BatchCommandNoChangesError; exports.BigIntegerToken = _chunkPYTHH6WOcjs.BigIntegerToken; exports.BigSerialToken = _chunkPYTHH6WOcjs.BigSerialToken; exports.CheckViolationError = _chunkPYTHH6WOcjs.CheckViolationError; exports.ColumnTypeToken = _chunkPYTHH6WOcjs.ColumnTypeToken; exports.ColumnURN = _chunkPYTHH6WOcjs.ColumnURN; exports.ColumnURNType = _chunkPYTHH6WOcjs.ColumnURNType; exports.ConcurrencyError = _chunkPYTHH6WOcjs.ConcurrencyError; exports.ConnectionError = _chunkPYTHH6WOcjs.ConnectionError; exports.DataError = _chunkPYTHH6WOcjs.DataError; exports.DatabaseSchemaURN = _chunkPYTHH6WOcjs.DatabaseSchemaURN; exports.DatabaseSchemaURNType = _chunkPYTHH6WOcjs.DatabaseSchemaURNType; exports.DatabaseURN = _chunkPYTHH6WOcjs.DatabaseURN; exports.DatabaseURNType = _chunkPYTHH6WOcjs.DatabaseURNType; exports.DeadlockError = _chunkPYTHH6WOcjs.DeadlockError; exports.DefaultMapSQLParamValueOptions = _chunkPYTHH6WOcjs.DefaultMapSQLParamValueOptions; exports.DumboDatabaseDriverRegistry = _chunkPYTHH6WOcjs.DumboDatabaseDriverRegistry; exports.DumboDatabaseMetadataRegistry = _chunkPYTHH6WOcjs.DumboDatabaseMetadataRegistry; exports.DumboError = _chunkPYTHH6WOcjs.DumboError; exports.ExclusionViolationError = _chunkPYTHH6WOcjs.ExclusionViolationError; exports.ExpandArrayProcessor = _chunkPYTHH6WOcjs.ExpandArrayProcessor; exports.ExpandSQLInProcessor = _chunkPYTHH6WOcjs.ExpandSQLInProcessor; exports.ForeignKeyViolationError = _chunkPYTHH6WOcjs.ForeignKeyViolationError; exports.FormatIdentifierProcessor = _chunkPYTHH6WOcjs.FormatIdentifierProcessor; exports.IndexURN = _chunkPYTHH6WOcjs.IndexURN; exports.IndexURNType = _chunkPYTHH6WOcjs.IndexURNType; exports.InsufficientResourcesError = _chunkPYTHH6WOcjs.InsufficientResourcesError; exports.IntegerToken = _chunkPYTHH6WOcjs.IntegerToken; exports.IntegrityConstraintViolationError = _chunkPYTHH6WOcjs.IntegrityConstraintViolationError; exports.InvalidOperationError = _chunkPYTHH6WOcjs.InvalidOperationError; exports.JSONBToken = _chunkPYTHH6WOcjs.JSONBToken; exports.JSONCodec = _chunkPYTHH6WOcjs.JSONCodec; exports.JSONReplacer = _chunkPYTHH6WOcjs.JSONReplacer; exports.JSONReplacers = _chunkPYTHH6WOcjs.JSONReplacers; exports.JSONReviver = _chunkPYTHH6WOcjs.JSONReviver; exports.JSONRevivers = _chunkPYTHH6WOcjs.JSONRevivers; exports.JSONSerializer = _chunkPYTHH6WOcjs.JSONSerializer; exports.LockNotAvailableError = _chunkPYTHH6WOcjs.LockNotAvailableError; exports.LogLevel = _chunkPYTHH6WOcjs.LogLevel; exports.LogStyle = _chunkPYTHH6WOcjs.LogStyle; exports.MIGRATIONS_LOCK_ID = _chunkPYTHH6WOcjs.MIGRATIONS_LOCK_ID; exports.MapLiteralProcessor = _chunkPYTHH6WOcjs.MapLiteralProcessor; exports.NoDatabaseLock = _chunkPYTHH6WOcjs.NoDatabaseLock; exports.NotNullViolationError = _chunkPYTHH6WOcjs.NotNullViolationError; exports.ParametrizedSQLBuilder = _chunkPYTHH6WOcjs.ParametrizedSQLBuilder; exports.QueryCanceledError = _chunkPYTHH6WOcjs.QueryCanceledError; exports.RawSQL = _chunkPYTHH6WOcjs.RawSQL; exports.SQL = _chunkPYTHH6WOcjs.SQL; exports.SQLArray = _chunkPYTHH6WOcjs.SQLArray; exports.SQLColumnToken = _chunkPYTHH6WOcjs.SQLColumnToken; exports.SQLColumnTypeTokens = _chunkPYTHH6WOcjs.SQLColumnTypeTokens; exports.SQLColumnTypeTokensFactory = _chunkPYTHH6WOcjs.SQLColumnTypeTokensFactory; exports.SQLFormatter = _chunkPYTHH6WOcjs.SQLFormatter; exports.SQLIdentifier = _chunkPYTHH6WOcjs.SQLIdentifier; exports.SQLIn = _chunkPYTHH6WOcjs.SQLIn; exports.SQLLiteral = _chunkPYTHH6WOcjs.SQLLiteral; exports.SQLPlain = _chunkPYTHH6WOcjs.SQLPlain; exports.SQLProcessor = _chunkPYTHH6WOcjs.SQLProcessor; exports.SQLProcessorsRegistry = _chunkPYTHH6WOcjs.SQLProcessorsRegistry; exports.SQLToken = _chunkPYTHH6WOcjs.SQLToken; exports.SQLValueMapper = _chunkPYTHH6WOcjs.SQLValueMapper; exports.SchemaComponentMigrator = _chunkPYTHH6WOcjs.SchemaComponentMigrator; exports.SerialToken = _chunkPYTHH6WOcjs.SerialToken; exports.SerializationError = _chunkPYTHH6WOcjs.SerializationError; exports.SystemError = _chunkPYTHH6WOcjs.SystemError; exports.TableURN = _chunkPYTHH6WOcjs.TableURN; exports.TableURNType = _chunkPYTHH6WOcjs.TableURNType; exports.TimestampToken = _chunkPYTHH6WOcjs.TimestampToken; exports.TimestamptzToken = _chunkPYTHH6WOcjs.TimestamptzToken; exports.TokenizedSQL = _chunkPYTHH6WOcjs.TokenizedSQL; exports.TransientDatabaseError = _chunkPYTHH6WOcjs.TransientDatabaseError; exports.UniqueConstraintError = _chunkPYTHH6WOcjs.UniqueConstraintError; exports.VarcharToken = _chunkPYTHH6WOcjs.VarcharToken; exports.ansiSqlReservedMap = _chunkPYTHH6WOcjs.ansiSqlReservedMap; exports.canHandleDriverWithConnectionString = _chunkPYTHH6WOcjs.canHandleDriverWithConnectionString; exports.color = _chunkPYTHH6WOcjs.color; exports.columnSchemaComponent = _chunkPYTHH6WOcjs.columnSchemaComponent; exports.combineMigrations = _chunkPYTHH6WOcjs.combineMigrations; exports.composeJSONReplacers = _chunkPYTHH6WOcjs.composeJSONReplacers; exports.composeJSONRevivers = _chunkPYTHH6WOcjs.composeJSONRevivers; exports.count = _chunkPYTHH6WOcjs.count; exports.createAlwaysNewConnectionPool = _chunkPYTHH6WOcjs.createAlwaysNewConnectionPool; exports.createAmbientConnection = _chunkPYTHH6WOcjs.createAmbientConnection; exports.createAmbientConnectionPool = _chunkPYTHH6WOcjs.createAmbientConnectionPool; exports.createConnection = _chunkPYTHH6WOcjs.createConnection; exports.createConnectionPool = _chunkPYTHH6WOcjs.createConnectionPool; exports.createSingletonClientPool = _chunkPYTHH6WOcjs.createSingletonClientPool; exports.createSingletonConnection = _chunkPYTHH6WOcjs.createSingletonConnection; exports.createSingletonConnectionPool = _chunkPYTHH6WOcjs.createSingletonConnectionPool; exports.createTransientConnection = _chunkPYTHH6WOcjs.createTransientConnection; exports.databaseSchemaComponent = _chunkPYTHH6WOcjs.databaseSchemaComponent; exports.databaseSchemaSchemaComponent = _chunkPYTHH6WOcjs.databaseSchemaSchemaComponent; exports.defaultDatabaseLockOptions = _chunkPYTHH6WOcjs.defaultDatabaseLockOptions; exports.defaultProcessorsRegistry = _chunkPYTHH6WOcjs.defaultProcessorsRegistry; exports.describeSQL = _chunkPYTHH6WOcjs.describeSQL; exports.dumbo = dumbo; exports.dumboDatabaseDriverRegistry = _chunkPYTHH6WOcjs.dumboDatabaseDriverRegistry; exports.dumboDatabaseMetadataRegistry = _chunkPYTHH6WOcjs.dumboDatabaseMetadataRegistry; exports.dumboSchema = _chunkPYTHH6WOcjs.dumboSchema; exports.executeInAmbientConnection = _chunkPYTHH6WOcjs.executeInAmbientConnection; exports.executeInNewConnection = _chunkPYTHH6WOcjs.executeInNewConnection; exports.executeInNewDbClient = _chunkPYTHH6WOcjs.executeInNewDbClient; exports.executeInTransaction = _chunkPYTHH6WOcjs.executeInTransaction; exports.exists = _chunkPYTHH6WOcjs.exists; exports.filterSchemaComponentsOfType = _chunkPYTHH6WOcjs.filterSchemaComponentsOfType; exports.findSchemaComponentsOfType = _chunkPYTHH6WOcjs.findSchemaComponentsOfType; exports.first = _chunkPYTHH6WOcjs.first; exports.firstOrNull = _chunkPYTHH6WOcjs.firstOrNull; exports.formatSQL = _chunkPYTHH6WOcjs.formatSQL; exports.fromDatabaseDriverType = _chunkPYTHH6WOcjs.fromDatabaseDriverType; exports.getDatabaseDriverName = _chunkPYTHH6WOcjs.getDatabaseDriverName; exports.getDatabaseMetadata = _chunkPYTHH6WOcjs.getDatabaseMetadata; exports.getDatabaseType = _chunkPYTHH6WOcjs.getDatabaseType; exports.getDefaultDatabase = _chunkPYTHH6WOcjs.getDefaultDatabase; exports.getDefaultDatabaseAsync = _chunkPYTHH6WOcjs.getDefaultDatabaseAsync; exports.getDefaultMigratorOptionsFromRegistry = _chunkPYTHH6WOcjs.getDefaultMigratorOptionsFromRegistry; exports.getFormatter = _chunkPYTHH6WOcjs.getFormatter; exports.indexSchemaComponent = _chunkPYTHH6WOcjs.indexSchemaComponent; exports.isSQL = _chunkPYTHH6WOcjs.isSQL; exports.isSchemaComponentOfType = _chunkPYTHH6WOcjs.isSchemaComponentOfType; exports.isTokenizedSQL = _chunkPYTHH6WOcjs.isTokenizedSQL; exports.jsonSerializer = _chunkPYTHH6WOcjs.jsonSerializer; exports.mapANSISQLParamPlaceholder = _chunkPYTHH6WOcjs.mapANSISQLParamPlaceholder; exports.mapColumnToBigint = _chunkPYTHH6WOcjs.mapColumnToBigint; exports.mapColumnToDate = _chunkPYTHH6WOcjs.mapColumnToDate; exports.mapColumnToJSON = _chunkPYTHH6WOcjs.mapColumnToJSON; exports.mapDefaultSQLColumnProcessors = _chunkPYTHH6WOcjs.mapDefaultSQLColumnProcessors; exports.mapRows = _chunkPYTHH6WOcjs.mapRows; exports.mapSQLIdentifier = _chunkPYTHH6WOcjs.mapSQLIdentifier; exports.mapSQLParamValue = _chunkPYTHH6WOcjs.mapSQLParamValue; exports.mapSQLQueryResult = _chunkPYTHH6WOcjs.mapSQLQueryResult; exports.mapSchemaComponentsOfType = _chunkPYTHH6WOcjs.mapSchemaComponentsOfType; exports.mapToCamelCase = _chunkPYTHH6WOcjs.mapToCamelCase; exports.migrationTableSchemaComponent = _chunkPYTHH6WOcjs.migrationTableSchemaComponent; exports.parseConnectionString = parseConnectionString; exports.prettyJson = _chunkPYTHH6WOcjs.prettyJson; exports.registerDefaultMigratorOptions = _chunkPYTHH6WOcjs.registerDefaultMigratorOptions; exports.registerFormatter = _chunkPYTHH6WOcjs.registerFormatter; exports.relationship = _chunkPYTHH6WOcjs.relationship; exports.resolveDatabaseMetadata = _chunkPYTHH6WOcjs.resolveDatabaseMetadata; exports.runSQLMigrations = _chunkPYTHH6WOcjs.runSQLMigrations; exports.schemaComponent = _chunkPYTHH6WOcjs.schemaComponent; exports.schemaComponentURN = _chunkPYTHH6WOcjs.schemaComponentURN; exports.single = _chunkPYTHH6WOcjs.single; exports.singleOrNull = _chunkPYTHH6WOcjs.singleOrNull; exports.sqlExecutor = _chunkPYTHH6WOcjs.sqlExecutor; exports.sqlExecutorInAmbientConnection = _chunkPYTHH6WOcjs.sqlExecutorInAmbientConnection; exports.sqlExecutorInNewConnection = _chunkPYTHH6WOcjs.sqlExecutorInNewConnection; exports.sqlMigration = _chunkPYTHH6WOcjs.sqlMigration; exports.tableSchemaComponent = _chunkPYTHH6WOcjs.tableSchemaComponent; exports.toCamelCase = _chunkPYTHH6WOcjs.toCamelCase; exports.toDatabaseDriverType = _chunkPYTHH6WOcjs.toDatabaseDriverType; exports.tracer = _chunkPYTHH6WOcjs.tracer; exports.transactionFactoryWithAmbientConnection = _chunkPYTHH6WOcjs.transactionFactoryWithAmbientConnection; exports.transactionFactoryWithDbClient = _chunkPYTHH6WOcjs.transactionFactoryWithDbClient; exports.transactionFactoryWithNewConnection = _chunkPYTHH6WOcjs.transactionFactoryWithNewConnection;
|
|
271
363
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/index.cjs","../src/storage/all/connections/connectionString.ts","../src/storage/all/index.ts"],"names":[],"mappings":"AAAA,6MAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AC1JO,IAAM,sBAAA,EAAwB,CACnC,gBAAA,EAAA,GAC4B;AAC5B,EAAA,GAAA,CACE,gBAAA,CAAiB,UAAA,CAAW,eAAe,EAAA,GAC3C,gBAAA,CAAiB,UAAA,CAAW,aAAa,CAAA,EACzC;AACA,IAAA,OAAO;AAAA,MACL,YAAA,EAAc,YAAA;AAAA,MACd,UAAA,EAAY;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,GAAA,CACE,gBAAA,CAAiB,UAAA,CAAW,OAAO,EAAA,GACnC,iBAAA,IAAqB,WAAA,GACrB,gBAAA,CAAiB,UAAA,CAAW,GAAG,EAAA,GAC/B,gBAAA,CAAiB,UAAA,CAAW,IAAI,CAAA,EAChC;AACA,IAAA,OAAO;AAAA,MACL,YAAA,EAAc,QAAA;AAAA,MACd,UAAA,EAAY;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,GAAA,CAAI,gBAAA,CAAiB,UAAA,CAAW,KAAK,CAAA,EAAG;AACtC,IAAA,OAAO;AAAA,MACL,YAAA,EAAc,QAAA;AAAA,MACd,UAAA,EAAY;AAAA,IACd,CAAA;AAAA,EACF;AAEA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,CAAA,wCAAA,EAA2C,gBAAgB,CAAA;AAAA,EAAA;AAE/D;AD+IA;AACA;AEnKO;AAKL,EAAA;AAEA,EAAA;AAIA,EAAA;AACE,IAAA;AAAgE,EAAA;AAGlE,EAAA;AAAyB,IAAA;AACpB,IAAA;AACgB,EAAA;AAEvB;AF4JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/index.cjs","sourcesContent":[null,"import type { DatabaseDriverTypeParts, DatabaseType } from '../../../core';\n\nexport type DatabaseConnectionString<\n DatabaseTypeName extends DatabaseType = DatabaseType,\n Format extends string = string,\n> = Format & {\n _databaseType: DatabaseTypeName;\n};\n\nexport const parseConnectionString = (\n connectionString: DatabaseConnectionString | string,\n): DatabaseDriverTypeParts => {\n if (\n connectionString.startsWith('postgresql://') ||\n connectionString.startsWith('postgres://')\n ) {\n return {\n databaseType: 'PostgreSQL',\n driverName: 'pg',\n };\n }\n\n if (\n connectionString.startsWith('file:') ||\n connectionString === ':memory:' ||\n connectionString.startsWith('/') ||\n connectionString.startsWith('./')\n ) {\n return {\n databaseType: 'SQLite',\n driverName: 'sqlite3',\n };\n }\n\n if (connectionString.startsWith('d1:')) {\n return {\n databaseType: 'SQLite',\n driverName: 'd1',\n };\n }\n\n throw new Error(\n `Unsupported database connection string: ${connectionString}`,\n );\n};\n","import {\n dumboDatabaseDriverRegistry,\n type AnyDumboDatabaseDriver,\n type DumboConnectionOptions,\n type ExtractDumboDatabaseDriverOptions,\n type ExtractDumboTypeFromDriver,\n type JSONSerializationOptions,\n} from '../../core';\n\nexport * from './connections';\n\nexport function dumbo<Driver extends AnyDumboDatabaseDriver>(\n options: ExtractDumboDatabaseDriverOptions<Driver> & {\n driver: Driver;\n } & JSONSerializationOptions,\n): ExtractDumboTypeFromDriver<Driver>;\n\nexport function dumbo<\n DatabaseDriver extends AnyDumboDatabaseDriver = AnyDumboDatabaseDriver,\n ConnectionOptions extends DumboConnectionOptions<DatabaseDriver> =\n DumboConnectionOptions<DatabaseDriver>,\n>(\n options: ConnectionOptions & { driver?: never },\n): ExtractDumboTypeFromDriver<DatabaseDriver>;\n\nexport function dumbo<\n DatabaseDriver extends AnyDumboDatabaseDriver = AnyDumboDatabaseDriver,\n>(\n options: DumboConnectionOptions<DatabaseDriver>,\n): ExtractDumboTypeFromDriver<DatabaseDriver> {\n const { driverType } = options;\n\n const driver =\n options.driver ??\n dumboDatabaseDriverRegistry.tryGet<DatabaseDriver>(options);\n\n if (driver === null) {\n throw new Error(`No plugin found for driver type: ${driverType}`);\n }\n\n return driver.createPool({\n ...options,\n driverType: driver.driverType,\n }) as ExtractDumboTypeFromDriver<DatabaseDriver>;\n}\n\nimport '../postgresql/core/schema/postgreSQLMetadata';\nimport '../sqlite/core/schema/sqliteMetadata';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-
|
|
1
|
+
import { a as SQLProcessor, m as SQLArray, n as SQLIn, o as SQLIdentifier, p as SQLLiteral, q as AnySQLToken, r as DatabaseURN, s as DatabaseSchemaURN, T as TableURN, t as ColumnURN, I as IndexURN, Q as QueryResultRow, u as QueryResult, v as SchemaComponent, w as SQLMigration, M as MigratorOptions, x as DatabaseDriverType, y as Dumbo, z as AnyTypeValidationError, B as TypeValidationSuccess, E as AnyDumboDatabaseDriver, F as ExtractDumboDatabaseDriverOptions, i as JSONSerializationOptions, G as ExtractDumboTypeFromDriver, g as DumboConnectionOptions } from './connectionString-DHJiGj2D.cjs';
|
|
2
|
+
export { d_ as ANSISQLIdentifierQuote, dZ as ANSISQLParamPlaceholder, b2 as AcquireDatabaseLockMode, b3 as AcquireDatabaseLockOptions, aB as AdminShutdownError, bv as AllColumnReferences, bx as AllColumnReferencesInSchema, bu as AllColumnTypes, bw as AllColumnTypesInSchema, ba as AnyColumnSchemaComponent, dC as AnyColumnTypeToken, A as AnyConnection, bg as AnyDatabaseSchemaComponent, bl as AnyDatabaseSchemaSchemaComponent, ab as AnyDatabaseTransaction, bO as AnyRelationshipDefinition, dp as AnySQLProcessor, cO as AnySchemaComponent, cP as AnySchemaComponentOfType, bK as AnyTableRelationshipDefinition, bL as AnyTableRelationshipDefinitionWithColumns, cp as AnyTableSchemaComponent, dO as AutoIncrementSQLColumnToken, aT as BatchCommandNoChangesError, aS as BatchSQLCommandOptions, dG as BigIntegerToken, dE as BigSerialToken, aH as CheckViolationError, c1 as CollectReferencesErrors, c5 as CollectRelationshipErrors, bA as ColumnName, bD as ColumnPath, bF as ColumnPathToReference, bE as ColumnReference, bU as ColumnReferenceError, bR as ColumnReferenceExistanceError, bS as ColumnReferenceTypeMismatchError, b9 as ColumnSchemaComponent, bb as ColumnSchemaComponentOptions, dB as ColumnTypeToken, b8 as ColumnURNType, at as ConcurrencyError, C as Connection, av as ConnectionError, P as ConnectionFactory, O as ConnectionOptions, h as ConnectionPool, a1 as ConnectionPoolFactory, a7 as CreateAlwaysNewConnectionPoolOptions, V as CreateAmbientConnectionOptions, U as CreateConnectionOptions, a9 as CreateConnectionPoolOptions, a5 as CreateSingletonClientPoolOptions, Y as CreateSingletonConnectionOptions, a3 as CreateSingletonConnectionPoolOptions, _ as CreateTransientConnectionOptions, aJ as DataError, cz as DatabaseCapabilities, e3 as DatabaseConnectionString, aj as DatabaseDriverName, al as DatabaseDriverTypeParts, b6 as DatabaseLock, b1 as DatabaseLockOptions, f as DatabaseMetadata, bf as DatabaseSchemaComponent, bk as DatabaseSchemaSchemaComponent, bj as DatabaseSchemaTables, bi as DatabaseSchemaURNType, be as DatabaseSchemas, c3 as DatabaseSchemasWithSingle, j as DatabaseTransaction, c as DatabaseTransactionOptions, ai as DatabaseType, bd as DatabaseURNType, k as DbSQLExecutor, aU as DbSQLExecutorOptions, ax as DeadlockError, e1 as DefaultMapSQLParamValueOptions, D as DefaultSQLColumnToken, d as DumboDatabaseDriver, ar as DumboDatabaseDriverRegistry, cA as DumboDatabaseMetadataRegistry, l as DumboError, cS as DumboSchemaComponentType, aI as ExclusionViolationError, cN as ExtractAdditionalData, bs as ExtractColumnNames, bt as ExtractColumnTypeName, dR as ExtractSQLTokenType, bq as ExtractSchemaNames, br as ExtractTableNames, aF as ForeignKeyViolationError, de as FormatContext, ci as FormatDatabaseValidationErrors, cf as FormatRelationshipBlock, df as FormatSQLOptions, ch as FormatSchemaLevel, ce as FormatSingleError, cg as FormatTableLevel, cj as FormatValidationErrors, cd as IndentErrors, bo as IndexSchemaComponent, bn as IndexURNType, cs as InferColumnType, cy as InferDatabaseSchemas, K as InferDbClientFromConnection, ak as InferDriverDatabaseType, H as InferDriverTypeFromConnection, cx as InferSchemaTables, cv as InferTableRow, co as InferTableSchemaComponentColumns, cn as InferTableSchemaComponentTypes, L as InferTransactionFromConnection, N as InferTransactionOptionsFromConnection, R as InitTransaction, az as InsufficientResourcesError, dF as IntegerToken, aD as IntegrityConstraintViolationError, aK as InvalidOperationError, dH as JSONBToken, d3 as JSONCodec, d9 as JSONCodecOptions, da as JSONDeserializeOptions, d4 as JSONReplacer, d5 as JSONReplacers, d6 as JSONReviver, dd as JSONReviverContext, d7 as JSONRevivers, db as JSONSerializeOptions, J as JSONSerializer, dc as JSONSerializerOptions, dw as JSONValueType, dx as JSONValueTypeName, dy as JavaScriptValueType, dz as JavaScriptValueTypeName, dA as JavaScriptValueTypeToNameMap, cc as Join, ay as LockNotAvailableError, bH as LookupColumnType, cH as MIGRATIONS_LOCK_ID, dX as MapSQLParamValue, dY as MapSQLParamValueOptions, c_ as MigrationRecord, cY as MigrationStyle, b7 as NoDatabaseLock, bT as NoError, bz as NormalizeColumnPath, by as NormalizeReference, aG as NotNullViolationError, dL as NotNullableSQLColumnTokenProps, dM as NullableSQLColumnTokenProps, dl as ParametrizedSQL, dm as ParametrizedSQLBuilder, bG as ParseReferencePath, aC as QueryCanceledError, du as RawSQL, bP as RelationshipColumnsMismatchError, bJ as RelationshipDefinition, bQ as RelationshipReferencesLengthMismatchError, bI as RelationshipType, bV as RelationshipValidationError, b4 as ReleaseDatabaseLockOptions, cK as RunSQLMigrationsResult, dt as SQL, dT as SQLArrayMode, dN as SQLColumnToken, S as SQLColumnTypeTokens, dP as SQLColumnTypeTokensFactory, aR as SQLCommandOptions, dU as SQLDefaultTokens, dV as SQLDefaultTokensTypes, aV as SQLExecutor, e as SQLFormatter, dg as SQLFormatterOptions, dS as SQLPlain, b as SQLProcessorContext, dq as SQLProcessorOptions, dr as SQLProcessorsReadonlyRegistry, ds as SQLProcessorsRegistry, aQ as SQLQueryOptions, aP as SQLQueryResultColumnMapping, dQ as SQLToken, dW as SQLValueMapper, bC as SchemaColumnName, cQ as SchemaComponentOptions, cR as SchemaComponentType, c2 as SchemaTablesWithSingle, dD as SerialToken, d0 as SerializationCodec, aw as SerializationError, c$ as Serializer, aA as SystemError, bB as TableColumnName, cu as TableColumnNames, ct as TableColumnType, cl as TableColumns, bM as TableRelationships, cw as TableRowType, cm as TableSchemaComponent, ck as TableURNType, dI as TimestampToken, dJ as TimestamptzToken, ad as TransactionResult, au as TransientDatabaseError, aE as UniqueConstraintError, bY as ValidateColumnReference, bZ as ValidateColumnTypeMatch, b_ as ValidateColumnsMatch, c9 as ValidateDatabaseSchema, ca as ValidateDatabaseSchemas, cb as ValidateDatabaseSchemasWithMessages, b$ as ValidateReference, c0 as ValidateReferences, c4 as ValidateRelationship, bX as ValidateRelationshipColumns, bW as ValidateRelationshipLength, c8 as ValidateSchemaTables, c7 as ValidateTable, c6 as ValidateTableRelationships, dK as VarcharToken, W as WithConnectionFactory, ac as WithDatabaseTransactionFactory, aW as WithSQLExecutor, cr as Writable, aq as canHandleDriverWithConnectionString, bc as columnSchemaComponent, cM as combineMigrations, d1 as composeJSONReplacers, d2 as composeJSONRevivers, a8 as createAlwaysNewConnectionPool, X as createAmbientConnection, a2 as createAmbientConnectionPool, a0 as createConnection, aa as createConnectionPool, a6 as createSingletonClientPool, Z as createSingletonConnection, a4 as createSingletonConnectionPool, $ as createTransientConnection, bh as databaseSchemaComponent, bm as databaseSchemaSchemaComponent, b5 as defaultDatabaseLockOptions, dn as defaultProcessorsRegistry, dk as describeSQL, as as dumboDatabaseDriverRegistry, cB as dumboDatabaseMetadataRegistry, cG as dumboSchema, b0 as executeInAmbientConnection, a$ as executeInNewConnection, a_ as executeInNewDbClient, ae as executeInTransaction, cV as filterSchemaComponentsOfType, cX as findSchemaComponentsOfType, dj as formatSQL, an as fromDatabaseDriverType, ao as getDatabaseDriverName, cC as getDatabaseMetadata, ap as getDatabaseType, cE as getDefaultDatabase, cF as getDefaultDatabaseAsync, cJ as getDefaultMigratorOptionsFromRegistry, di as getFormatter, bp as indexSchemaComponent, dv as isSQL, cU as isSchemaComponentOfType, d8 as jsonSerializer, d$ as mapANSISQLParamPlaceholder, aM as mapColumnToBigint, aN as mapColumnToDate, aL as mapColumnToJSON, e0 as mapSQLIdentifier, e2 as mapSQLParamValue, aO as mapSQLQueryResult, cW as mapSchemaComponentsOfType, e4 as parseConnectionString, cI as registerDefaultMigratorOptions, dh as registerFormatter, bN as relationship, cD as resolveDatabaseMetadata, cL as runSQLMigrations, cT as schemaComponent, aX as sqlExecutor, aZ as sqlExecutorInAmbientConnection, aY as sqlExecutorInNewConnection, cZ as sqlMigration, cq as tableSchemaComponent, am as toDatabaseDriverType, ah as transactionFactoryWithAmbientConnection, af as transactionFactoryWithDbClient, ag as transactionFactoryWithNewConnection } from './connectionString-DHJiGj2D.cjs';
|
|
3
|
+
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-CO9z2XBz.cjs';
|
|
4
4
|
|
|
5
5
|
type DbClientSetup<DbClient = unknown> = {
|
|
6
6
|
connect: () => Promise<DbClient> | void;
|
|
@@ -51,19 +51,6 @@ declare const schemaComponentURN: {
|
|
|
51
51
|
readonly extractName: (urn: string) => string;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
declare const migrationTableSchemaComponent: {
|
|
55
|
-
schemaComponentKey: "dumbo:schema-component:migrations-table";
|
|
56
|
-
components: ReadonlyMap<string, SchemaComponent>;
|
|
57
|
-
migrations: ReadonlyArray<SQLMigration>;
|
|
58
|
-
addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
|
|
59
|
-
addMigration: (migration: SQLMigration) => void;
|
|
60
|
-
};
|
|
61
|
-
type SchemaComponentMigrator = {
|
|
62
|
-
component: SchemaComponent;
|
|
63
|
-
run: (options?: Partial<MigratorOptions>) => Promise<void>;
|
|
64
|
-
};
|
|
65
|
-
declare const SchemaComponentMigrator: <DriverType extends DatabaseDriverType>(component: SchemaComponent, dumbo: Dumbo<DriverType>) => SchemaComponentMigrator;
|
|
66
|
-
|
|
67
54
|
declare const mapRows: <Result extends QueryResultRow = QueryResultRow, Mapped = unknown>(getResult: Promise<QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
|
|
68
55
|
declare const toCamelCase: (snakeStr: string) => string;
|
|
69
56
|
declare const mapToCamelCase: <T extends Record<string, unknown>>(obj: Record<string, unknown>) => T;
|
|
@@ -81,6 +68,19 @@ type ExistsSQLQueryResult = {
|
|
|
81
68
|
};
|
|
82
69
|
declare const exists: (getResult: Promise<QueryResult<ExistsSQLQueryResult>>) => Promise<boolean>;
|
|
83
70
|
|
|
71
|
+
declare const migrationTableSchemaComponent: {
|
|
72
|
+
schemaComponentKey: "dumbo:schema-component:migrations-table";
|
|
73
|
+
components: ReadonlyMap<string, SchemaComponent>;
|
|
74
|
+
migrations: ReadonlyArray<SQLMigration>;
|
|
75
|
+
addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
|
|
76
|
+
addMigration: (migration: SQLMigration) => void;
|
|
77
|
+
};
|
|
78
|
+
type SchemaComponentMigrator = {
|
|
79
|
+
component: SchemaComponent;
|
|
80
|
+
run: (options?: Partial<MigratorOptions>) => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
declare const SchemaComponentMigrator: <DriverType extends DatabaseDriverType>(component: SchemaComponent, dumbo: Dumbo<DriverType>) => SchemaComponentMigrator;
|
|
83
|
+
|
|
84
84
|
type Expect<T extends true> = T;
|
|
85
85
|
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
|
|
86
86
|
type IsError<T> = T extends AnyTypeValidationError ? true : false;
|
|
@@ -122,6 +122,11 @@ declare const LogStyle: {
|
|
|
122
122
|
PRETTY: LogStyle;
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
declare function dumbo<
|
|
125
|
+
declare function dumbo<Driver extends AnyDumboDatabaseDriver>(options: ExtractDumboDatabaseDriverOptions<Driver> & {
|
|
126
|
+
driver: Driver;
|
|
127
|
+
} & JSONSerializationOptions): ExtractDumboTypeFromDriver<Driver>;
|
|
128
|
+
declare function dumbo<DatabaseDriver extends AnyDumboDatabaseDriver = AnyDumboDatabaseDriver, ConnectionOptions extends DumboConnectionOptions<DatabaseDriver> = DumboConnectionOptions<DatabaseDriver>>(options: ConnectionOptions & {
|
|
129
|
+
driver?: never;
|
|
130
|
+
}): ExtractDumboTypeFromDriver<DatabaseDriver>;
|
|
126
131
|
|
|
127
|
-
export { AnyDumboDatabaseDriver, AnySQLToken, ColumnURN, type CountSQLQueryResult, DatabaseDriverType, DatabaseSchemaURN, DatabaseURN, type DbClientSetup, Dumbo, DumboConnectionOptions, type Equals, type ExistsSQLQueryResult, ExpandArrayProcessor, ExpandSQLInProcessor, type Expect, ExtractDumboTypeFromDriver, FormatIdentifierProcessor, IndexURN, type IsError, type IsOK, LogLevel, LogStyle, type LogType, MapLiteralProcessor, MigratorOptions, QueryResult, QueryResultRow, SQLArray, SQLIdentifier, SQLIn, SQLLiteral, SQLMigration, SQLProcessor, SchemaComponent, SchemaComponentMigrator, TableURN, TokenizedSQL, ansiSqlReservedMap, color, count, dumbo, exists, first, firstOrNull, isTokenizedSQL, mapRows, mapToCamelCase, migrationTableSchemaComponent, prettyJson, schemaComponentURN, single, singleOrNull, toCamelCase, tracer };
|
|
132
|
+
export { AnyDumboDatabaseDriver, AnySQLToken, ColumnURN, type CountSQLQueryResult, DatabaseDriverType, DatabaseSchemaURN, DatabaseURN, type DbClientSetup, Dumbo, DumboConnectionOptions, type Equals, type ExistsSQLQueryResult, ExpandArrayProcessor, ExpandSQLInProcessor, type Expect, ExtractDumboDatabaseDriverOptions, ExtractDumboTypeFromDriver, FormatIdentifierProcessor, IndexURN, type IsError, type IsOK, JSONSerializationOptions, LogLevel, LogStyle, type LogType, MapLiteralProcessor, MigratorOptions, QueryResult, QueryResultRow, SQLArray, SQLIdentifier, SQLIn, SQLLiteral, SQLMigration, SQLProcessor, SchemaComponent, SchemaComponentMigrator, TableURN, TokenizedSQL, ansiSqlReservedMap, color, count, dumbo, exists, first, firstOrNull, isTokenizedSQL, mapRows, mapToCamelCase, migrationTableSchemaComponent, prettyJson, schemaComponentURN, single, singleOrNull, toCamelCase, tracer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-
|
|
1
|
+
import { a as SQLProcessor, m as SQLArray, n as SQLIn, o as SQLIdentifier, p as SQLLiteral, q as AnySQLToken, r as DatabaseURN, s as DatabaseSchemaURN, T as TableURN, t as ColumnURN, I as IndexURN, Q as QueryResultRow, u as QueryResult, v as SchemaComponent, w as SQLMigration, M as MigratorOptions, x as DatabaseDriverType, y as Dumbo, z as AnyTypeValidationError, B as TypeValidationSuccess, E as AnyDumboDatabaseDriver, F as ExtractDumboDatabaseDriverOptions, i as JSONSerializationOptions, G as ExtractDumboTypeFromDriver, g as DumboConnectionOptions } from './connectionString-DHJiGj2D.js';
|
|
2
|
+
export { d_ as ANSISQLIdentifierQuote, dZ as ANSISQLParamPlaceholder, b2 as AcquireDatabaseLockMode, b3 as AcquireDatabaseLockOptions, aB as AdminShutdownError, bv as AllColumnReferences, bx as AllColumnReferencesInSchema, bu as AllColumnTypes, bw as AllColumnTypesInSchema, ba as AnyColumnSchemaComponent, dC as AnyColumnTypeToken, A as AnyConnection, bg as AnyDatabaseSchemaComponent, bl as AnyDatabaseSchemaSchemaComponent, ab as AnyDatabaseTransaction, bO as AnyRelationshipDefinition, dp as AnySQLProcessor, cO as AnySchemaComponent, cP as AnySchemaComponentOfType, bK as AnyTableRelationshipDefinition, bL as AnyTableRelationshipDefinitionWithColumns, cp as AnyTableSchemaComponent, dO as AutoIncrementSQLColumnToken, aT as BatchCommandNoChangesError, aS as BatchSQLCommandOptions, dG as BigIntegerToken, dE as BigSerialToken, aH as CheckViolationError, c1 as CollectReferencesErrors, c5 as CollectRelationshipErrors, bA as ColumnName, bD as ColumnPath, bF as ColumnPathToReference, bE as ColumnReference, bU as ColumnReferenceError, bR as ColumnReferenceExistanceError, bS as ColumnReferenceTypeMismatchError, b9 as ColumnSchemaComponent, bb as ColumnSchemaComponentOptions, dB as ColumnTypeToken, b8 as ColumnURNType, at as ConcurrencyError, C as Connection, av as ConnectionError, P as ConnectionFactory, O as ConnectionOptions, h as ConnectionPool, a1 as ConnectionPoolFactory, a7 as CreateAlwaysNewConnectionPoolOptions, V as CreateAmbientConnectionOptions, U as CreateConnectionOptions, a9 as CreateConnectionPoolOptions, a5 as CreateSingletonClientPoolOptions, Y as CreateSingletonConnectionOptions, a3 as CreateSingletonConnectionPoolOptions, _ as CreateTransientConnectionOptions, aJ as DataError, cz as DatabaseCapabilities, e3 as DatabaseConnectionString, aj as DatabaseDriverName, al as DatabaseDriverTypeParts, b6 as DatabaseLock, b1 as DatabaseLockOptions, f as DatabaseMetadata, bf as DatabaseSchemaComponent, bk as DatabaseSchemaSchemaComponent, bj as DatabaseSchemaTables, bi as DatabaseSchemaURNType, be as DatabaseSchemas, c3 as DatabaseSchemasWithSingle, j as DatabaseTransaction, c as DatabaseTransactionOptions, ai as DatabaseType, bd as DatabaseURNType, k as DbSQLExecutor, aU as DbSQLExecutorOptions, ax as DeadlockError, e1 as DefaultMapSQLParamValueOptions, D as DefaultSQLColumnToken, d as DumboDatabaseDriver, ar as DumboDatabaseDriverRegistry, cA as DumboDatabaseMetadataRegistry, l as DumboError, cS as DumboSchemaComponentType, aI as ExclusionViolationError, cN as ExtractAdditionalData, bs as ExtractColumnNames, bt as ExtractColumnTypeName, dR as ExtractSQLTokenType, bq as ExtractSchemaNames, br as ExtractTableNames, aF as ForeignKeyViolationError, de as FormatContext, ci as FormatDatabaseValidationErrors, cf as FormatRelationshipBlock, df as FormatSQLOptions, ch as FormatSchemaLevel, ce as FormatSingleError, cg as FormatTableLevel, cj as FormatValidationErrors, cd as IndentErrors, bo as IndexSchemaComponent, bn as IndexURNType, cs as InferColumnType, cy as InferDatabaseSchemas, K as InferDbClientFromConnection, ak as InferDriverDatabaseType, H as InferDriverTypeFromConnection, cx as InferSchemaTables, cv as InferTableRow, co as InferTableSchemaComponentColumns, cn as InferTableSchemaComponentTypes, L as InferTransactionFromConnection, N as InferTransactionOptionsFromConnection, R as InitTransaction, az as InsufficientResourcesError, dF as IntegerToken, aD as IntegrityConstraintViolationError, aK as InvalidOperationError, dH as JSONBToken, d3 as JSONCodec, d9 as JSONCodecOptions, da as JSONDeserializeOptions, d4 as JSONReplacer, d5 as JSONReplacers, d6 as JSONReviver, dd as JSONReviverContext, d7 as JSONRevivers, db as JSONSerializeOptions, J as JSONSerializer, dc as JSONSerializerOptions, dw as JSONValueType, dx as JSONValueTypeName, dy as JavaScriptValueType, dz as JavaScriptValueTypeName, dA as JavaScriptValueTypeToNameMap, cc as Join, ay as LockNotAvailableError, bH as LookupColumnType, cH as MIGRATIONS_LOCK_ID, dX as MapSQLParamValue, dY as MapSQLParamValueOptions, c_ as MigrationRecord, cY as MigrationStyle, b7 as NoDatabaseLock, bT as NoError, bz as NormalizeColumnPath, by as NormalizeReference, aG as NotNullViolationError, dL as NotNullableSQLColumnTokenProps, dM as NullableSQLColumnTokenProps, dl as ParametrizedSQL, dm as ParametrizedSQLBuilder, bG as ParseReferencePath, aC as QueryCanceledError, du as RawSQL, bP as RelationshipColumnsMismatchError, bJ as RelationshipDefinition, bQ as RelationshipReferencesLengthMismatchError, bI as RelationshipType, bV as RelationshipValidationError, b4 as ReleaseDatabaseLockOptions, cK as RunSQLMigrationsResult, dt as SQL, dT as SQLArrayMode, dN as SQLColumnToken, S as SQLColumnTypeTokens, dP as SQLColumnTypeTokensFactory, aR as SQLCommandOptions, dU as SQLDefaultTokens, dV as SQLDefaultTokensTypes, aV as SQLExecutor, e as SQLFormatter, dg as SQLFormatterOptions, dS as SQLPlain, b as SQLProcessorContext, dq as SQLProcessorOptions, dr as SQLProcessorsReadonlyRegistry, ds as SQLProcessorsRegistry, aQ as SQLQueryOptions, aP as SQLQueryResultColumnMapping, dQ as SQLToken, dW as SQLValueMapper, bC as SchemaColumnName, cQ as SchemaComponentOptions, cR as SchemaComponentType, c2 as SchemaTablesWithSingle, dD as SerialToken, d0 as SerializationCodec, aw as SerializationError, c$ as Serializer, aA as SystemError, bB as TableColumnName, cu as TableColumnNames, ct as TableColumnType, cl as TableColumns, bM as TableRelationships, cw as TableRowType, cm as TableSchemaComponent, ck as TableURNType, dI as TimestampToken, dJ as TimestamptzToken, ad as TransactionResult, au as TransientDatabaseError, aE as UniqueConstraintError, bY as ValidateColumnReference, bZ as ValidateColumnTypeMatch, b_ as ValidateColumnsMatch, c9 as ValidateDatabaseSchema, ca as ValidateDatabaseSchemas, cb as ValidateDatabaseSchemasWithMessages, b$ as ValidateReference, c0 as ValidateReferences, c4 as ValidateRelationship, bX as ValidateRelationshipColumns, bW as ValidateRelationshipLength, c8 as ValidateSchemaTables, c7 as ValidateTable, c6 as ValidateTableRelationships, dK as VarcharToken, W as WithConnectionFactory, ac as WithDatabaseTransactionFactory, aW as WithSQLExecutor, cr as Writable, aq as canHandleDriverWithConnectionString, bc as columnSchemaComponent, cM as combineMigrations, d1 as composeJSONReplacers, d2 as composeJSONRevivers, a8 as createAlwaysNewConnectionPool, X as createAmbientConnection, a2 as createAmbientConnectionPool, a0 as createConnection, aa as createConnectionPool, a6 as createSingletonClientPool, Z as createSingletonConnection, a4 as createSingletonConnectionPool, $ as createTransientConnection, bh as databaseSchemaComponent, bm as databaseSchemaSchemaComponent, b5 as defaultDatabaseLockOptions, dn as defaultProcessorsRegistry, dk as describeSQL, as as dumboDatabaseDriverRegistry, cB as dumboDatabaseMetadataRegistry, cG as dumboSchema, b0 as executeInAmbientConnection, a$ as executeInNewConnection, a_ as executeInNewDbClient, ae as executeInTransaction, cV as filterSchemaComponentsOfType, cX as findSchemaComponentsOfType, dj as formatSQL, an as fromDatabaseDriverType, ao as getDatabaseDriverName, cC as getDatabaseMetadata, ap as getDatabaseType, cE as getDefaultDatabase, cF as getDefaultDatabaseAsync, cJ as getDefaultMigratorOptionsFromRegistry, di as getFormatter, bp as indexSchemaComponent, dv as isSQL, cU as isSchemaComponentOfType, d8 as jsonSerializer, d$ as mapANSISQLParamPlaceholder, aM as mapColumnToBigint, aN as mapColumnToDate, aL as mapColumnToJSON, e0 as mapSQLIdentifier, e2 as mapSQLParamValue, aO as mapSQLQueryResult, cW as mapSchemaComponentsOfType, e4 as parseConnectionString, cI as registerDefaultMigratorOptions, dh as registerFormatter, bN as relationship, cD as resolveDatabaseMetadata, cL as runSQLMigrations, cT as schemaComponent, aX as sqlExecutor, aZ as sqlExecutorInAmbientConnection, aY as sqlExecutorInNewConnection, cZ as sqlMigration, cq as tableSchemaComponent, am as toDatabaseDriverType, ah as transactionFactoryWithAmbientConnection, af as transactionFactoryWithDbClient, ag as transactionFactoryWithNewConnection } from './connectionString-DHJiGj2D.js';
|
|
3
|
+
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-BwcyMnUX.js';
|
|
4
4
|
|
|
5
5
|
type DbClientSetup<DbClient = unknown> = {
|
|
6
6
|
connect: () => Promise<DbClient> | void;
|
|
@@ -51,19 +51,6 @@ declare const schemaComponentURN: {
|
|
|
51
51
|
readonly extractName: (urn: string) => string;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
declare const migrationTableSchemaComponent: {
|
|
55
|
-
schemaComponentKey: "dumbo:schema-component:migrations-table";
|
|
56
|
-
components: ReadonlyMap<string, SchemaComponent>;
|
|
57
|
-
migrations: ReadonlyArray<SQLMigration>;
|
|
58
|
-
addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
|
|
59
|
-
addMigration: (migration: SQLMigration) => void;
|
|
60
|
-
};
|
|
61
|
-
type SchemaComponentMigrator = {
|
|
62
|
-
component: SchemaComponent;
|
|
63
|
-
run: (options?: Partial<MigratorOptions>) => Promise<void>;
|
|
64
|
-
};
|
|
65
|
-
declare const SchemaComponentMigrator: <DriverType extends DatabaseDriverType>(component: SchemaComponent, dumbo: Dumbo<DriverType>) => SchemaComponentMigrator;
|
|
66
|
-
|
|
67
54
|
declare const mapRows: <Result extends QueryResultRow = QueryResultRow, Mapped = unknown>(getResult: Promise<QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
|
|
68
55
|
declare const toCamelCase: (snakeStr: string) => string;
|
|
69
56
|
declare const mapToCamelCase: <T extends Record<string, unknown>>(obj: Record<string, unknown>) => T;
|
|
@@ -81,6 +68,19 @@ type ExistsSQLQueryResult = {
|
|
|
81
68
|
};
|
|
82
69
|
declare const exists: (getResult: Promise<QueryResult<ExistsSQLQueryResult>>) => Promise<boolean>;
|
|
83
70
|
|
|
71
|
+
declare const migrationTableSchemaComponent: {
|
|
72
|
+
schemaComponentKey: "dumbo:schema-component:migrations-table";
|
|
73
|
+
components: ReadonlyMap<string, SchemaComponent>;
|
|
74
|
+
migrations: ReadonlyArray<SQLMigration>;
|
|
75
|
+
addComponent: <SchemaComponentType extends SchemaComponent<string, Record<string, any>> = SchemaComponent<string, Record<string, any>>>(component: SchemaComponentType) => SchemaComponentType;
|
|
76
|
+
addMigration: (migration: SQLMigration) => void;
|
|
77
|
+
};
|
|
78
|
+
type SchemaComponentMigrator = {
|
|
79
|
+
component: SchemaComponent;
|
|
80
|
+
run: (options?: Partial<MigratorOptions>) => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
declare const SchemaComponentMigrator: <DriverType extends DatabaseDriverType>(component: SchemaComponent, dumbo: Dumbo<DriverType>) => SchemaComponentMigrator;
|
|
83
|
+
|
|
84
84
|
type Expect<T extends true> = T;
|
|
85
85
|
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
|
|
86
86
|
type IsError<T> = T extends AnyTypeValidationError ? true : false;
|
|
@@ -122,6 +122,11 @@ declare const LogStyle: {
|
|
|
122
122
|
PRETTY: LogStyle;
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
declare function dumbo<
|
|
125
|
+
declare function dumbo<Driver extends AnyDumboDatabaseDriver>(options: ExtractDumboDatabaseDriverOptions<Driver> & {
|
|
126
|
+
driver: Driver;
|
|
127
|
+
} & JSONSerializationOptions): ExtractDumboTypeFromDriver<Driver>;
|
|
128
|
+
declare function dumbo<DatabaseDriver extends AnyDumboDatabaseDriver = AnyDumboDatabaseDriver, ConnectionOptions extends DumboConnectionOptions<DatabaseDriver> = DumboConnectionOptions<DatabaseDriver>>(options: ConnectionOptions & {
|
|
129
|
+
driver?: never;
|
|
130
|
+
}): ExtractDumboTypeFromDriver<DatabaseDriver>;
|
|
126
131
|
|
|
127
|
-
export { AnyDumboDatabaseDriver, AnySQLToken, ColumnURN, type CountSQLQueryResult, DatabaseDriverType, DatabaseSchemaURN, DatabaseURN, type DbClientSetup, Dumbo, DumboConnectionOptions, type Equals, type ExistsSQLQueryResult, ExpandArrayProcessor, ExpandSQLInProcessor, type Expect, ExtractDumboTypeFromDriver, FormatIdentifierProcessor, IndexURN, type IsError, type IsOK, LogLevel, LogStyle, type LogType, MapLiteralProcessor, MigratorOptions, QueryResult, QueryResultRow, SQLArray, SQLIdentifier, SQLIn, SQLLiteral, SQLMigration, SQLProcessor, SchemaComponent, SchemaComponentMigrator, TableURN, TokenizedSQL, ansiSqlReservedMap, color, count, dumbo, exists, first, firstOrNull, isTokenizedSQL, mapRows, mapToCamelCase, migrationTableSchemaComponent, prettyJson, schemaComponentURN, single, singleOrNull, toCamelCase, tracer };
|
|
132
|
+
export { AnyDumboDatabaseDriver, AnySQLToken, ColumnURN, type CountSQLQueryResult, DatabaseDriverType, DatabaseSchemaURN, DatabaseURN, type DbClientSetup, Dumbo, DumboConnectionOptions, type Equals, type ExistsSQLQueryResult, ExpandArrayProcessor, ExpandSQLInProcessor, type Expect, ExtractDumboDatabaseDriverOptions, ExtractDumboTypeFromDriver, FormatIdentifierProcessor, IndexURN, type IsError, type IsOK, JSONSerializationOptions, LogLevel, LogStyle, type LogType, MapLiteralProcessor, MigratorOptions, QueryResult, QueryResultRow, SQLArray, SQLIdentifier, SQLIn, SQLLiteral, SQLMigration, SQLProcessor, SchemaComponent, SchemaComponentMigrator, TableURN, TokenizedSQL, ansiSqlReservedMap, color, count, dumbo, exists, first, firstOrNull, isTokenizedSQL, mapRows, mapToCamelCase, migrationTableSchemaComponent, prettyJson, schemaComponentURN, single, singleOrNull, toCamelCase, tracer };
|