orchid-orm 1.9.12 → 1.9.14
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/index.d.ts +97 -43
- package/dist/index.js +25 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { columnTypes, getColumnTypes, addQueryOn, VirtualColumn, pushQueryValue, isQueryReturnsAll, getQueryAs, toSqlCacheKey, NotFoundError, relationQueryKey, Adapter, Db, anyShape, getClonedQueryData, columnsShapeToCode, ColumnType, primaryKeyToCode, indexToCode, constraintToCode, columnIndexesToCode, columnForeignKeysToCode, columnCheckToCode, identityToCode } from 'pqb';
|
|
2
|
-
export { OrchidOrmError, OrchidOrmInternalError, columnTypes } from 'pqb';
|
|
2
|
+
export { OrchidOrmError, OrchidOrmInternalError, columnTypes, testTransaction } from 'pqb';
|
|
3
3
|
import { getCallerFilePath, snakeCaseKey, toSnakeCase, pathToLog, toCamelCase, toPascalCase, getImportPath, singleQuote, codeToString, quoteObjectKey, addCode, columnDefaultArgumentToCode, deepCompare } from 'orchid-core';
|
|
4
4
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
5
5
|
import * as path from 'path';
|
|
@@ -1338,24 +1338,33 @@ const orchidORM = (_a, tables) => {
|
|
|
1338
1338
|
"autoPreparedStatements",
|
|
1339
1339
|
"noPrimaryKey"
|
|
1340
1340
|
]);
|
|
1341
|
-
const adapter = "adapter" in options ? options.adapter : new Adapter(options);
|
|
1342
1341
|
const commonOptions = {
|
|
1343
1342
|
log,
|
|
1344
1343
|
logger,
|
|
1345
1344
|
autoPreparedStatements,
|
|
1346
1345
|
noPrimaryKey
|
|
1347
1346
|
};
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1347
|
+
let adapter;
|
|
1348
|
+
let transactionStorage;
|
|
1349
|
+
let qb;
|
|
1350
|
+
if ("db" in options) {
|
|
1351
|
+
adapter = options.db.query.adapter;
|
|
1352
|
+
transactionStorage = options.db.internal.transactionStorage;
|
|
1353
|
+
qb = options.db.queryBuilder;
|
|
1354
|
+
} else {
|
|
1355
|
+
adapter = "adapter" in options ? options.adapter : new Adapter(options);
|
|
1356
|
+
transactionStorage = new AsyncLocalStorage();
|
|
1357
|
+
qb = new Db(
|
|
1358
|
+
adapter,
|
|
1359
|
+
void 0,
|
|
1360
|
+
void 0,
|
|
1361
|
+
anyShape,
|
|
1362
|
+
columnTypes,
|
|
1363
|
+
transactionStorage,
|
|
1364
|
+
commonOptions
|
|
1365
|
+
);
|
|
1366
|
+
qb.queryBuilder = qb;
|
|
1367
|
+
}
|
|
1359
1368
|
const result = {
|
|
1360
1369
|
$transaction: transaction,
|
|
1361
1370
|
$adapter: adapter,
|