@event-driven-io/dumbo 0.13.0-beta.2 → 0.13.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-65DKXURG.js +481 -0
- package/dist/chunk-65DKXURG.js.map +1 -0
- package/dist/chunk-7WEBHXZD.cjs +481 -0
- package/dist/chunk-7WEBHXZD.cjs.map +1 -0
- package/dist/chunk-AMACBMAZ.cjs +556 -0
- package/dist/chunk-AMACBMAZ.cjs.map +1 -0
- package/dist/chunk-FC4JR2R3.js +83 -0
- package/dist/chunk-FC4JR2R3.js.map +1 -0
- package/dist/chunk-H7ZKIJHB.cjs +83 -0
- package/dist/chunk-H7ZKIJHB.cjs.map +1 -0
- package/dist/chunk-IVJ3SNPJ.js +34 -0
- package/dist/chunk-IVJ3SNPJ.js.map +1 -0
- package/dist/chunk-R7P7CNMK.cjs +34 -0
- package/dist/chunk-R7P7CNMK.cjs.map +1 -0
- package/dist/{chunk-XVV3OOQX.js → chunk-T4A6BQRA.js} +209 -58
- package/dist/chunk-T4A6BQRA.js.map +1 -0
- package/dist/{chunk-N7RWT46K.js → chunk-XO5T5N5S.js} +2135 -1613
- package/dist/chunk-XO5T5N5S.js.map +1 -0
- package/dist/{chunk-OJ34O3Q2.cjs → chunk-XOQHZABK.cjs} +2161 -1639
- package/dist/chunk-XOQHZABK.cjs.map +1 -0
- package/dist/cloudflare.cjs +451 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +92 -0
- package/dist/cloudflare.d.ts +92 -0
- package/dist/cloudflare.js +451 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/{columnProcessors-DMPpTPqM.d.ts → columnProcessors-C7fRa54L.d.ts} +1 -1
- package/dist/{columnProcessors-BX-sH7ah.d.cts → columnProcessors-Difrrk4c.d.cts} +1 -1
- package/dist/{connectionString-B1wm0TFc.d.cts → connectionString-oeg1LD5V.d.cts} +352 -137
- package/dist/{connectionString-B1wm0TFc.d.ts → connectionString-oeg1LD5V.d.ts} +352 -137
- package/dist/index.cjs +96 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -18
- package/dist/index.d.ts +23 -18
- package/dist/index.js +101 -9
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +382 -9
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +81 -105
- package/dist/pg.d.ts +81 -105
- package/dist/pg.js +434 -61
- package/dist/pg.js.map +1 -1
- package/dist/postgresql.cjs +50 -0
- package/dist/postgresql.cjs.map +1 -0
- package/dist/postgresql.d.cts +61 -0
- package/dist/postgresql.d.ts +61 -0
- package/dist/postgresql.js +50 -0
- package/dist/sqlite.cjs +56 -0
- package/dist/sqlite.cjs.map +1 -0
- package/dist/{index-C0h0c380.d.cts → sqlite.d.cts} +31 -10
- package/dist/{index-C2z_XBn6.d.ts → sqlite.d.ts} +31 -10
- package/dist/sqlite.js +56 -0
- package/dist/sqlite3.cjs +240 -11
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +39 -19
- package/dist/sqlite3.d.ts +39 -19
- package/dist/sqlite3.js +251 -22
- package/dist/sqlite3.js.map +1 -1
- package/package.json +69 -29
- package/dist/chunk-A7TC7IOP.cjs +0 -55
- package/dist/chunk-A7TC7IOP.cjs.map +0 -1
- package/dist/chunk-F7JQ7BX7.js +0 -240
- package/dist/chunk-F7JQ7BX7.js.map +0 -1
- package/dist/chunk-I34X53VL.js +0 -688
- package/dist/chunk-I34X53VL.js.map +0 -1
- package/dist/chunk-ISNF6USX.cjs +0 -688
- package/dist/chunk-ISNF6USX.cjs.map +0 -1
- package/dist/chunk-IYEHOE4S.cjs +0 -405
- package/dist/chunk-IYEHOE4S.cjs.map +0 -1
- package/dist/chunk-L2YZQAG3.cjs +0 -240
- package/dist/chunk-L2YZQAG3.cjs.map +0 -1
- package/dist/chunk-N7RWT46K.js.map +0 -1
- package/dist/chunk-OJ34O3Q2.cjs.map +0 -1
- package/dist/chunk-TXSETOGH.js +0 -55
- package/dist/chunk-TXSETOGH.js.map +0 -1
- package/dist/chunk-XVV3OOQX.js.map +0 -1
- package/dist/d1.cjs +0 -277
- package/dist/d1.cjs.map +0 -1
- package/dist/d1.d.cts +0 -72
- package/dist/d1.d.ts +0 -72
- package/dist/d1.js +0 -277
- package/dist/d1.js.map +0 -1
- package/dist/pg-3ACXFMU4.cjs +0 -59
- package/dist/pg-3ACXFMU4.cjs.map +0 -1
- package/dist/pg-GHOW3XSG.js +0 -59
- package/dist/sqlite3-EEIKQCJR.js +0 -25
- package/dist/sqlite3-SE4DDYZE.cjs +0 -25
- package/dist/sqlite3-SE4DDYZE.cjs.map +0 -1
- /package/dist/{pg-GHOW3XSG.js.map → postgresql.js.map} +0 -0
- /package/dist/{sqlite3-EEIKQCJR.js.map → sqlite.js.map} +0 -0
package/dist/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-H7ZKIJHB.cjs');
|
|
2
|
+
require('./chunk-R7P7CNMK.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 _chunkXOQHZABKcjs = require('./chunk-XOQHZABK.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, () => ( _chunkXOQHZABKcjs.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 = _chunkXOQHZABKcjs.ANSISQLIdentifierQuote; exports.ANSISQLParamPlaceholder = _chunkXOQHZABKcjs.ANSISQLParamPlaceholder; exports.AdminShutdownError = _chunkXOQHZABKcjs.AdminShutdownError; exports.AutoIncrementSQLColumnToken = _chunkXOQHZABKcjs.AutoIncrementSQLColumnToken; exports.BatchCommandNoChangesError = _chunkXOQHZABKcjs.BatchCommandNoChangesError; exports.BigIntegerToken = _chunkXOQHZABKcjs.BigIntegerToken; exports.BigSerialToken = _chunkXOQHZABKcjs.BigSerialToken; exports.CheckViolationError = _chunkXOQHZABKcjs.CheckViolationError; exports.ColumnTypeToken = _chunkXOQHZABKcjs.ColumnTypeToken; exports.ColumnURN = _chunkXOQHZABKcjs.ColumnURN; exports.ColumnURNType = _chunkXOQHZABKcjs.ColumnURNType; exports.ConcurrencyError = _chunkXOQHZABKcjs.ConcurrencyError; exports.ConnectionError = _chunkXOQHZABKcjs.ConnectionError; exports.DataError = _chunkXOQHZABKcjs.DataError; exports.DatabaseSchemaURN = _chunkXOQHZABKcjs.DatabaseSchemaURN; exports.DatabaseSchemaURNType = _chunkXOQHZABKcjs.DatabaseSchemaURNType; exports.DatabaseURN = _chunkXOQHZABKcjs.DatabaseURN; exports.DatabaseURNType = _chunkXOQHZABKcjs.DatabaseURNType; exports.DeadlockError = _chunkXOQHZABKcjs.DeadlockError; exports.DefaultMapSQLParamValueOptions = _chunkXOQHZABKcjs.DefaultMapSQLParamValueOptions; exports.DumboDatabaseDriverRegistry = _chunkXOQHZABKcjs.DumboDatabaseDriverRegistry; exports.DumboDatabaseMetadataRegistry = _chunkXOQHZABKcjs.DumboDatabaseMetadataRegistry; exports.DumboError = _chunkXOQHZABKcjs.DumboError; exports.ExclusionViolationError = _chunkXOQHZABKcjs.ExclusionViolationError; exports.ExpandArrayProcessor = _chunkXOQHZABKcjs.ExpandArrayProcessor; exports.ExpandSQLInProcessor = _chunkXOQHZABKcjs.ExpandSQLInProcessor; exports.ForeignKeyViolationError = _chunkXOQHZABKcjs.ForeignKeyViolationError; exports.FormatIdentifierProcessor = _chunkXOQHZABKcjs.FormatIdentifierProcessor; exports.IndexURN = _chunkXOQHZABKcjs.IndexURN; exports.IndexURNType = _chunkXOQHZABKcjs.IndexURNType; exports.InsufficientResourcesError = _chunkXOQHZABKcjs.InsufficientResourcesError; exports.IntegerToken = _chunkXOQHZABKcjs.IntegerToken; exports.IntegrityConstraintViolationError = _chunkXOQHZABKcjs.IntegrityConstraintViolationError; exports.InvalidOperationError = _chunkXOQHZABKcjs.InvalidOperationError; exports.JSONBToken = _chunkXOQHZABKcjs.JSONBToken; exports.JSONCodec = _chunkXOQHZABKcjs.JSONCodec; exports.JSONReplacer = _chunkXOQHZABKcjs.JSONReplacer; exports.JSONReplacers = _chunkXOQHZABKcjs.JSONReplacers; exports.JSONReviver = _chunkXOQHZABKcjs.JSONReviver; exports.JSONRevivers = _chunkXOQHZABKcjs.JSONRevivers; exports.JSONSerializer = _chunkXOQHZABKcjs.JSONSerializer; exports.LockNotAvailableError = _chunkXOQHZABKcjs.LockNotAvailableError; exports.LogLevel = _chunkXOQHZABKcjs.LogLevel; exports.LogStyle = _chunkXOQHZABKcjs.LogStyle; exports.MIGRATIONS_LOCK_ID = _chunkXOQHZABKcjs.MIGRATIONS_LOCK_ID; exports.MapLiteralProcessor = _chunkXOQHZABKcjs.MapLiteralProcessor; exports.NoDatabaseLock = _chunkXOQHZABKcjs.NoDatabaseLock; exports.NotNullViolationError = _chunkXOQHZABKcjs.NotNullViolationError; exports.ParametrizedSQLBuilder = _chunkXOQHZABKcjs.ParametrizedSQLBuilder; exports.QueryCanceledError = _chunkXOQHZABKcjs.QueryCanceledError; exports.RawSQL = _chunkXOQHZABKcjs.RawSQL; exports.SQL = _chunkXOQHZABKcjs.SQL; exports.SQLArray = _chunkXOQHZABKcjs.SQLArray; exports.SQLColumnToken = _chunkXOQHZABKcjs.SQLColumnToken; exports.SQLColumnTypeTokens = _chunkXOQHZABKcjs.SQLColumnTypeTokens; exports.SQLColumnTypeTokensFactory = _chunkXOQHZABKcjs.SQLColumnTypeTokensFactory; exports.SQLFormatter = _chunkXOQHZABKcjs.SQLFormatter; exports.SQLIdentifier = _chunkXOQHZABKcjs.SQLIdentifier; exports.SQLIn = _chunkXOQHZABKcjs.SQLIn; exports.SQLLiteral = _chunkXOQHZABKcjs.SQLLiteral; exports.SQLPlain = _chunkXOQHZABKcjs.SQLPlain; exports.SQLProcessor = _chunkXOQHZABKcjs.SQLProcessor; exports.SQLProcessorsRegistry = _chunkXOQHZABKcjs.SQLProcessorsRegistry; exports.SQLToken = _chunkXOQHZABKcjs.SQLToken; exports.SQLValueMapper = _chunkXOQHZABKcjs.SQLValueMapper; exports.SchemaComponentMigrator = _chunkXOQHZABKcjs.SchemaComponentMigrator; exports.SerialToken = _chunkXOQHZABKcjs.SerialToken; exports.SerializationError = _chunkXOQHZABKcjs.SerializationError; exports.SystemError = _chunkXOQHZABKcjs.SystemError; exports.TableURN = _chunkXOQHZABKcjs.TableURN; exports.TableURNType = _chunkXOQHZABKcjs.TableURNType; exports.TimestampToken = _chunkXOQHZABKcjs.TimestampToken; exports.TimestamptzToken = _chunkXOQHZABKcjs.TimestamptzToken; exports.TokenizedSQL = _chunkXOQHZABKcjs.TokenizedSQL; exports.TransientDatabaseError = _chunkXOQHZABKcjs.TransientDatabaseError; exports.UniqueConstraintError = _chunkXOQHZABKcjs.UniqueConstraintError; exports.VarcharToken = _chunkXOQHZABKcjs.VarcharToken; exports.ansiSqlReservedMap = _chunkXOQHZABKcjs.ansiSqlReservedMap; exports.canHandleDriverWithConnectionString = _chunkXOQHZABKcjs.canHandleDriverWithConnectionString; exports.color = _chunkXOQHZABKcjs.color; exports.columnSchemaComponent = _chunkXOQHZABKcjs.columnSchemaComponent; exports.combineMigrations = _chunkXOQHZABKcjs.combineMigrations; exports.composeJSONReplacers = _chunkXOQHZABKcjs.composeJSONReplacers; exports.composeJSONRevivers = _chunkXOQHZABKcjs.composeJSONRevivers; exports.count = _chunkXOQHZABKcjs.count; exports.createAlwaysNewConnectionPool = _chunkXOQHZABKcjs.createAlwaysNewConnectionPool; exports.createAmbientConnection = _chunkXOQHZABKcjs.createAmbientConnection; exports.createAmbientConnectionPool = _chunkXOQHZABKcjs.createAmbientConnectionPool; exports.createConnection = _chunkXOQHZABKcjs.createConnection; exports.createConnectionPool = _chunkXOQHZABKcjs.createConnectionPool; exports.createSingletonClientConnectionPool = _chunkXOQHZABKcjs.createSingletonClientConnectionPool; exports.createSingletonConnection = _chunkXOQHZABKcjs.createSingletonConnection; exports.createSingletonConnectionPool = _chunkXOQHZABKcjs.createSingletonConnectionPool; exports.createTransientConnection = _chunkXOQHZABKcjs.createTransientConnection; exports.databaseSchemaComponent = _chunkXOQHZABKcjs.databaseSchemaComponent; exports.databaseSchemaSchemaComponent = _chunkXOQHZABKcjs.databaseSchemaSchemaComponent; exports.defaultDatabaseLockOptions = _chunkXOQHZABKcjs.defaultDatabaseLockOptions; exports.defaultProcessorsRegistry = _chunkXOQHZABKcjs.defaultProcessorsRegistry; exports.describeSQL = _chunkXOQHZABKcjs.describeSQL; exports.dumbo = dumbo; exports.dumboDatabaseDriverRegistry = _chunkXOQHZABKcjs.dumboDatabaseDriverRegistry; exports.dumboDatabaseMetadataRegistry = _chunkXOQHZABKcjs.dumboDatabaseMetadataRegistry; exports.dumboSchema = _chunkXOQHZABKcjs.dumboSchema; exports.executeInAmbientConnection = _chunkXOQHZABKcjs.executeInAmbientConnection; exports.executeInNewConnection = _chunkXOQHZABKcjs.executeInNewConnection; exports.executeInNewDbClient = _chunkXOQHZABKcjs.executeInNewDbClient; exports.executeInTransaction = _chunkXOQHZABKcjs.executeInTransaction; exports.exists = _chunkXOQHZABKcjs.exists; exports.filterSchemaComponentsOfType = _chunkXOQHZABKcjs.filterSchemaComponentsOfType; exports.findSchemaComponentsOfType = _chunkXOQHZABKcjs.findSchemaComponentsOfType; exports.first = _chunkXOQHZABKcjs.first; exports.firstOrNull = _chunkXOQHZABKcjs.firstOrNull; exports.formatSQL = _chunkXOQHZABKcjs.formatSQL; exports.fromDatabaseDriverType = _chunkXOQHZABKcjs.fromDatabaseDriverType; exports.getDatabaseDriverName = _chunkXOQHZABKcjs.getDatabaseDriverName; exports.getDatabaseMetadata = _chunkXOQHZABKcjs.getDatabaseMetadata; exports.getDatabaseType = _chunkXOQHZABKcjs.getDatabaseType; exports.getDefaultDatabase = _chunkXOQHZABKcjs.getDefaultDatabase; exports.getDefaultDatabaseAsync = _chunkXOQHZABKcjs.getDefaultDatabaseAsync; exports.getDefaultMigratorOptionsFromRegistry = _chunkXOQHZABKcjs.getDefaultMigratorOptionsFromRegistry; exports.getFormatter = _chunkXOQHZABKcjs.getFormatter; exports.indexSchemaComponent = _chunkXOQHZABKcjs.indexSchemaComponent; exports.isSQL = _chunkXOQHZABKcjs.isSQL; exports.isSchemaComponentOfType = _chunkXOQHZABKcjs.isSchemaComponentOfType; exports.isTokenizedSQL = _chunkXOQHZABKcjs.isTokenizedSQL; exports.jsonSerializer = _chunkXOQHZABKcjs.jsonSerializer; exports.mapANSISQLParamPlaceholder = _chunkXOQHZABKcjs.mapANSISQLParamPlaceholder; exports.mapColumnToBigint = _chunkXOQHZABKcjs.mapColumnToBigint; exports.mapColumnToDate = _chunkXOQHZABKcjs.mapColumnToDate; exports.mapColumnToJSON = _chunkXOQHZABKcjs.mapColumnToJSON; exports.mapDefaultSQLColumnProcessors = _chunkXOQHZABKcjs.mapDefaultSQLColumnProcessors; exports.mapRows = _chunkXOQHZABKcjs.mapRows; exports.mapSQLIdentifier = _chunkXOQHZABKcjs.mapSQLIdentifier; exports.mapSQLParamValue = _chunkXOQHZABKcjs.mapSQLParamValue; exports.mapSQLQueryResult = _chunkXOQHZABKcjs.mapSQLQueryResult; exports.mapSchemaComponentsOfType = _chunkXOQHZABKcjs.mapSchemaComponentsOfType; exports.mapToCamelCase = _chunkXOQHZABKcjs.mapToCamelCase; exports.migrationTableSchemaComponent = _chunkXOQHZABKcjs.migrationTableSchemaComponent; exports.parseConnectionString = parseConnectionString; exports.prettyJson = _chunkXOQHZABKcjs.prettyJson; exports.registerDefaultMigratorOptions = _chunkXOQHZABKcjs.registerDefaultMigratorOptions; exports.registerFormatter = _chunkXOQHZABKcjs.registerFormatter; exports.relationship = _chunkXOQHZABKcjs.relationship; exports.resolveDatabaseMetadata = _chunkXOQHZABKcjs.resolveDatabaseMetadata; exports.runSQLMigrations = _chunkXOQHZABKcjs.runSQLMigrations; exports.schemaComponent = _chunkXOQHZABKcjs.schemaComponent; exports.schemaComponentURN = _chunkXOQHZABKcjs.schemaComponentURN; exports.single = _chunkXOQHZABKcjs.single; exports.singleOrNull = _chunkXOQHZABKcjs.singleOrNull; exports.sqlExecutor = _chunkXOQHZABKcjs.sqlExecutor; exports.sqlExecutorInAmbientConnection = _chunkXOQHZABKcjs.sqlExecutorInAmbientConnection; exports.sqlExecutorInNewConnection = _chunkXOQHZABKcjs.sqlExecutorInNewConnection; exports.sqlMigration = _chunkXOQHZABKcjs.sqlMigration; exports.tableSchemaComponent = _chunkXOQHZABKcjs.tableSchemaComponent; exports.toCamelCase = _chunkXOQHZABKcjs.toCamelCase; exports.toDatabaseDriverType = _chunkXOQHZABKcjs.toDatabaseDriverType; exports.tracer = _chunkXOQHZABKcjs.tracer; exports.transactionFactoryWithAmbientConnection = _chunkXOQHZABKcjs.transactionFactoryWithAmbientConnection; exports.transactionFactoryWithDbClient = _chunkXOQHZABKcjs.transactionFactoryWithDbClient; exports.transactionFactoryWithNewConnection = _chunkXOQHZABKcjs.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, 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, v as IndexURN, Q as QueryResultRow, w as QueryResult, x as SchemaComponent, y as SQLMigration, M as MigratorOptions, z as DatabaseDriverType, B as Dumbo, E as AnyTypeValidationError, F as TypeValidationSuccess, G as AnyDumboDatabaseDriver, H as ExtractDumboDatabaseDriverOptions, k as JSONSerializationOptions, K as ExtractDumboTypeFromDriver, f as DumboConnectionOptions } from './connectionString-oeg1LD5V.cjs';
|
|
2
|
+
export { e0 as ANSISQLIdentifierQuote, d$ as ANSISQLParamPlaceholder, b4 as AcquireDatabaseLockMode, b5 as AcquireDatabaseLockOptions, aD as AdminShutdownError, bx as AllColumnReferences, bz as AllColumnReferencesInSchema, bw as AllColumnTypes, by as AllColumnTypesInSchema, a3 as AmbientConnectionPoolOptions, bc as AnyColumnSchemaComponent, dE as AnyColumnTypeToken, A as AnyConnection, bi as AnyDatabaseSchemaComponent, bn as AnyDatabaseSchemaSchemaComponent, ad as AnyDatabaseTransaction, bQ as AnyRelationshipDefinition, dr as AnySQLProcessor, cQ as AnySchemaComponent, cR as AnySchemaComponentOfType, bM as AnyTableRelationshipDefinition, bN as AnyTableRelationshipDefinitionWithColumns, cr as AnyTableSchemaComponent, dQ as AutoIncrementSQLColumnToken, aV as BatchCommandNoChangesError, aU as BatchSQLCommandOptions, dI as BigIntegerToken, dG as BigSerialToken, aJ as CheckViolationError, c3 as CollectReferencesErrors, c7 as CollectRelationshipErrors, bC as ColumnName, bF as ColumnPath, bH as ColumnPathToReference, bG as ColumnReference, bW as ColumnReferenceError, bT as ColumnReferenceExistanceError, bU as ColumnReferenceTypeMismatchError, bb as ColumnSchemaComponent, bd as ColumnSchemaComponentOptions, dD as ColumnTypeToken, ba as ColumnURNType, av as ConcurrencyError, C as Connection, ax as ConnectionError, P as ConnectionFactory, O as ConnectionOptions, i as ConnectionPool, a2 as ConnectionPoolFactory, a9 as CreateAlwaysNewConnectionPoolOptions, X as CreateAmbientConnectionOptions, V as CreateConnectionOptions, ab as CreateConnectionPoolOptions, Z as CreateSingletonConnectionOptions, $ as CreateTransientConnectionOptions, aL as DataError, cB as DatabaseCapabilities, e5 as DatabaseConnectionString, al as DatabaseDriverName, an as DatabaseDriverTypeParts, b8 as DatabaseLock, b3 as DatabaseLockOptions, e as DatabaseMetadata, bh as DatabaseSchemaComponent, bm as DatabaseSchemaSchemaComponent, bl as DatabaseSchemaTables, bk as DatabaseSchemaURNType, bg as DatabaseSchemas, c5 as DatabaseSchemasWithSingle, h as DatabaseTransaction, g as DatabaseTransactionOptions, ak as DatabaseType, bf as DatabaseURNType, l as DbSQLExecutor, aW as DbSQLExecutorOptions, az as DeadlockError, e3 as DefaultMapSQLParamValueOptions, D as DefaultSQLColumnToken, c as DumboDatabaseDriver, at as DumboDatabaseDriverRegistry, cC as DumboDatabaseMetadataRegistry, m as DumboError, cU as DumboSchemaComponentType, aK as ExclusionViolationError, cP as ExtractAdditionalData, bu as ExtractColumnNames, bv as ExtractColumnTypeName, dT as ExtractSQLTokenType, bs as ExtractSchemaNames, bt as ExtractTableNames, aH as ForeignKeyViolationError, dg as FormatContext, ck as FormatDatabaseValidationErrors, ch as FormatRelationshipBlock, dh as FormatSQLOptions, cj as FormatSchemaLevel, cg as FormatSingleError, ci as FormatTableLevel, cl as FormatValidationErrors, cf as IndentErrors, bq as IndexSchemaComponent, bp as IndexURNType, cu as InferColumnType, cA as InferDatabaseSchemas, N as InferDbClientFromConnection, am as InferDriverDatabaseType, L as InferDriverTypeFromConnection, cz as InferSchemaTables, cx as InferTableRow, cq as InferTableSchemaComponentColumns, cp as InferTableSchemaComponentTypes, I as InferTransactionFromConnection, j as InferTransactionOptionsFromConnection, U as InitTransaction, aB as InsufficientResourcesError, dH as IntegerToken, aF as IntegrityConstraintViolationError, aM as InvalidOperationError, dJ as JSONBToken, d5 as JSONCodec, db as JSONCodecOptions, dc as JSONDeserializeOptions, d6 as JSONReplacer, d7 as JSONReplacers, d8 as JSONReviver, df as JSONReviverContext, d9 as JSONRevivers, dd as JSONSerializeOptions, J as JSONSerializer, de as JSONSerializerOptions, dy as JSONValueType, dz as JSONValueTypeName, dA as JavaScriptValueType, dB as JavaScriptValueTypeName, dC as JavaScriptValueTypeToNameMap, ce as Join, aA as LockNotAvailableError, bJ as LookupColumnType, cJ as MIGRATIONS_LOCK_ID, dZ as MapSQLParamValue, d_ as MapSQLParamValueOptions, d0 as MigrationRecord, c_ as MigrationStyle, b9 as NoDatabaseLock, bV as NoError, bB as NormalizeColumnPath, bA as NormalizeReference, aI as NotNullViolationError, dN as NotNullableSQLColumnTokenProps, dO as NullableSQLColumnTokenProps, dn as ParametrizedSQL, dp as ParametrizedSQLBuilder, bI as ParseReferencePath, aE as QueryCanceledError, dw as RawSQL, bR as RelationshipColumnsMismatchError, bL as RelationshipDefinition, bS as RelationshipReferencesLengthMismatchError, bK as RelationshipType, bX as RelationshipValidationError, b6 as ReleaseDatabaseLockOptions, cM as RunSQLMigrationsResult, dv as SQL, dV as SQLArrayMode, dP as SQLColumnToken, S as SQLColumnTypeTokens, dR as SQLColumnTypeTokensFactory, aT as SQLCommandOptions, dW as SQLDefaultTokens, dX as SQLDefaultTokensTypes, aX as SQLExecutor, d as SQLFormatter, di as SQLFormatterOptions, dU as SQLPlain, b as SQLProcessorContext, ds as SQLProcessorOptions, dt as SQLProcessorsReadonlyRegistry, du as SQLProcessorsRegistry, aS as SQLQueryOptions, aR as SQLQueryResultColumnMapping, dS as SQLToken, dY as SQLValueMapper, bE as SchemaColumnName, cS as SchemaComponentOptions, cT as SchemaComponentType, c4 as SchemaTablesWithSingle, dF as SerialToken, d2 as SerializationCodec, ay as SerializationError, d1 as Serializer, a7 as SingletonClientConnectionPoolOptions, a5 as SingletonConnectionPoolOptions, aC as SystemError, bD as TableColumnName, cw as TableColumnNames, cv as TableColumnType, cn as TableColumns, bO as TableRelationships, cy as TableRowType, co as TableSchemaComponent, cm as TableURNType, dK as TimestampToken, dL as TimestamptzToken, af as TransactionResult, aw as TransientDatabaseError, aG as UniqueConstraintError, b_ as ValidateColumnReference, b$ as ValidateColumnTypeMatch, c0 as ValidateColumnsMatch, cb as ValidateDatabaseSchema, cc as ValidateDatabaseSchemas, cd as ValidateDatabaseSchemasWithMessages, c1 as ValidateReference, c2 as ValidateReferences, c6 as ValidateRelationship, bZ as ValidateRelationshipColumns, bY as ValidateRelationshipLength, ca as ValidateSchemaTables, c9 as ValidateTable, c8 as ValidateTableRelationships, dM as VarcharToken, R as WithConnectionFactory, W as WithConnectionOptions, ae as WithDatabaseTransactionFactory, aY as WithSQLExecutor, ct as Writable, as as canHandleDriverWithConnectionString, be as columnSchemaComponent, cO as combineMigrations, d3 as composeJSONReplacers, d4 as composeJSONRevivers, aa as createAlwaysNewConnectionPool, Y as createAmbientConnection, a4 as createAmbientConnectionPool, a1 as createConnection, ac as createConnectionPool, a8 as createSingletonClientConnectionPool, _ as createSingletonConnection, a6 as createSingletonConnectionPool, a0 as createTransientConnection, bj as databaseSchemaComponent, bo as databaseSchemaSchemaComponent, b7 as defaultDatabaseLockOptions, dq as defaultProcessorsRegistry, dm as describeSQL, au as dumboDatabaseDriverRegistry, cD as dumboDatabaseMetadataRegistry, cI as dumboSchema, b2 as executeInAmbientConnection, b1 as executeInNewConnection, b0 as executeInNewDbClient, ag as executeInTransaction, cX as filterSchemaComponentsOfType, cZ as findSchemaComponentsOfType, dl as formatSQL, ap as fromDatabaseDriverType, aq as getDatabaseDriverName, cE as getDatabaseMetadata, ar as getDatabaseType, cG as getDefaultDatabase, cH as getDefaultDatabaseAsync, cL as getDefaultMigratorOptionsFromRegistry, dk as getFormatter, br as indexSchemaComponent, dx as isSQL, cW as isSchemaComponentOfType, da as jsonSerializer, e1 as mapANSISQLParamPlaceholder, aO as mapColumnToBigint, aP as mapColumnToDate, aN as mapColumnToJSON, e2 as mapSQLIdentifier, e4 as mapSQLParamValue, aQ as mapSQLQueryResult, cY as mapSchemaComponentsOfType, e6 as parseConnectionString, cK as registerDefaultMigratorOptions, dj as registerFormatter, bP as relationship, cF as resolveDatabaseMetadata, cN as runSQLMigrations, cV as schemaComponent, aZ as sqlExecutor, a$ as sqlExecutorInAmbientConnection, a_ as sqlExecutorInNewConnection, c$ as sqlMigration, cs as tableSchemaComponent, ao as toDatabaseDriverType, aj as transactionFactoryWithAmbientConnection, ah as transactionFactoryWithDbClient, ai as transactionFactoryWithNewConnection } from './connectionString-oeg1LD5V.cjs';
|
|
3
|
+
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-Difrrk4c.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, v as IndexURN, Q as QueryResultRow, w as QueryResult, x as SchemaComponent, y as SQLMigration, M as MigratorOptions, z as DatabaseDriverType, B as Dumbo, E as AnyTypeValidationError, F as TypeValidationSuccess, G as AnyDumboDatabaseDriver, H as ExtractDumboDatabaseDriverOptions, k as JSONSerializationOptions, K as ExtractDumboTypeFromDriver, f as DumboConnectionOptions } from './connectionString-oeg1LD5V.js';
|
|
2
|
+
export { e0 as ANSISQLIdentifierQuote, d$ as ANSISQLParamPlaceholder, b4 as AcquireDatabaseLockMode, b5 as AcquireDatabaseLockOptions, aD as AdminShutdownError, bx as AllColumnReferences, bz as AllColumnReferencesInSchema, bw as AllColumnTypes, by as AllColumnTypesInSchema, a3 as AmbientConnectionPoolOptions, bc as AnyColumnSchemaComponent, dE as AnyColumnTypeToken, A as AnyConnection, bi as AnyDatabaseSchemaComponent, bn as AnyDatabaseSchemaSchemaComponent, ad as AnyDatabaseTransaction, bQ as AnyRelationshipDefinition, dr as AnySQLProcessor, cQ as AnySchemaComponent, cR as AnySchemaComponentOfType, bM as AnyTableRelationshipDefinition, bN as AnyTableRelationshipDefinitionWithColumns, cr as AnyTableSchemaComponent, dQ as AutoIncrementSQLColumnToken, aV as BatchCommandNoChangesError, aU as BatchSQLCommandOptions, dI as BigIntegerToken, dG as BigSerialToken, aJ as CheckViolationError, c3 as CollectReferencesErrors, c7 as CollectRelationshipErrors, bC as ColumnName, bF as ColumnPath, bH as ColumnPathToReference, bG as ColumnReference, bW as ColumnReferenceError, bT as ColumnReferenceExistanceError, bU as ColumnReferenceTypeMismatchError, bb as ColumnSchemaComponent, bd as ColumnSchemaComponentOptions, dD as ColumnTypeToken, ba as ColumnURNType, av as ConcurrencyError, C as Connection, ax as ConnectionError, P as ConnectionFactory, O as ConnectionOptions, i as ConnectionPool, a2 as ConnectionPoolFactory, a9 as CreateAlwaysNewConnectionPoolOptions, X as CreateAmbientConnectionOptions, V as CreateConnectionOptions, ab as CreateConnectionPoolOptions, Z as CreateSingletonConnectionOptions, $ as CreateTransientConnectionOptions, aL as DataError, cB as DatabaseCapabilities, e5 as DatabaseConnectionString, al as DatabaseDriverName, an as DatabaseDriverTypeParts, b8 as DatabaseLock, b3 as DatabaseLockOptions, e as DatabaseMetadata, bh as DatabaseSchemaComponent, bm as DatabaseSchemaSchemaComponent, bl as DatabaseSchemaTables, bk as DatabaseSchemaURNType, bg as DatabaseSchemas, c5 as DatabaseSchemasWithSingle, h as DatabaseTransaction, g as DatabaseTransactionOptions, ak as DatabaseType, bf as DatabaseURNType, l as DbSQLExecutor, aW as DbSQLExecutorOptions, az as DeadlockError, e3 as DefaultMapSQLParamValueOptions, D as DefaultSQLColumnToken, c as DumboDatabaseDriver, at as DumboDatabaseDriverRegistry, cC as DumboDatabaseMetadataRegistry, m as DumboError, cU as DumboSchemaComponentType, aK as ExclusionViolationError, cP as ExtractAdditionalData, bu as ExtractColumnNames, bv as ExtractColumnTypeName, dT as ExtractSQLTokenType, bs as ExtractSchemaNames, bt as ExtractTableNames, aH as ForeignKeyViolationError, dg as FormatContext, ck as FormatDatabaseValidationErrors, ch as FormatRelationshipBlock, dh as FormatSQLOptions, cj as FormatSchemaLevel, cg as FormatSingleError, ci as FormatTableLevel, cl as FormatValidationErrors, cf as IndentErrors, bq as IndexSchemaComponent, bp as IndexURNType, cu as InferColumnType, cA as InferDatabaseSchemas, N as InferDbClientFromConnection, am as InferDriverDatabaseType, L as InferDriverTypeFromConnection, cz as InferSchemaTables, cx as InferTableRow, cq as InferTableSchemaComponentColumns, cp as InferTableSchemaComponentTypes, I as InferTransactionFromConnection, j as InferTransactionOptionsFromConnection, U as InitTransaction, aB as InsufficientResourcesError, dH as IntegerToken, aF as IntegrityConstraintViolationError, aM as InvalidOperationError, dJ as JSONBToken, d5 as JSONCodec, db as JSONCodecOptions, dc as JSONDeserializeOptions, d6 as JSONReplacer, d7 as JSONReplacers, d8 as JSONReviver, df as JSONReviverContext, d9 as JSONRevivers, dd as JSONSerializeOptions, J as JSONSerializer, de as JSONSerializerOptions, dy as JSONValueType, dz as JSONValueTypeName, dA as JavaScriptValueType, dB as JavaScriptValueTypeName, dC as JavaScriptValueTypeToNameMap, ce as Join, aA as LockNotAvailableError, bJ as LookupColumnType, cJ as MIGRATIONS_LOCK_ID, dZ as MapSQLParamValue, d_ as MapSQLParamValueOptions, d0 as MigrationRecord, c_ as MigrationStyle, b9 as NoDatabaseLock, bV as NoError, bB as NormalizeColumnPath, bA as NormalizeReference, aI as NotNullViolationError, dN as NotNullableSQLColumnTokenProps, dO as NullableSQLColumnTokenProps, dn as ParametrizedSQL, dp as ParametrizedSQLBuilder, bI as ParseReferencePath, aE as QueryCanceledError, dw as RawSQL, bR as RelationshipColumnsMismatchError, bL as RelationshipDefinition, bS as RelationshipReferencesLengthMismatchError, bK as RelationshipType, bX as RelationshipValidationError, b6 as ReleaseDatabaseLockOptions, cM as RunSQLMigrationsResult, dv as SQL, dV as SQLArrayMode, dP as SQLColumnToken, S as SQLColumnTypeTokens, dR as SQLColumnTypeTokensFactory, aT as SQLCommandOptions, dW as SQLDefaultTokens, dX as SQLDefaultTokensTypes, aX as SQLExecutor, d as SQLFormatter, di as SQLFormatterOptions, dU as SQLPlain, b as SQLProcessorContext, ds as SQLProcessorOptions, dt as SQLProcessorsReadonlyRegistry, du as SQLProcessorsRegistry, aS as SQLQueryOptions, aR as SQLQueryResultColumnMapping, dS as SQLToken, dY as SQLValueMapper, bE as SchemaColumnName, cS as SchemaComponentOptions, cT as SchemaComponentType, c4 as SchemaTablesWithSingle, dF as SerialToken, d2 as SerializationCodec, ay as SerializationError, d1 as Serializer, a7 as SingletonClientConnectionPoolOptions, a5 as SingletonConnectionPoolOptions, aC as SystemError, bD as TableColumnName, cw as TableColumnNames, cv as TableColumnType, cn as TableColumns, bO as TableRelationships, cy as TableRowType, co as TableSchemaComponent, cm as TableURNType, dK as TimestampToken, dL as TimestamptzToken, af as TransactionResult, aw as TransientDatabaseError, aG as UniqueConstraintError, b_ as ValidateColumnReference, b$ as ValidateColumnTypeMatch, c0 as ValidateColumnsMatch, cb as ValidateDatabaseSchema, cc as ValidateDatabaseSchemas, cd as ValidateDatabaseSchemasWithMessages, c1 as ValidateReference, c2 as ValidateReferences, c6 as ValidateRelationship, bZ as ValidateRelationshipColumns, bY as ValidateRelationshipLength, ca as ValidateSchemaTables, c9 as ValidateTable, c8 as ValidateTableRelationships, dM as VarcharToken, R as WithConnectionFactory, W as WithConnectionOptions, ae as WithDatabaseTransactionFactory, aY as WithSQLExecutor, ct as Writable, as as canHandleDriverWithConnectionString, be as columnSchemaComponent, cO as combineMigrations, d3 as composeJSONReplacers, d4 as composeJSONRevivers, aa as createAlwaysNewConnectionPool, Y as createAmbientConnection, a4 as createAmbientConnectionPool, a1 as createConnection, ac as createConnectionPool, a8 as createSingletonClientConnectionPool, _ as createSingletonConnection, a6 as createSingletonConnectionPool, a0 as createTransientConnection, bj as databaseSchemaComponent, bo as databaseSchemaSchemaComponent, b7 as defaultDatabaseLockOptions, dq as defaultProcessorsRegistry, dm as describeSQL, au as dumboDatabaseDriverRegistry, cD as dumboDatabaseMetadataRegistry, cI as dumboSchema, b2 as executeInAmbientConnection, b1 as executeInNewConnection, b0 as executeInNewDbClient, ag as executeInTransaction, cX as filterSchemaComponentsOfType, cZ as findSchemaComponentsOfType, dl as formatSQL, ap as fromDatabaseDriverType, aq as getDatabaseDriverName, cE as getDatabaseMetadata, ar as getDatabaseType, cG as getDefaultDatabase, cH as getDefaultDatabaseAsync, cL as getDefaultMigratorOptionsFromRegistry, dk as getFormatter, br as indexSchemaComponent, dx as isSQL, cW as isSchemaComponentOfType, da as jsonSerializer, e1 as mapANSISQLParamPlaceholder, aO as mapColumnToBigint, aP as mapColumnToDate, aN as mapColumnToJSON, e2 as mapSQLIdentifier, e4 as mapSQLParamValue, aQ as mapSQLQueryResult, cY as mapSchemaComponentsOfType, e6 as parseConnectionString, cK as registerDefaultMigratorOptions, dj as registerFormatter, bP as relationship, cF as resolveDatabaseMetadata, cN as runSQLMigrations, cV as schemaComponent, aZ as sqlExecutor, a$ as sqlExecutorInAmbientConnection, a_ as sqlExecutorInNewConnection, c$ as sqlMigration, cs as tableSchemaComponent, ao as toDatabaseDriverType, aj as transactionFactoryWithAmbientConnection, ah as transactionFactoryWithDbClient, ai as transactionFactoryWithNewConnection } from './connectionString-oeg1LD5V.js';
|
|
3
|
+
export { D as DefaultSQLColumnProcessors, m as mapDefaultSQLColumnProcessors } from './columnProcessors-C7fRa54L.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 };
|