kern-db 0.5.0 → 0.6.0
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.
|
@@ -1310,6 +1310,9 @@ var OpenTestTransactions = class {
|
|
|
1310
1310
|
if (current) throw new Error("Cannot run a callback in an open test transaction inside a transaction");
|
|
1311
1311
|
return this.#storage.run(level, callback);
|
|
1312
1312
|
},
|
|
1313
|
+
get isOpen() {
|
|
1314
|
+
return level.state === "open";
|
|
1315
|
+
},
|
|
1313
1316
|
close,
|
|
1314
1317
|
[Symbol.asyncDispose]: close
|
|
1315
1318
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as defineType, s as isType } from "./bytea-DNZ_ftio.mjs";
|
|
2
2
|
import { C as isDriver, S as createStatement, _ as sql, h as param, i as ResultDecodeError, m as identifier, r as NotFoundError } from "./query-FKBN7BMY.mjs";
|
|
3
3
|
import { a as toDriverError, n as QueryError, t as ConnectionError } from "./driver-error-D8D4UQ4F.mjs";
|
|
4
|
-
import { a as TransactionConnectionError, i as isQueryError, o as isOutcomeUnknown, r as isDatabase, t as createDatabase } from "./database-
|
|
4
|
+
import { a as TransactionConnectionError, i as isQueryError, o as isOutcomeUnknown, r as isDatabase, t as createDatabase } from "./database-DITSIc_K.mjs";
|
|
5
5
|
export { ConnectionError, NotFoundError, QueryError, ResultDecodeError, TransactionConnectionError, createDatabase, createStatement, defineType, identifier, isDatabase, isDriver, isOutcomeUnknown, isQueryError, isType, param, sql, toDriverError };
|
package/dist/testing.d.mts
CHANGED
|
@@ -22,6 +22,8 @@ interface OpenedTestTransaction extends AsyncDisposable {
|
|
|
22
22
|
* It rejects without calling `callback` once the test transaction is closed, and inside a transaction.
|
|
23
23
|
*/
|
|
24
24
|
run<T>(callback: () => Promise<T>): Promise<T>;
|
|
25
|
+
/** Whether the test transaction runs callbacks: it is `false` from the start of its closing, such as when a later test transaction in its fixture rolls it back. */
|
|
26
|
+
readonly isOpen: boolean;
|
|
25
27
|
/** Rolls back the test transaction; the later queries of its callbacks fail, and closing it again returns the same closing. */
|
|
26
28
|
close(): Promise<void>;
|
|
27
29
|
}
|
package/dist/testing.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { r as boolean, t as bytea } from "./bytea-DNZ_ftio.mjs";
|
|
|
2
2
|
import { S as createStatement, _ as sql, h as param, m as identifier } from "./query-FKBN7BMY.mjs";
|
|
3
3
|
import { n as QueryError, t as ConnectionError } from "./driver-error-D8D4UQ4F.mjs";
|
|
4
4
|
import { t as array } from "./array-BLt8ZNR5.mjs";
|
|
5
|
-
import { a as TransactionConnectionError, n as getCoordinator, s as pause, t as createDatabase } from "./database-
|
|
5
|
+
import { a as TransactionConnectionError, n as getCoordinator, s as pause, t as createDatabase } from "./database-DITSIc_K.mjs";
|
|
6
6
|
import { _ as interval, a as bigint, b as timestamptz, c as numeric, f as inet, g as date, h as enumOf, m as jsonb, n as char, o as doublePrecision, r as text, s as integer, t as uuid, v as time, y as timestamp } from "./types-Dl2oicjV.mjs";
|
|
7
7
|
import assert from "node:assert/strict";
|
|
8
8
|
// src/test-helpers.ts
|