@event-driven-io/pongo 0.17.0-beta.46 → 0.17.0-beta.47
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/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/{cloudflare-CzlFuMmZ.js → cloudflare-CezpKXKo.js} +8 -6
- package/dist/cloudflare-CezpKXKo.js.map +1 -0
- package/dist/{cloudflare-WGIFZXop.cjs → cloudflare-DUy3zRvu.cjs} +7 -5
- package/dist/cloudflare-DUy3zRvu.cjs.map +1 -0
- package/dist/cloudflare.cjs +34 -7
- package/dist/cloudflare.cjs.map +1 -1
- package/dist/cloudflare.d.cts +2 -2
- package/dist/cloudflare.d.ts +2 -2
- package/dist/cloudflare.js +34 -7
- package/dist/cloudflare.js.map +1 -1
- package/dist/{index-C3pnS1S_.d.cts → index-C9F1GCEP.d.cts} +15 -4
- package/dist/{index-FXnldVnn.d.cts → index-DIpG_9J5.d.cts} +1 -1
- package/dist/{index-DiVn94pz.d.ts → index-DOaV2Shx.d.ts} +1 -1
- package/dist/{index-CavsdtMX.d.ts → index-RF6HXlp-.d.ts} +15 -4
- package/dist/index.cjs +29 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/dist/{pg-BtUtOO8Y.js → pg-BGaB6E3Q.js} +5 -3
- package/dist/{pg-BtUtOO8Y.js.map → pg-BGaB6E3Q.js.map} +1 -1
- package/dist/{pg-BdtFllz7.cjs → pg-BX92reql.cjs} +4 -2
- package/dist/pg-BX92reql.cjs.map +1 -0
- package/dist/pg.cjs +31 -4
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +1 -1
- package/dist/pg.d.ts +1 -1
- package/dist/pg.js +31 -4
- package/dist/pg.js.map +1 -1
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +1 -1
- package/dist/shim.d.ts +1 -1
- package/dist/shim.js.map +1 -1
- package/dist/{sqlite3-CFwH2ot3.cjs → sqlite3-CmPeKFzE.cjs} +4 -2
- package/dist/sqlite3-CmPeKFzE.cjs.map +1 -0
- package/dist/{sqlite3-Dv0y-lg6.js → sqlite3-DNNckTE5.js} +5 -3
- package/dist/sqlite3-DNNckTE5.js.map +1 -0
- package/dist/sqlite3.cjs +31 -4
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +2 -2
- package/dist/sqlite3.d.ts +2 -2
- package/dist/sqlite3.js +31 -4
- package/dist/sqlite3.js.map +1 -1
- package/package.json +2 -2
- package/dist/cloudflare-CzlFuMmZ.js.map +0 -1
- package/dist/cloudflare-WGIFZXop.cjs.map +0 -1
- package/dist/pg-BdtFllz7.cjs.map +0 -1
- package/dist/sqlite3-CFwH2ot3.cjs.map +0 -1
- package/dist/sqlite3-Dv0y-lg6.js.map +0 -1
package/dist/pg.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bt as PongoDb, on as PongoDriver, sn as PongoDriverOptions, zn as PongoCollectionSQLBuilder } from "./index-C9F1GCEP.cjs";
|
|
2
2
|
import * as _$_event_driven_io_dumbo0 from "@event-driven-io/dumbo";
|
|
3
3
|
import { JSONSerializer } from "@event-driven-io/dumbo";
|
|
4
4
|
import { PgConnection, PgDriverType } from "@event-driven-io/dumbo/pg";
|
package/dist/pg.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bt as PongoDb, on as PongoDriver, sn as PongoDriverOptions, zn as PongoCollectionSQLBuilder } from "./index-RF6HXlp-.js";
|
|
2
2
|
import * as _$_event_driven_io_dumbo0 from "@event-driven-io/dumbo";
|
|
3
3
|
import { JSONSerializer } from "@event-driven-io/dumbo";
|
|
4
4
|
import { PgConnection, PgDriverType } from "@event-driven-io/dumbo/pg";
|
package/dist/pg.js
CHANGED
|
@@ -1000,8 +1000,20 @@ const PongoDatabase = (options) => {
|
|
|
1000
1000
|
const collections = /* @__PURE__ */ new Map();
|
|
1001
1001
|
const command = async (sql, options) => (await transactionExecutorOrDefault(db, options, pool.execute)).command(sql, options);
|
|
1002
1002
|
const query = async (sql, options) => (await transactionExecutorOrDefault(db, options, pool.execute)).query(sql, options);
|
|
1003
|
+
const driverType = pool.driverType;
|
|
1004
|
+
const defaultTransactionOptions = options.transactionOptions;
|
|
1005
|
+
const pongoTransactionOptions = (transactionOptions) => {
|
|
1006
|
+
const nestedTransactionOptions = transactionOptions;
|
|
1007
|
+
const nestedDefaultTransactionOptions = defaultTransactionOptions;
|
|
1008
|
+
const allowNestedTransactions = nestedTransactionOptions?.allowNestedTransactions ?? nestedDefaultTransactionOptions?.allowNestedTransactions ?? true;
|
|
1009
|
+
return {
|
|
1010
|
+
...defaultTransactionOptions ?? {},
|
|
1011
|
+
allowNestedTransactions,
|
|
1012
|
+
...transactionOptions ?? {}
|
|
1013
|
+
};
|
|
1014
|
+
};
|
|
1003
1015
|
const db = {
|
|
1004
|
-
driverType
|
|
1016
|
+
driverType,
|
|
1005
1017
|
databaseName,
|
|
1006
1018
|
connect: () => Promise.resolve(),
|
|
1007
1019
|
close: async () => {
|
|
@@ -1028,8 +1040,8 @@ const PongoDatabase = (options) => {
|
|
|
1028
1040
|
},
|
|
1029
1041
|
cache: collectionOptions?.cache !== void 0 ? collectionOptions.cache : cache
|
|
1030
1042
|
}),
|
|
1031
|
-
transaction: () => pool.transaction(),
|
|
1032
|
-
withTransaction: (handle) => pool.withTransaction(handle),
|
|
1043
|
+
transaction: (transactionOptions) => pool.transaction(pongoTransactionOptions(transactionOptions)),
|
|
1044
|
+
withTransaction: (handle, transactionOptions) => pool.withTransaction(handle, pongoTransactionOptions(transactionOptions)),
|
|
1033
1045
|
schema: {
|
|
1034
1046
|
component: schemaComponent,
|
|
1035
1047
|
migrate: (options) => runSQLMigrations(pool, schemaComponent.migrations, options)
|
|
@@ -1082,6 +1094,19 @@ const PongoDriverRegistry = () => {
|
|
|
1082
1094
|
};
|
|
1083
1095
|
const pongoDriverRegistry = globalThis.pongoDriverRegistry = globalThis.pongoDriverRegistry ?? PongoDriverRegistry();
|
|
1084
1096
|
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/core/pongoTransaction.ts
|
|
1099
|
+
const withPongoTransactionOptions = (connectionOptions) => {
|
|
1100
|
+
const currentTransactionOptions = connectionOptions?.transactionOptions;
|
|
1101
|
+
return {
|
|
1102
|
+
...connectionOptions ?? {},
|
|
1103
|
+
transactionOptions: {
|
|
1104
|
+
...currentTransactionOptions ?? {},
|
|
1105
|
+
allowNestedTransactions: currentTransactionOptions?.allowNestedTransactions ?? true
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1085
1110
|
//#endregion
|
|
1086
1111
|
//#region src/core/utils/deepEquals.ts
|
|
1087
1112
|
const deepEquals = (left, right) => {
|
|
@@ -1473,12 +1498,14 @@ const pgPongoDriver = {
|
|
|
1473
1498
|
driverType: PgDriverType,
|
|
1474
1499
|
databaseFactory: (options) => {
|
|
1475
1500
|
const databaseName = options.databaseName ?? postgreSQLMetadata.parseDatabaseName(options.connectionString) ?? postgreSQLMetadata.defaultDatabaseName;
|
|
1501
|
+
const connectionOptions = withPongoTransactionOptions(options.connectionOptions);
|
|
1476
1502
|
return PongoDatabase({
|
|
1477
1503
|
...options,
|
|
1504
|
+
transactionOptions: connectionOptions.transactionOptions,
|
|
1478
1505
|
pool: dumbo({
|
|
1479
1506
|
connectionString: options.connectionString,
|
|
1480
1507
|
driver: pgDumboDriver,
|
|
1481
|
-
...
|
|
1508
|
+
...connectionOptions,
|
|
1482
1509
|
serialization: { serializer: options.serializer }
|
|
1483
1510
|
}),
|
|
1484
1511
|
schemaComponent: PongoDatabaseSchemaComponent({
|