@event-driven-io/dumbo 0.13.0-beta.3 → 0.13.0-beta.30
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-4SM4JJJZ.js +83 -0
- package/dist/chunk-4SM4JJJZ.js.map +1 -0
- package/dist/chunk-EEKBLOCH.cjs +706 -0
- package/dist/chunk-EEKBLOCH.cjs.map +1 -0
- package/dist/{chunk-OJ34O3Q2.cjs → chunk-GVR3PSDL.cjs} +2474 -1636
- package/dist/chunk-GVR3PSDL.cjs.map +1 -0
- package/dist/chunk-HZM7GDOT.cjs +34 -0
- package/dist/chunk-HZM7GDOT.cjs.map +1 -0
- package/dist/{chunk-N7RWT46K.js → chunk-JKE6SULM.js} +2522 -1684
- package/dist/chunk-JKE6SULM.js.map +1 -0
- package/dist/chunk-MOPKHYYU.cjs +83 -0
- package/dist/chunk-MOPKHYYU.cjs.map +1 -0
- package/dist/chunk-RA2L3FQW.js +481 -0
- package/dist/chunk-RA2L3FQW.js.map +1 -0
- package/dist/chunk-UA542GT3.cjs +481 -0
- package/dist/chunk-UA542GT3.cjs.map +1 -0
- package/dist/chunk-WLWELSA2.js +34 -0
- package/dist/chunk-WLWELSA2.js.map +1 -0
- package/dist/chunk-XFEGS3YT.js +706 -0
- package/dist/chunk-XFEGS3YT.js.map +1 -0
- package/dist/cloudflare.cjs +456 -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 +456 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/{columnProcessors-DMPpTPqM.d.ts → columnProcessors-Be2uMYjS.d.cts} +1 -1
- package/dist/{columnProcessors-BX-sH7ah.d.cts → columnProcessors-D0ivj_SU.d.ts} +1 -1
- package/dist/{connectionString-B1wm0TFc.d.cts → connectionString-Dch_MIRU.d.cts} +394 -168
- package/dist/{connectionString-B1wm0TFc.d.ts → connectionString-Dch_MIRU.d.ts} +394 -168
- package/dist/index.cjs +100 -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 +105 -9
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +383 -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 +435 -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 +60 -0
- package/dist/sqlite.cjs.map +1 -0
- package/dist/{index-C2z_XBn6.d.ts → sqlite.d.cts} +69 -20
- package/dist/{index-C0h0c380.d.cts → sqlite.d.ts} +69 -20
- package/dist/sqlite.js +60 -0
- package/dist/sqlite3.cjs +319 -6
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +45 -25
- package/dist/sqlite3.d.ts +45 -25
- package/dist/sqlite3.js +335 -22
- package/dist/sqlite3.js.map +1 -1
- package/package.json +55 -33
- 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 +0 -405
- 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-MOPKHYYU.cjs');
|
|
2
|
+
require('./chunk-HZM7GDOT.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
|
|
|
@@ -162,8 +161,45 @@ var _chunkOJ34O3Q2cjs = require('./chunk-OJ34O3Q2.cjs');
|
|
|
162
161
|
|
|
163
162
|
|
|
164
163
|
|
|
164
|
+
var _chunkGVR3PSDLcjs = require('./chunk-GVR3PSDL.cjs');
|
|
165
165
|
|
|
166
|
+
// src/storage/all/connections/connectionString.ts
|
|
167
|
+
var parseConnectionString = (connectionString) => {
|
|
168
|
+
if (connectionString.startsWith("postgresql://") || connectionString.startsWith("postgres://")) {
|
|
169
|
+
return {
|
|
170
|
+
databaseType: "PostgreSQL",
|
|
171
|
+
driverName: "pg"
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (connectionString.startsWith("file:") || connectionString === ":memory:" || connectionString.startsWith("/") || connectionString.startsWith("./")) {
|
|
175
|
+
return {
|
|
176
|
+
databaseType: "SQLite",
|
|
177
|
+
driverName: "sqlite3"
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (connectionString.startsWith("d1:")) {
|
|
181
|
+
return {
|
|
182
|
+
databaseType: "SQLite",
|
|
183
|
+
driverName: "d1"
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
throw new Error(
|
|
187
|
+
`Unsupported database connection string: ${connectionString}`
|
|
188
|
+
);
|
|
189
|
+
};
|
|
166
190
|
|
|
191
|
+
// src/storage/all/index.ts
|
|
192
|
+
function dumbo(options) {
|
|
193
|
+
const { driverType } = options;
|
|
194
|
+
const driver = _nullishCoalesce(options.driver, () => ( _chunkGVR3PSDLcjs.dumboDatabaseDriverRegistry.tryGet(options)));
|
|
195
|
+
if (driver === null) {
|
|
196
|
+
throw new Error(`No plugin found for driver type: ${driverType}`);
|
|
197
|
+
}
|
|
198
|
+
return driver.createPool({
|
|
199
|
+
...options,
|
|
200
|
+
driverType: driver.driverType
|
|
201
|
+
});
|
|
202
|
+
}
|
|
167
203
|
|
|
168
204
|
|
|
169
205
|
|
|
@@ -267,5 +303,65 @@ 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
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
exports.ANSISQLIdentifierQuote = _chunkGVR3PSDLcjs.ANSISQLIdentifierQuote; exports.ANSISQLParamPlaceholder = _chunkGVR3PSDLcjs.ANSISQLParamPlaceholder; exports.AdminShutdownError = _chunkGVR3PSDLcjs.AdminShutdownError; exports.AutoIncrementSQLColumnToken = _chunkGVR3PSDLcjs.AutoIncrementSQLColumnToken; exports.BatchCommandNoChangesError = _chunkGVR3PSDLcjs.BatchCommandNoChangesError; exports.BigIntegerToken = _chunkGVR3PSDLcjs.BigIntegerToken; exports.BigSerialToken = _chunkGVR3PSDLcjs.BigSerialToken; exports.CheckViolationError = _chunkGVR3PSDLcjs.CheckViolationError; exports.ColumnTypeToken = _chunkGVR3PSDLcjs.ColumnTypeToken; exports.ColumnURN = _chunkGVR3PSDLcjs.ColumnURN; exports.ColumnURNType = _chunkGVR3PSDLcjs.ColumnURNType; exports.ConcurrencyError = _chunkGVR3PSDLcjs.ConcurrencyError; exports.ConnectionError = _chunkGVR3PSDLcjs.ConnectionError; exports.DataError = _chunkGVR3PSDLcjs.DataError; exports.DatabaseSchemaURN = _chunkGVR3PSDLcjs.DatabaseSchemaURN; exports.DatabaseSchemaURNType = _chunkGVR3PSDLcjs.DatabaseSchemaURNType; exports.DatabaseURN = _chunkGVR3PSDLcjs.DatabaseURN; exports.DatabaseURNType = _chunkGVR3PSDLcjs.DatabaseURNType; exports.DeadlockError = _chunkGVR3PSDLcjs.DeadlockError; exports.DefaultMapSQLParamValueOptions = _chunkGVR3PSDLcjs.DefaultMapSQLParamValueOptions; exports.DumboDatabaseDriverRegistry = _chunkGVR3PSDLcjs.DumboDatabaseDriverRegistry; exports.DumboDatabaseMetadataRegistry = _chunkGVR3PSDLcjs.DumboDatabaseMetadataRegistry; exports.DumboError = _chunkGVR3PSDLcjs.DumboError; exports.ExclusionViolationError = _chunkGVR3PSDLcjs.ExclusionViolationError; exports.ExpandArrayProcessor = _chunkGVR3PSDLcjs.ExpandArrayProcessor; exports.ExpandSQLInProcessor = _chunkGVR3PSDLcjs.ExpandSQLInProcessor; exports.ForeignKeyViolationError = _chunkGVR3PSDLcjs.ForeignKeyViolationError; exports.FormatIdentifierProcessor = _chunkGVR3PSDLcjs.FormatIdentifierProcessor; exports.IndexURN = _chunkGVR3PSDLcjs.IndexURN; exports.IndexURNType = _chunkGVR3PSDLcjs.IndexURNType; exports.InsufficientResourcesError = _chunkGVR3PSDLcjs.InsufficientResourcesError; exports.IntegerToken = _chunkGVR3PSDLcjs.IntegerToken; exports.IntegrityConstraintViolationError = _chunkGVR3PSDLcjs.IntegrityConstraintViolationError; exports.InvalidOperationError = _chunkGVR3PSDLcjs.InvalidOperationError; exports.JSONBToken = _chunkGVR3PSDLcjs.JSONBToken; exports.JSONCodec = _chunkGVR3PSDLcjs.JSONCodec; exports.JSONReplacer = _chunkGVR3PSDLcjs.JSONReplacer; exports.JSONReplacers = _chunkGVR3PSDLcjs.JSONReplacers; exports.JSONReviver = _chunkGVR3PSDLcjs.JSONReviver; exports.JSONRevivers = _chunkGVR3PSDLcjs.JSONRevivers; exports.JSONSerializer = _chunkGVR3PSDLcjs.JSONSerializer; exports.LockNotAvailableError = _chunkGVR3PSDLcjs.LockNotAvailableError; exports.LogLevel = _chunkGVR3PSDLcjs.LogLevel; exports.LogStyle = _chunkGVR3PSDLcjs.LogStyle; exports.MIGRATIONS_LOCK_ID = _chunkGVR3PSDLcjs.MIGRATIONS_LOCK_ID; exports.MapLiteralProcessor = _chunkGVR3PSDLcjs.MapLiteralProcessor; exports.NoDatabaseLock = _chunkGVR3PSDLcjs.NoDatabaseLock; exports.NotNullViolationError = _chunkGVR3PSDLcjs.NotNullViolationError; exports.ParametrizedSQLBuilder = _chunkGVR3PSDLcjs.ParametrizedSQLBuilder; exports.QueryCanceledError = _chunkGVR3PSDLcjs.QueryCanceledError; exports.RawSQL = _chunkGVR3PSDLcjs.RawSQL; exports.SQL = _chunkGVR3PSDLcjs.SQL; exports.SQLArray = _chunkGVR3PSDLcjs.SQLArray; exports.SQLColumnToken = _chunkGVR3PSDLcjs.SQLColumnToken; exports.SQLColumnTypeTokens = _chunkGVR3PSDLcjs.SQLColumnTypeTokens; exports.SQLColumnTypeTokensFactory = _chunkGVR3PSDLcjs.SQLColumnTypeTokensFactory; exports.SQLFormatter = _chunkGVR3PSDLcjs.SQLFormatter; exports.SQLIdentifier = _chunkGVR3PSDLcjs.SQLIdentifier; exports.SQLIn = _chunkGVR3PSDLcjs.SQLIn; exports.SQLLiteral = _chunkGVR3PSDLcjs.SQLLiteral; exports.SQLPlain = _chunkGVR3PSDLcjs.SQLPlain; exports.SQLProcessor = _chunkGVR3PSDLcjs.SQLProcessor; exports.SQLProcessorsRegistry = _chunkGVR3PSDLcjs.SQLProcessorsRegistry; exports.SQLToken = _chunkGVR3PSDLcjs.SQLToken; exports.SQLValueMapper = _chunkGVR3PSDLcjs.SQLValueMapper; exports.SchemaComponentMigrator = _chunkGVR3PSDLcjs.SchemaComponentMigrator; exports.SerialToken = _chunkGVR3PSDLcjs.SerialToken; exports.SerializationError = _chunkGVR3PSDLcjs.SerializationError; exports.SystemError = _chunkGVR3PSDLcjs.SystemError; exports.TableURN = _chunkGVR3PSDLcjs.TableURN; exports.TableURNType = _chunkGVR3PSDLcjs.TableURNType; exports.TimestampToken = _chunkGVR3PSDLcjs.TimestampToken; exports.TimestamptzToken = _chunkGVR3PSDLcjs.TimestamptzToken; exports.TokenizedSQL = _chunkGVR3PSDLcjs.TokenizedSQL; exports.TransientDatabaseError = _chunkGVR3PSDLcjs.TransientDatabaseError; exports.UniqueConstraintError = _chunkGVR3PSDLcjs.UniqueConstraintError; exports.VarcharToken = _chunkGVR3PSDLcjs.VarcharToken; exports.ansiSqlReservedMap = _chunkGVR3PSDLcjs.ansiSqlReservedMap; exports.canHandleDriverWithConnectionString = _chunkGVR3PSDLcjs.canHandleDriverWithConnectionString; exports.color = _chunkGVR3PSDLcjs.color; exports.columnSchemaComponent = _chunkGVR3PSDLcjs.columnSchemaComponent; exports.combineMigrations = _chunkGVR3PSDLcjs.combineMigrations; exports.composeJSONReplacers = _chunkGVR3PSDLcjs.composeJSONReplacers; exports.composeJSONRevivers = _chunkGVR3PSDLcjs.composeJSONRevivers; exports.count = _chunkGVR3PSDLcjs.count; exports.createAlwaysNewConnectionPool = _chunkGVR3PSDLcjs.createAlwaysNewConnectionPool; exports.createAmbientConnection = _chunkGVR3PSDLcjs.createAmbientConnection; exports.createAmbientConnectionPool = _chunkGVR3PSDLcjs.createAmbientConnectionPool; exports.createBoundedConnectionPool = _chunkGVR3PSDLcjs.createBoundedConnectionPool; exports.createConnection = _chunkGVR3PSDLcjs.createConnection; exports.createConnectionPool = _chunkGVR3PSDLcjs.createConnectionPool; exports.createSingletonClientConnectionPool = _chunkGVR3PSDLcjs.createSingletonClientConnectionPool; exports.createSingletonConnection = _chunkGVR3PSDLcjs.createSingletonConnection; exports.createSingletonConnectionPool = _chunkGVR3PSDLcjs.createSingletonConnectionPool; exports.createTransientConnection = _chunkGVR3PSDLcjs.createTransientConnection; exports.databaseSchemaComponent = _chunkGVR3PSDLcjs.databaseSchemaComponent; exports.databaseSchemaSchemaComponent = _chunkGVR3PSDLcjs.databaseSchemaSchemaComponent; exports.defaultDatabaseLockOptions = _chunkGVR3PSDLcjs.defaultDatabaseLockOptions; exports.defaultProcessorsRegistry = _chunkGVR3PSDLcjs.defaultProcessorsRegistry; exports.describeSQL = _chunkGVR3PSDLcjs.describeSQL; exports.dumbo = dumbo; exports.dumboDatabaseDriverRegistry = _chunkGVR3PSDLcjs.dumboDatabaseDriverRegistry; exports.dumboDatabaseMetadataRegistry = _chunkGVR3PSDLcjs.dumboDatabaseMetadataRegistry; exports.dumboSchema = _chunkGVR3PSDLcjs.dumboSchema; exports.executeInAmbientConnection = _chunkGVR3PSDLcjs.executeInAmbientConnection; exports.executeInNewConnection = _chunkGVR3PSDLcjs.executeInNewConnection; exports.executeInNewDbClient = _chunkGVR3PSDLcjs.executeInNewDbClient; exports.executeInTransaction = _chunkGVR3PSDLcjs.executeInTransaction; exports.exists = _chunkGVR3PSDLcjs.exists; exports.filterSchemaComponentsOfType = _chunkGVR3PSDLcjs.filterSchemaComponentsOfType; exports.findSchemaComponentsOfType = _chunkGVR3PSDLcjs.findSchemaComponentsOfType; exports.first = _chunkGVR3PSDLcjs.first; exports.firstOrNull = _chunkGVR3PSDLcjs.firstOrNull; exports.formatSQL = _chunkGVR3PSDLcjs.formatSQL; exports.fromDatabaseDriverType = _chunkGVR3PSDLcjs.fromDatabaseDriverType; exports.getDatabaseDriverName = _chunkGVR3PSDLcjs.getDatabaseDriverName; exports.getDatabaseMetadata = _chunkGVR3PSDLcjs.getDatabaseMetadata; exports.getDatabaseType = _chunkGVR3PSDLcjs.getDatabaseType; exports.getDefaultDatabase = _chunkGVR3PSDLcjs.getDefaultDatabase; exports.getDefaultDatabaseAsync = _chunkGVR3PSDLcjs.getDefaultDatabaseAsync; exports.getDefaultMigratorOptionsFromRegistry = _chunkGVR3PSDLcjs.getDefaultMigratorOptionsFromRegistry; exports.getFormatter = _chunkGVR3PSDLcjs.getFormatter; exports.indexSchemaComponent = _chunkGVR3PSDLcjs.indexSchemaComponent; exports.isSQL = _chunkGVR3PSDLcjs.isSQL; exports.isSchemaComponentOfType = _chunkGVR3PSDLcjs.isSchemaComponentOfType; exports.isTokenizedSQL = _chunkGVR3PSDLcjs.isTokenizedSQL; exports.jsonSerializer = _chunkGVR3PSDLcjs.jsonSerializer; exports.mapANSISQLParamPlaceholder = _chunkGVR3PSDLcjs.mapANSISQLParamPlaceholder; exports.mapColumnToBigint = _chunkGVR3PSDLcjs.mapColumnToBigint; exports.mapColumnToDate = _chunkGVR3PSDLcjs.mapColumnToDate; exports.mapColumnToJSON = _chunkGVR3PSDLcjs.mapColumnToJSON; exports.mapDefaultSQLColumnProcessors = _chunkGVR3PSDLcjs.mapDefaultSQLColumnProcessors; exports.mapRows = _chunkGVR3PSDLcjs.mapRows; exports.mapSQLIdentifier = _chunkGVR3PSDLcjs.mapSQLIdentifier; exports.mapSQLParamValue = _chunkGVR3PSDLcjs.mapSQLParamValue; exports.mapSQLQueryResult = _chunkGVR3PSDLcjs.mapSQLQueryResult; exports.mapSchemaComponentsOfType = _chunkGVR3PSDLcjs.mapSchemaComponentsOfType; exports.mapToCamelCase = _chunkGVR3PSDLcjs.mapToCamelCase; exports.migrationTableSchemaComponent = _chunkGVR3PSDLcjs.migrationTableSchemaComponent; exports.parseConnectionString = parseConnectionString; exports.prettyJson = _chunkGVR3PSDLcjs.prettyJson; exports.registerDefaultMigratorOptions = _chunkGVR3PSDLcjs.registerDefaultMigratorOptions; exports.registerFormatter = _chunkGVR3PSDLcjs.registerFormatter; exports.relationship = _chunkGVR3PSDLcjs.relationship; exports.resolveDatabaseMetadata = _chunkGVR3PSDLcjs.resolveDatabaseMetadata; exports.runSQLMigrations = _chunkGVR3PSDLcjs.runSQLMigrations; exports.schemaComponent = _chunkGVR3PSDLcjs.schemaComponent; exports.schemaComponentURN = _chunkGVR3PSDLcjs.schemaComponentURN; exports.single = _chunkGVR3PSDLcjs.single; exports.singleOrNull = _chunkGVR3PSDLcjs.singleOrNull; exports.sqlExecutor = _chunkGVR3PSDLcjs.sqlExecutor; exports.sqlExecutorInAmbientConnection = _chunkGVR3PSDLcjs.sqlExecutorInAmbientConnection; exports.sqlExecutorInNewConnection = _chunkGVR3PSDLcjs.sqlExecutorInNewConnection; exports.sqlMigration = _chunkGVR3PSDLcjs.sqlMigration; exports.tableSchemaComponent = _chunkGVR3PSDLcjs.tableSchemaComponent; exports.toCamelCase = _chunkGVR3PSDLcjs.toCamelCase; exports.toDatabaseDriverType = _chunkGVR3PSDLcjs.toDatabaseDriverType; exports.tracer = _chunkGVR3PSDLcjs.tracer; exports.transactionFactoryWithAmbientConnection = _chunkGVR3PSDLcjs.transactionFactoryWithAmbientConnection; exports.transactionFactoryWithAsyncAmbientConnection = _chunkGVR3PSDLcjs.transactionFactoryWithAsyncAmbientConnection; exports.transactionFactoryWithDbClient = _chunkGVR3PSDLcjs.transactionFactoryWithDbClient; exports.transactionFactoryWithNewConnection = _chunkGVR3PSDLcjs.transactionFactoryWithNewConnection;
|
|
271
367
|
//# 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;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AC5JO,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;ADiJA;AACA;AErKO;AAKL,EAAA;AAEA,EAAA;AAIA,EAAA;AACE,IAAA;AAAgE,EAAA;AAGlE,EAAA;AAAyB,IAAA;AACpB,IAAA;AACgB,EAAA;AAEvB;AF8JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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, n as SQLArray, o as SQLIn, p as SQLIdentifier, q as SQLLiteral, r as AnySQLToken, s as DatabaseURN, t as DatabaseSchemaURN, T as TableURN, u as ColumnURN, I as IndexURN, Q as QueryResultRow, v as QueryResult, w as SchemaComponent, M as MigratorOptions, x as DatabaseDriverType, y as Dumbo, z as SQLMigration, B as AnyTypeValidationError, E as TypeValidationSuccess, F as AnyDumboDatabaseDriver, G as ExtractDumboDatabaseDriverOptions, k as JSONSerializationOptions, H as ExtractDumboTypeFromDriver, c as DumboConnectionOptions } from './connectionString-Dch_MIRU.cjs';
|
|
2
|
+
export { K as ANSISQLIdentifierQuote, L as ANSISQLParamPlaceholder, N as AcquireDatabaseLockMode, O as AcquireDatabaseLockOptions, P as AdminShutdownError, R as AllColumnReferences, U as AllColumnReferencesInSchema, V as AllColumnTypes, W as AllColumnTypesInSchema, X as AmbientConnectionPoolOptions, Y as AnyColumnSchemaComponent, Z as AnyColumnTypeToken, A as AnyConnection, _ as AnyDatabaseSchemaComponent, $ as AnyDatabaseSchemaSchemaComponent, a0 as AnyDatabaseTransaction, a1 as AnyRelationshipDefinition, a2 as AnySQLProcessor, a3 as AnySchemaComponent, a4 as AnySchemaComponentOfType, a5 as AnyTableRelationshipDefinition, a6 as AnyTableRelationshipDefinitionWithColumns, a7 as AnyTableSchemaComponent, a8 as AutoIncrementSQLColumnToken, a9 as BatchCommandNoChangesError, aa as BatchSQLCommandOptions, ab as BigIntegerToken, ac as BigSerialToken, ad as CheckViolationError, ae as CollectReferencesErrors, af as CollectRelationshipErrors, ag as ColumnName, ah as ColumnPath, ai as ColumnPathToReference, aj as ColumnReference, ak as ColumnReferenceError, al as ColumnReferenceExistanceError, am as ColumnReferenceTypeMismatchError, an as ColumnSchemaComponent, ao as ColumnSchemaComponentOptions, ap as ColumnTypeToken, aq as ColumnURNType, ar as ConcurrencyError, C as Connection, as as ConnectionError, at as ConnectionFactory, e as ConnectionOptions, j as ConnectionPool, au as ConnectionPoolFactory, av as CreateAlwaysNewConnectionPoolOptions, aw as CreateAmbientConnectionOptions, ax as CreateBoundedConnectionPoolOptions, ay as CreateConnectionOptions, az as CreateConnectionPoolOptions, aA as CreateSingletonConnectionOptions, aB as CreateTransientConnectionOptions, aC as DataError, aD as DatabaseCapabilities, aE as DatabaseConnectionString, aF as DatabaseDriverName, aG as DatabaseDriverTypeParts, aH as DatabaseLock, aI as DatabaseLockOptions, g as DatabaseMetadata, aJ as DatabaseSchemaComponent, aK as DatabaseSchemaSchemaComponent, aL as DatabaseSchemaTables, aM as DatabaseSchemaURNType, aN as DatabaseSchemas, aO as DatabaseSchemasWithSingle, i as DatabaseTransaction, h as DatabaseTransactionOptions, aP as DatabaseType, aQ as DatabaseURNType, l as DbSQLExecutor, aR as DbSQLExecutorOptions, aS as DeadlockError, aT as DefaultMapSQLParamValueOptions, D as DefaultSQLColumnToken, d as DumboDatabaseDriver, aU as DumboDatabaseDriverRegistry, aV as DumboDatabaseMetadataRegistry, m as DumboError, aW as DumboSchemaComponentType, aX as ExclusionViolationError, aY as ExtractAdditionalData, aZ as ExtractColumnNames, a_ as ExtractColumnTypeName, a$ as ExtractSQLTokenType, b0 as ExtractSchemaNames, b1 as ExtractTableNames, b2 as ForeignKeyViolationError, b3 as FormatContext, b4 as FormatDatabaseValidationErrors, b5 as FormatRelationshipBlock, b6 as FormatSQLOptions, b7 as FormatSchemaLevel, b8 as FormatSingleError, b9 as FormatTableLevel, ba as FormatValidationErrors, bb as IndentErrors, bc as IndexSchemaComponent, bd as IndexURNType, be as InferColumnType, bf as InferDatabaseSchemas, bg as InferDbClientFromConnection, bh as InferDriverDatabaseType, bi as InferDriverTypeFromConnection, bj as InferSchemaTables, bk as InferTableRow, bl as InferTableSchemaComponentColumns, bm as InferTableSchemaComponentTypes, bn as InferTransactionFromConnection, bo as InferTransactionOptionsFromConnection, bp as InferTransactionOptionsFromTransaction, bq as InitTransaction, br as InsufficientResourcesError, bs as IntegerToken, bt as IntegrityConstraintViolationError, bu as InvalidOperationError, bv as JSONBToken, bw as JSONCodec, bx as JSONCodecOptions, by as JSONDeserializeOptions, bz as JSONReplacer, bA as JSONReplacers, bB as JSONReviver, bC as JSONReviverContext, bD as JSONRevivers, bE as JSONSerializeOptions, J as JSONSerializer, bF as JSONSerializerOptions, bG as JSONValueType, bH as JSONValueTypeName, bI as JavaScriptValueType, bJ as JavaScriptValueTypeName, bK as JavaScriptValueTypeToNameMap, bL as Join, bM as LockNotAvailableError, bN as LookupColumnType, bO as MIGRATIONS_LOCK_ID, bP as MapSQLParamValue, bQ as MapSQLParamValueOptions, bR as MigrationRecord, bS as MigrationStyle, bT as NoDatabaseLock, bU as NoError, bV as NormalizeColumnPath, bW as NormalizeReference, bX as NotNullViolationError, bY as NotNullableSQLColumnTokenProps, bZ as NullableSQLColumnTokenProps, b_ as ParametrizedSQL, b$ as ParametrizedSQLBuilder, c0 as ParseReferencePath, c1 as QueryCanceledError, c2 as RawSQL, c3 as RelationshipColumnsMismatchError, c4 as RelationshipDefinition, c5 as RelationshipReferencesLengthMismatchError, c6 as RelationshipType, c7 as RelationshipValidationError, c8 as ReleaseDatabaseLockOptions, c9 as RunSQLMigrationsResult, ca as SQL, cb as SQLArrayMode, cc as SQLColumnToken, S as SQLColumnTypeTokens, cd as SQLColumnTypeTokensFactory, ce as SQLCommandOptions, cf as SQLDefaultTokens, cg as SQLDefaultTokensTypes, ch as SQLExecutor, f as SQLFormatter, ci as SQLFormatterOptions, cj as SQLPlain, b as SQLProcessorContext, ck as SQLProcessorOptions, cl as SQLProcessorsReadonlyRegistry, cm as SQLProcessorsRegistry, cn as SQLQueryOptions, co as SQLQueryResultColumnMapping, cp as SQLToken, cq as SQLValueMapper, cr as SchemaColumnName, cs as SchemaComponentOptions, ct as SchemaComponentType, cu as SchemaTablesWithSingle, cv as SerialToken, cw as SerializationCodec, cx as SerializationError, cy as Serializer, cz as SingletonClientConnectionPoolOptions, cA as SingletonConnectionPoolOptions, cB as SystemError, cC as TableColumnName, cD as TableColumnNames, cE as TableColumnType, cF as TableColumns, cG as TableRelationships, cH as TableRowType, cI as TableSchemaComponent, cJ as TableURNType, cK as TimestampToken, cL as TimestamptzToken, cM as TransactionResult, cN as TransientDatabaseError, cO as UniqueConstraintError, cP as ValidateColumnReference, cQ as ValidateColumnTypeMatch, cR as ValidateColumnsMatch, cS as ValidateDatabaseSchema, cT as ValidateDatabaseSchemas, cU as ValidateDatabaseSchemasWithMessages, cV as ValidateReference, cW as ValidateReferences, cX as ValidateRelationship, cY as ValidateRelationshipColumns, cZ as ValidateRelationshipLength, c_ as ValidateSchemaTables, c$ as ValidateTable, d0 as ValidateTableRelationships, d1 as VarcharToken, d2 as WithConnectionFactory, d3 as WithConnectionOptions, d4 as WithDatabaseTransactionFactory, d5 as WithSQLExecutor, d6 as Writable, d7 as canHandleDriverWithConnectionString, d8 as columnSchemaComponent, d9 as combineMigrations, da as composeJSONReplacers, db as composeJSONRevivers, dc as createAlwaysNewConnectionPool, dd as createAmbientConnection, de as createAmbientConnectionPool, df as createBoundedConnectionPool, dg as createConnection, dh as createConnectionPool, di as createSingletonClientConnectionPool, dj as createSingletonConnection, dk as createSingletonConnectionPool, dl as createTransientConnection, dm as databaseSchemaComponent, dn as databaseSchemaSchemaComponent, dp as defaultDatabaseLockOptions, dq as defaultProcessorsRegistry, dr as describeSQL, ds as dumboDatabaseDriverRegistry, dt as dumboDatabaseMetadataRegistry, du as dumboSchema, dv as executeInAmbientConnection, dw as executeInNewConnection, dx as executeInNewDbClient, dy as executeInTransaction, dz as filterSchemaComponentsOfType, dA as findSchemaComponentsOfType, dB as formatSQL, dC as fromDatabaseDriverType, dD as getDatabaseDriverName, dE as getDatabaseMetadata, dF as getDatabaseType, dG as getDefaultDatabase, dH as getDefaultDatabaseAsync, dI as getDefaultMigratorOptionsFromRegistry, dJ as getFormatter, dK as indexSchemaComponent, dL as isSQL, dM as isSchemaComponentOfType, dN as jsonSerializer, dO as mapANSISQLParamPlaceholder, dP as mapColumnToBigint, dQ as mapColumnToDate, dR as mapColumnToJSON, dS as mapSQLIdentifier, dT as mapSQLParamValue, dU as mapSQLQueryResult, dV as mapSchemaComponentsOfType, dW as parseConnectionString, dX as registerDefaultMigratorOptions, dY as registerFormatter, dZ as relationship, d_ as resolveDatabaseMetadata, d$ as runSQLMigrations, e0 as schemaComponent, e1 as sqlExecutor, e2 as sqlExecutorInAmbientConnection, e3 as sqlExecutorInNewConnection, e4 as sqlMigration, e5 as tableSchemaComponent, e6 as toDatabaseDriverType, e7 as transactionFactoryWithAmbientConnection, e8 as transactionFactoryWithAsyncAmbientConnection, e9 as transactionFactoryWithDbClient, ea as transactionFactoryWithNewConnection } from './connectionString-Dch_MIRU.cjs';
|
|
3
|
+
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-Be2uMYjS.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, n as SQLArray, o as SQLIn, p as SQLIdentifier, q as SQLLiteral, r as AnySQLToken, s as DatabaseURN, t as DatabaseSchemaURN, T as TableURN, u as ColumnURN, I as IndexURN, Q as QueryResultRow, v as QueryResult, w as SchemaComponent, M as MigratorOptions, x as DatabaseDriverType, y as Dumbo, z as SQLMigration, B as AnyTypeValidationError, E as TypeValidationSuccess, F as AnyDumboDatabaseDriver, G as ExtractDumboDatabaseDriverOptions, k as JSONSerializationOptions, H as ExtractDumboTypeFromDriver, c as DumboConnectionOptions } from './connectionString-Dch_MIRU.js';
|
|
2
|
+
export { K as ANSISQLIdentifierQuote, L as ANSISQLParamPlaceholder, N as AcquireDatabaseLockMode, O as AcquireDatabaseLockOptions, P as AdminShutdownError, R as AllColumnReferences, U as AllColumnReferencesInSchema, V as AllColumnTypes, W as AllColumnTypesInSchema, X as AmbientConnectionPoolOptions, Y as AnyColumnSchemaComponent, Z as AnyColumnTypeToken, A as AnyConnection, _ as AnyDatabaseSchemaComponent, $ as AnyDatabaseSchemaSchemaComponent, a0 as AnyDatabaseTransaction, a1 as AnyRelationshipDefinition, a2 as AnySQLProcessor, a3 as AnySchemaComponent, a4 as AnySchemaComponentOfType, a5 as AnyTableRelationshipDefinition, a6 as AnyTableRelationshipDefinitionWithColumns, a7 as AnyTableSchemaComponent, a8 as AutoIncrementSQLColumnToken, a9 as BatchCommandNoChangesError, aa as BatchSQLCommandOptions, ab as BigIntegerToken, ac as BigSerialToken, ad as CheckViolationError, ae as CollectReferencesErrors, af as CollectRelationshipErrors, ag as ColumnName, ah as ColumnPath, ai as ColumnPathToReference, aj as ColumnReference, ak as ColumnReferenceError, al as ColumnReferenceExistanceError, am as ColumnReferenceTypeMismatchError, an as ColumnSchemaComponent, ao as ColumnSchemaComponentOptions, ap as ColumnTypeToken, aq as ColumnURNType, ar as ConcurrencyError, C as Connection, as as ConnectionError, at as ConnectionFactory, e as ConnectionOptions, j as ConnectionPool, au as ConnectionPoolFactory, av as CreateAlwaysNewConnectionPoolOptions, aw as CreateAmbientConnectionOptions, ax as CreateBoundedConnectionPoolOptions, ay as CreateConnectionOptions, az as CreateConnectionPoolOptions, aA as CreateSingletonConnectionOptions, aB as CreateTransientConnectionOptions, aC as DataError, aD as DatabaseCapabilities, aE as DatabaseConnectionString, aF as DatabaseDriverName, aG as DatabaseDriverTypeParts, aH as DatabaseLock, aI as DatabaseLockOptions, g as DatabaseMetadata, aJ as DatabaseSchemaComponent, aK as DatabaseSchemaSchemaComponent, aL as DatabaseSchemaTables, aM as DatabaseSchemaURNType, aN as DatabaseSchemas, aO as DatabaseSchemasWithSingle, i as DatabaseTransaction, h as DatabaseTransactionOptions, aP as DatabaseType, aQ as DatabaseURNType, l as DbSQLExecutor, aR as DbSQLExecutorOptions, aS as DeadlockError, aT as DefaultMapSQLParamValueOptions, D as DefaultSQLColumnToken, d as DumboDatabaseDriver, aU as DumboDatabaseDriverRegistry, aV as DumboDatabaseMetadataRegistry, m as DumboError, aW as DumboSchemaComponentType, aX as ExclusionViolationError, aY as ExtractAdditionalData, aZ as ExtractColumnNames, a_ as ExtractColumnTypeName, a$ as ExtractSQLTokenType, b0 as ExtractSchemaNames, b1 as ExtractTableNames, b2 as ForeignKeyViolationError, b3 as FormatContext, b4 as FormatDatabaseValidationErrors, b5 as FormatRelationshipBlock, b6 as FormatSQLOptions, b7 as FormatSchemaLevel, b8 as FormatSingleError, b9 as FormatTableLevel, ba as FormatValidationErrors, bb as IndentErrors, bc as IndexSchemaComponent, bd as IndexURNType, be as InferColumnType, bf as InferDatabaseSchemas, bg as InferDbClientFromConnection, bh as InferDriverDatabaseType, bi as InferDriverTypeFromConnection, bj as InferSchemaTables, bk as InferTableRow, bl as InferTableSchemaComponentColumns, bm as InferTableSchemaComponentTypes, bn as InferTransactionFromConnection, bo as InferTransactionOptionsFromConnection, bp as InferTransactionOptionsFromTransaction, bq as InitTransaction, br as InsufficientResourcesError, bs as IntegerToken, bt as IntegrityConstraintViolationError, bu as InvalidOperationError, bv as JSONBToken, bw as JSONCodec, bx as JSONCodecOptions, by as JSONDeserializeOptions, bz as JSONReplacer, bA as JSONReplacers, bB as JSONReviver, bC as JSONReviverContext, bD as JSONRevivers, bE as JSONSerializeOptions, J as JSONSerializer, bF as JSONSerializerOptions, bG as JSONValueType, bH as JSONValueTypeName, bI as JavaScriptValueType, bJ as JavaScriptValueTypeName, bK as JavaScriptValueTypeToNameMap, bL as Join, bM as LockNotAvailableError, bN as LookupColumnType, bO as MIGRATIONS_LOCK_ID, bP as MapSQLParamValue, bQ as MapSQLParamValueOptions, bR as MigrationRecord, bS as MigrationStyle, bT as NoDatabaseLock, bU as NoError, bV as NormalizeColumnPath, bW as NormalizeReference, bX as NotNullViolationError, bY as NotNullableSQLColumnTokenProps, bZ as NullableSQLColumnTokenProps, b_ as ParametrizedSQL, b$ as ParametrizedSQLBuilder, c0 as ParseReferencePath, c1 as QueryCanceledError, c2 as RawSQL, c3 as RelationshipColumnsMismatchError, c4 as RelationshipDefinition, c5 as RelationshipReferencesLengthMismatchError, c6 as RelationshipType, c7 as RelationshipValidationError, c8 as ReleaseDatabaseLockOptions, c9 as RunSQLMigrationsResult, ca as SQL, cb as SQLArrayMode, cc as SQLColumnToken, S as SQLColumnTypeTokens, cd as SQLColumnTypeTokensFactory, ce as SQLCommandOptions, cf as SQLDefaultTokens, cg as SQLDefaultTokensTypes, ch as SQLExecutor, f as SQLFormatter, ci as SQLFormatterOptions, cj as SQLPlain, b as SQLProcessorContext, ck as SQLProcessorOptions, cl as SQLProcessorsReadonlyRegistry, cm as SQLProcessorsRegistry, cn as SQLQueryOptions, co as SQLQueryResultColumnMapping, cp as SQLToken, cq as SQLValueMapper, cr as SchemaColumnName, cs as SchemaComponentOptions, ct as SchemaComponentType, cu as SchemaTablesWithSingle, cv as SerialToken, cw as SerializationCodec, cx as SerializationError, cy as Serializer, cz as SingletonClientConnectionPoolOptions, cA as SingletonConnectionPoolOptions, cB as SystemError, cC as TableColumnName, cD as TableColumnNames, cE as TableColumnType, cF as TableColumns, cG as TableRelationships, cH as TableRowType, cI as TableSchemaComponent, cJ as TableURNType, cK as TimestampToken, cL as TimestamptzToken, cM as TransactionResult, cN as TransientDatabaseError, cO as UniqueConstraintError, cP as ValidateColumnReference, cQ as ValidateColumnTypeMatch, cR as ValidateColumnsMatch, cS as ValidateDatabaseSchema, cT as ValidateDatabaseSchemas, cU as ValidateDatabaseSchemasWithMessages, cV as ValidateReference, cW as ValidateReferences, cX as ValidateRelationship, cY as ValidateRelationshipColumns, cZ as ValidateRelationshipLength, c_ as ValidateSchemaTables, c$ as ValidateTable, d0 as ValidateTableRelationships, d1 as VarcharToken, d2 as WithConnectionFactory, d3 as WithConnectionOptions, d4 as WithDatabaseTransactionFactory, d5 as WithSQLExecutor, d6 as Writable, d7 as canHandleDriverWithConnectionString, d8 as columnSchemaComponent, d9 as combineMigrations, da as composeJSONReplacers, db as composeJSONRevivers, dc as createAlwaysNewConnectionPool, dd as createAmbientConnection, de as createAmbientConnectionPool, df as createBoundedConnectionPool, dg as createConnection, dh as createConnectionPool, di as createSingletonClientConnectionPool, dj as createSingletonConnection, dk as createSingletonConnectionPool, dl as createTransientConnection, dm as databaseSchemaComponent, dn as databaseSchemaSchemaComponent, dp as defaultDatabaseLockOptions, dq as defaultProcessorsRegistry, dr as describeSQL, ds as dumboDatabaseDriverRegistry, dt as dumboDatabaseMetadataRegistry, du as dumboSchema, dv as executeInAmbientConnection, dw as executeInNewConnection, dx as executeInNewDbClient, dy as executeInTransaction, dz as filterSchemaComponentsOfType, dA as findSchemaComponentsOfType, dB as formatSQL, dC as fromDatabaseDriverType, dD as getDatabaseDriverName, dE as getDatabaseMetadata, dF as getDatabaseType, dG as getDefaultDatabase, dH as getDefaultDatabaseAsync, dI as getDefaultMigratorOptionsFromRegistry, dJ as getFormatter, dK as indexSchemaComponent, dL as isSQL, dM as isSchemaComponentOfType, dN as jsonSerializer, dO as mapANSISQLParamPlaceholder, dP as mapColumnToBigint, dQ as mapColumnToDate, dR as mapColumnToJSON, dS as mapSQLIdentifier, dT as mapSQLParamValue, dU as mapSQLQueryResult, dV as mapSchemaComponentsOfType, dW as parseConnectionString, dX as registerDefaultMigratorOptions, dY as registerFormatter, dZ as relationship, d_ as resolveDatabaseMetadata, d$ as runSQLMigrations, e0 as schemaComponent, e1 as sqlExecutor, e2 as sqlExecutorInAmbientConnection, e3 as sqlExecutorInNewConnection, e4 as sqlMigration, e5 as tableSchemaComponent, e6 as toDatabaseDriverType, e7 as transactionFactoryWithAmbientConnection, e8 as transactionFactoryWithAsyncAmbientConnection, e9 as transactionFactoryWithDbClient, ea as transactionFactoryWithNewConnection } from './connectionString-Dch_MIRU.js';
|
|
3
|
+
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-D0ivj_SU.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 };
|