@prisma/client-engine-runtime 6.15.0-dev.1 → 6.15.0-dev.3
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.mts
CHANGED
|
@@ -471,12 +471,8 @@ export declare class TransactionManager {
|
|
|
471
471
|
startTransaction(options?: TransactionOptions): Promise<TransactionInfo>;
|
|
472
472
|
commitTransaction(transactionId: string): Promise<void>;
|
|
473
473
|
rollbackTransaction(transactionId: string): Promise<void>;
|
|
474
|
-
getTransaction(txInfo: TransactionInfo, operation: string): Transaction
|
|
475
|
-
private getActiveTransaction;
|
|
474
|
+
getTransaction(txInfo: TransactionInfo, operation: string): Promise<Transaction>;
|
|
476
475
|
cancelAllTransactions(): Promise<void>;
|
|
477
|
-
private startTransactionTimeout;
|
|
478
|
-
private closeTransaction;
|
|
479
|
-
private validateOptions;
|
|
480
476
|
}
|
|
481
477
|
|
|
482
478
|
export declare class TransactionManagerError extends UserFacingError {
|
package/dist/index.d.ts
CHANGED
|
@@ -471,12 +471,8 @@ export declare class TransactionManager {
|
|
|
471
471
|
startTransaction(options?: TransactionOptions): Promise<TransactionInfo>;
|
|
472
472
|
commitTransaction(transactionId: string): Promise<void>;
|
|
473
473
|
rollbackTransaction(transactionId: string): Promise<void>;
|
|
474
|
-
getTransaction(txInfo: TransactionInfo, operation: string): Transaction
|
|
475
|
-
private getActiveTransaction;
|
|
474
|
+
getTransaction(txInfo: TransactionInfo, operation: string): Promise<Transaction>;
|
|
476
475
|
cancelAllTransactions(): Promise<void>;
|
|
477
|
-
private startTransactionTimeout;
|
|
478
|
-
private closeTransaction;
|
|
479
|
-
private validateOptions;
|
|
480
476
|
}
|
|
481
477
|
|
|
482
478
|
export declare class TransactionManagerError extends UserFacingError {
|
package/dist/index.js
CHANGED
|
@@ -1618,7 +1618,7 @@ var QueryInterpreter = class _QueryInterpreter {
|
|
|
1618
1618
|
}
|
|
1619
1619
|
const transactionManager = this.#transactionManager.manager;
|
|
1620
1620
|
const transactionInfo = await transactionManager.startTransaction();
|
|
1621
|
-
const transaction = transactionManager.getTransaction(transactionInfo, "query");
|
|
1621
|
+
const transaction = await transactionManager.getTransaction(transactionInfo, "query");
|
|
1622
1622
|
try {
|
|
1623
1623
|
const value = await this.interpretNode(node.args, transaction, scope, generators);
|
|
1624
1624
|
await transactionManager.commitTransaction(transactionInfo.id);
|
|
@@ -1876,11 +1876,6 @@ var TransactionClosedError = class extends TransactionManagerError {
|
|
|
1876
1876
|
super(`Transaction already closed: A ${operation} cannot be executed on a committed transaction.`);
|
|
1877
1877
|
}
|
|
1878
1878
|
};
|
|
1879
|
-
var TransactionClosingError = class extends TransactionManagerError {
|
|
1880
|
-
constructor(operation) {
|
|
1881
|
-
super(`Transaction is being closed: A ${operation} cannot be executed on a closing transaction.`);
|
|
1882
|
-
}
|
|
1883
|
-
};
|
|
1884
1879
|
var TransactionRolledBackError = class extends TransactionManagerError {
|
|
1885
1880
|
constructor(operation) {
|
|
1886
1881
|
super(`Transaction already closed: A ${operation} cannot be executed on a transaction that was rolled back.`);
|
|
@@ -1953,7 +1948,7 @@ var TransactionManager = class {
|
|
|
1953
1948
|
return await this.tracingHelper.runInChildSpan("start_transaction", () => this.#startTransactionImpl(options));
|
|
1954
1949
|
}
|
|
1955
1950
|
async #startTransactionImpl(options) {
|
|
1956
|
-
const validatedOptions = options !== void 0 ? this
|
|
1951
|
+
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : this.transactionOptions;
|
|
1957
1952
|
const transaction = {
|
|
1958
1953
|
id: await randomUUID(),
|
|
1959
1954
|
status: "waiting",
|
|
@@ -1970,13 +1965,12 @@ var TransactionManager = class {
|
|
|
1970
1965
|
switch (transaction.status) {
|
|
1971
1966
|
case "waiting":
|
|
1972
1967
|
if (hasTimedOut) {
|
|
1973
|
-
await this
|
|
1968
|
+
await this.#closeTransaction(transaction, "timed_out");
|
|
1974
1969
|
throw new TransactionStartTimeoutError();
|
|
1975
1970
|
}
|
|
1976
1971
|
transaction.status = "running";
|
|
1977
|
-
transaction.timer = this
|
|
1972
|
+
transaction.timer = this.#startTransactionTimeout(transaction.id, validatedOptions.timeout);
|
|
1978
1973
|
return { id: transaction.id };
|
|
1979
|
-
case "closing":
|
|
1980
1974
|
case "timed_out":
|
|
1981
1975
|
case "running":
|
|
1982
1976
|
case "committed":
|
|
@@ -1985,27 +1979,31 @@ var TransactionManager = class {
|
|
|
1985
1979
|
`Transaction in invalid state ${transaction.status} although it just finished startup.`
|
|
1986
1980
|
);
|
|
1987
1981
|
default:
|
|
1988
|
-
assertNever(transaction
|
|
1982
|
+
assertNever(transaction["status"], "Unknown transaction status.");
|
|
1989
1983
|
}
|
|
1990
1984
|
}
|
|
1991
1985
|
async commitTransaction(transactionId) {
|
|
1992
1986
|
return await this.tracingHelper.runInChildSpan("commit_transaction", async () => {
|
|
1993
|
-
const txw = this
|
|
1994
|
-
await this
|
|
1987
|
+
const txw = this.#getActiveOrClosingTransaction(transactionId, "commit");
|
|
1988
|
+
await this.#closeTransaction(txw, "committed");
|
|
1995
1989
|
});
|
|
1996
1990
|
}
|
|
1997
1991
|
async rollbackTransaction(transactionId) {
|
|
1998
1992
|
return await this.tracingHelper.runInChildSpan("rollback_transaction", async () => {
|
|
1999
|
-
const txw = this
|
|
2000
|
-
await this
|
|
1993
|
+
const txw = this.#getActiveOrClosingTransaction(transactionId, "rollback");
|
|
1994
|
+
await this.#closeTransaction(txw, "rolled_back");
|
|
2001
1995
|
});
|
|
2002
1996
|
}
|
|
2003
|
-
getTransaction(txInfo, operation) {
|
|
2004
|
-
|
|
1997
|
+
async getTransaction(txInfo, operation) {
|
|
1998
|
+
let tx = this.#getActiveOrClosingTransaction(txInfo.id, operation);
|
|
1999
|
+
if (tx.status === "closing") {
|
|
2000
|
+
await tx.closing;
|
|
2001
|
+
tx = this.#getActiveOrClosingTransaction(txInfo.id, operation);
|
|
2002
|
+
}
|
|
2005
2003
|
if (!tx.transaction) throw new TransactionNotFoundError();
|
|
2006
2004
|
return tx.transaction;
|
|
2007
2005
|
}
|
|
2008
|
-
|
|
2006
|
+
#getActiveOrClosingTransaction(transactionId, operation) {
|
|
2009
2007
|
const transaction = this.transactions.get(transactionId);
|
|
2010
2008
|
if (!transaction) {
|
|
2011
2009
|
const closedTransaction = this.closedTransactions.find((tx) => tx.id === transactionId);
|
|
@@ -2031,62 +2029,74 @@ var TransactionManager = class {
|
|
|
2031
2029
|
throw new TransactionNotFoundError();
|
|
2032
2030
|
}
|
|
2033
2031
|
}
|
|
2034
|
-
if (transaction.status === "closing") {
|
|
2035
|
-
throw new TransactionClosingError(operation);
|
|
2036
|
-
}
|
|
2037
2032
|
if (["committed", "rolled_back", "timed_out"].includes(transaction.status)) {
|
|
2038
2033
|
throw new TransactionInternalConsistencyError("Closed transaction found in active transactions map.");
|
|
2039
2034
|
}
|
|
2040
2035
|
return transaction;
|
|
2041
2036
|
}
|
|
2042
2037
|
async cancelAllTransactions() {
|
|
2043
|
-
await Promise.allSettled([...this.transactions.values()].map((tx) => this
|
|
2038
|
+
await Promise.allSettled([...this.transactions.values()].map((tx) => this.#closeTransaction(tx, "rolled_back")));
|
|
2044
2039
|
}
|
|
2045
|
-
startTransactionTimeout(transactionId, timeout) {
|
|
2040
|
+
#startTransactionTimeout(transactionId, timeout) {
|
|
2046
2041
|
const timeoutStartedAt = Date.now();
|
|
2047
2042
|
return setTimeout(async () => {
|
|
2048
2043
|
debug("Transaction timed out.", { transactionId, timeoutStartedAt, timeout });
|
|
2049
2044
|
const tx = this.transactions.get(transactionId);
|
|
2050
2045
|
if (tx && ["running", "waiting"].includes(tx.status)) {
|
|
2051
|
-
await this
|
|
2046
|
+
await this.#closeTransaction(tx, "timed_out");
|
|
2052
2047
|
} else {
|
|
2053
2048
|
debug("Transaction already committed or rolled back when timeout happened.", transactionId);
|
|
2054
2049
|
}
|
|
2055
2050
|
}, timeout);
|
|
2056
2051
|
}
|
|
2057
|
-
async closeTransaction(tx, status) {
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2052
|
+
async #closeTransaction(tx, status) {
|
|
2053
|
+
const createClosingPromise = async () => {
|
|
2054
|
+
debug("Closing transaction.", { transactionId: tx.id, status });
|
|
2055
|
+
try {
|
|
2056
|
+
if (tx.transaction && status === "committed") {
|
|
2057
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
2058
|
+
await this.#withQuerySpanAndEvent(PHANTOM_COMMIT_QUERY(), tx.transaction, () => tx.transaction.commit());
|
|
2059
|
+
} else {
|
|
2060
|
+
const query = COMMIT_QUERY();
|
|
2061
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
2062
|
+
await tx.transaction.commit();
|
|
2063
|
+
}
|
|
2064
|
+
} else if (tx.transaction) {
|
|
2065
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
2066
|
+
await this.#withQuerySpanAndEvent(
|
|
2067
|
+
PHANTOM_ROLLBACK_QUERY(),
|
|
2068
|
+
tx.transaction,
|
|
2069
|
+
() => tx.transaction.rollback()
|
|
2070
|
+
);
|
|
2071
|
+
} else {
|
|
2072
|
+
const query = ROLLBACK_QUERY();
|
|
2073
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
2074
|
+
await tx.transaction.rollback();
|
|
2075
|
+
}
|
|
2068
2076
|
}
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2077
|
+
} finally {
|
|
2078
|
+
tx.status = status;
|
|
2079
|
+
clearTimeout(tx.timer);
|
|
2080
|
+
tx.timer = void 0;
|
|
2081
|
+
this.transactions.delete(tx.id);
|
|
2082
|
+
this.closedTransactions.push(tx);
|
|
2083
|
+
if (this.closedTransactions.length > MAX_CLOSED_TRANSACTIONS) {
|
|
2084
|
+
this.closedTransactions.shift();
|
|
2076
2085
|
}
|
|
2077
2086
|
}
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
tx.
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
+
};
|
|
2088
|
+
if (tx.status === "closing") {
|
|
2089
|
+
await tx.closing;
|
|
2090
|
+
this.#getActiveOrClosingTransaction(tx.id, status === "committed" ? "commit" : "rollback");
|
|
2091
|
+
} else {
|
|
2092
|
+
await Object.assign(tx, {
|
|
2093
|
+
status: "closing",
|
|
2094
|
+
reason: status,
|
|
2095
|
+
closing: createClosingPromise()
|
|
2096
|
+
}).closing;
|
|
2087
2097
|
}
|
|
2088
2098
|
}
|
|
2089
|
-
validateOptions(options) {
|
|
2099
|
+
#validateOptions(options) {
|
|
2090
2100
|
if (!options.timeout) throw new TransactionManagerError("timeout is required");
|
|
2091
2101
|
if (!options.maxWait) throw new TransactionManagerError("maxWait is required");
|
|
2092
2102
|
if (options.isolationLevel === "SNAPSHOT") throw new InvalidTransactionIsolationLevelError(options.isolationLevel);
|
package/dist/index.mjs
CHANGED
|
@@ -1566,7 +1566,7 @@ var QueryInterpreter = class _QueryInterpreter {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
const transactionManager = this.#transactionManager.manager;
|
|
1568
1568
|
const transactionInfo = await transactionManager.startTransaction();
|
|
1569
|
-
const transaction = transactionManager.getTransaction(transactionInfo, "query");
|
|
1569
|
+
const transaction = await transactionManager.getTransaction(transactionInfo, "query");
|
|
1570
1570
|
try {
|
|
1571
1571
|
const value = await this.interpretNode(node.args, transaction, scope, generators);
|
|
1572
1572
|
await transactionManager.commitTransaction(transactionInfo.id);
|
|
@@ -1824,11 +1824,6 @@ var TransactionClosedError = class extends TransactionManagerError {
|
|
|
1824
1824
|
super(`Transaction already closed: A ${operation} cannot be executed on a committed transaction.`);
|
|
1825
1825
|
}
|
|
1826
1826
|
};
|
|
1827
|
-
var TransactionClosingError = class extends TransactionManagerError {
|
|
1828
|
-
constructor(operation) {
|
|
1829
|
-
super(`Transaction is being closed: A ${operation} cannot be executed on a closing transaction.`);
|
|
1830
|
-
}
|
|
1831
|
-
};
|
|
1832
1827
|
var TransactionRolledBackError = class extends TransactionManagerError {
|
|
1833
1828
|
constructor(operation) {
|
|
1834
1829
|
super(`Transaction already closed: A ${operation} cannot be executed on a transaction that was rolled back.`);
|
|
@@ -1901,7 +1896,7 @@ var TransactionManager = class {
|
|
|
1901
1896
|
return await this.tracingHelper.runInChildSpan("start_transaction", () => this.#startTransactionImpl(options));
|
|
1902
1897
|
}
|
|
1903
1898
|
async #startTransactionImpl(options) {
|
|
1904
|
-
const validatedOptions = options !== void 0 ? this
|
|
1899
|
+
const validatedOptions = options !== void 0 ? this.#validateOptions(options) : this.transactionOptions;
|
|
1905
1900
|
const transaction = {
|
|
1906
1901
|
id: await randomUUID(),
|
|
1907
1902
|
status: "waiting",
|
|
@@ -1918,13 +1913,12 @@ var TransactionManager = class {
|
|
|
1918
1913
|
switch (transaction.status) {
|
|
1919
1914
|
case "waiting":
|
|
1920
1915
|
if (hasTimedOut) {
|
|
1921
|
-
await this
|
|
1916
|
+
await this.#closeTransaction(transaction, "timed_out");
|
|
1922
1917
|
throw new TransactionStartTimeoutError();
|
|
1923
1918
|
}
|
|
1924
1919
|
transaction.status = "running";
|
|
1925
|
-
transaction.timer = this
|
|
1920
|
+
transaction.timer = this.#startTransactionTimeout(transaction.id, validatedOptions.timeout);
|
|
1926
1921
|
return { id: transaction.id };
|
|
1927
|
-
case "closing":
|
|
1928
1922
|
case "timed_out":
|
|
1929
1923
|
case "running":
|
|
1930
1924
|
case "committed":
|
|
@@ -1933,27 +1927,31 @@ var TransactionManager = class {
|
|
|
1933
1927
|
`Transaction in invalid state ${transaction.status} although it just finished startup.`
|
|
1934
1928
|
);
|
|
1935
1929
|
default:
|
|
1936
|
-
assertNever(transaction
|
|
1930
|
+
assertNever(transaction["status"], "Unknown transaction status.");
|
|
1937
1931
|
}
|
|
1938
1932
|
}
|
|
1939
1933
|
async commitTransaction(transactionId) {
|
|
1940
1934
|
return await this.tracingHelper.runInChildSpan("commit_transaction", async () => {
|
|
1941
|
-
const txw = this
|
|
1942
|
-
await this
|
|
1935
|
+
const txw = this.#getActiveOrClosingTransaction(transactionId, "commit");
|
|
1936
|
+
await this.#closeTransaction(txw, "committed");
|
|
1943
1937
|
});
|
|
1944
1938
|
}
|
|
1945
1939
|
async rollbackTransaction(transactionId) {
|
|
1946
1940
|
return await this.tracingHelper.runInChildSpan("rollback_transaction", async () => {
|
|
1947
|
-
const txw = this
|
|
1948
|
-
await this
|
|
1941
|
+
const txw = this.#getActiveOrClosingTransaction(transactionId, "rollback");
|
|
1942
|
+
await this.#closeTransaction(txw, "rolled_back");
|
|
1949
1943
|
});
|
|
1950
1944
|
}
|
|
1951
|
-
getTransaction(txInfo, operation) {
|
|
1952
|
-
|
|
1945
|
+
async getTransaction(txInfo, operation) {
|
|
1946
|
+
let tx = this.#getActiveOrClosingTransaction(txInfo.id, operation);
|
|
1947
|
+
if (tx.status === "closing") {
|
|
1948
|
+
await tx.closing;
|
|
1949
|
+
tx = this.#getActiveOrClosingTransaction(txInfo.id, operation);
|
|
1950
|
+
}
|
|
1953
1951
|
if (!tx.transaction) throw new TransactionNotFoundError();
|
|
1954
1952
|
return tx.transaction;
|
|
1955
1953
|
}
|
|
1956
|
-
|
|
1954
|
+
#getActiveOrClosingTransaction(transactionId, operation) {
|
|
1957
1955
|
const transaction = this.transactions.get(transactionId);
|
|
1958
1956
|
if (!transaction) {
|
|
1959
1957
|
const closedTransaction = this.closedTransactions.find((tx) => tx.id === transactionId);
|
|
@@ -1979,62 +1977,74 @@ var TransactionManager = class {
|
|
|
1979
1977
|
throw new TransactionNotFoundError();
|
|
1980
1978
|
}
|
|
1981
1979
|
}
|
|
1982
|
-
if (transaction.status === "closing") {
|
|
1983
|
-
throw new TransactionClosingError(operation);
|
|
1984
|
-
}
|
|
1985
1980
|
if (["committed", "rolled_back", "timed_out"].includes(transaction.status)) {
|
|
1986
1981
|
throw new TransactionInternalConsistencyError("Closed transaction found in active transactions map.");
|
|
1987
1982
|
}
|
|
1988
1983
|
return transaction;
|
|
1989
1984
|
}
|
|
1990
1985
|
async cancelAllTransactions() {
|
|
1991
|
-
await Promise.allSettled([...this.transactions.values()].map((tx) => this
|
|
1986
|
+
await Promise.allSettled([...this.transactions.values()].map((tx) => this.#closeTransaction(tx, "rolled_back")));
|
|
1992
1987
|
}
|
|
1993
|
-
startTransactionTimeout(transactionId, timeout) {
|
|
1988
|
+
#startTransactionTimeout(transactionId, timeout) {
|
|
1994
1989
|
const timeoutStartedAt = Date.now();
|
|
1995
1990
|
return setTimeout(async () => {
|
|
1996
1991
|
debug("Transaction timed out.", { transactionId, timeoutStartedAt, timeout });
|
|
1997
1992
|
const tx = this.transactions.get(transactionId);
|
|
1998
1993
|
if (tx && ["running", "waiting"].includes(tx.status)) {
|
|
1999
|
-
await this
|
|
1994
|
+
await this.#closeTransaction(tx, "timed_out");
|
|
2000
1995
|
} else {
|
|
2001
1996
|
debug("Transaction already committed or rolled back when timeout happened.", transactionId);
|
|
2002
1997
|
}
|
|
2003
1998
|
}, timeout);
|
|
2004
1999
|
}
|
|
2005
|
-
async closeTransaction(tx, status) {
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2000
|
+
async #closeTransaction(tx, status) {
|
|
2001
|
+
const createClosingPromise = async () => {
|
|
2002
|
+
debug("Closing transaction.", { transactionId: tx.id, status });
|
|
2003
|
+
try {
|
|
2004
|
+
if (tx.transaction && status === "committed") {
|
|
2005
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
2006
|
+
await this.#withQuerySpanAndEvent(PHANTOM_COMMIT_QUERY(), tx.transaction, () => tx.transaction.commit());
|
|
2007
|
+
} else {
|
|
2008
|
+
const query = COMMIT_QUERY();
|
|
2009
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
2010
|
+
await tx.transaction.commit();
|
|
2011
|
+
}
|
|
2012
|
+
} else if (tx.transaction) {
|
|
2013
|
+
if (tx.transaction.options.usePhantomQuery) {
|
|
2014
|
+
await this.#withQuerySpanAndEvent(
|
|
2015
|
+
PHANTOM_ROLLBACK_QUERY(),
|
|
2016
|
+
tx.transaction,
|
|
2017
|
+
() => tx.transaction.rollback()
|
|
2018
|
+
);
|
|
2019
|
+
} else {
|
|
2020
|
+
const query = ROLLBACK_QUERY();
|
|
2021
|
+
await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
|
|
2022
|
+
await tx.transaction.rollback();
|
|
2023
|
+
}
|
|
2016
2024
|
}
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2025
|
+
} finally {
|
|
2026
|
+
tx.status = status;
|
|
2027
|
+
clearTimeout(tx.timer);
|
|
2028
|
+
tx.timer = void 0;
|
|
2029
|
+
this.transactions.delete(tx.id);
|
|
2030
|
+
this.closedTransactions.push(tx);
|
|
2031
|
+
if (this.closedTransactions.length > MAX_CLOSED_TRANSACTIONS) {
|
|
2032
|
+
this.closedTransactions.shift();
|
|
2024
2033
|
}
|
|
2025
2034
|
}
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
tx.
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
+
};
|
|
2036
|
+
if (tx.status === "closing") {
|
|
2037
|
+
await tx.closing;
|
|
2038
|
+
this.#getActiveOrClosingTransaction(tx.id, status === "committed" ? "commit" : "rollback");
|
|
2039
|
+
} else {
|
|
2040
|
+
await Object.assign(tx, {
|
|
2041
|
+
status: "closing",
|
|
2042
|
+
reason: status,
|
|
2043
|
+
closing: createClosingPromise()
|
|
2044
|
+
}).closing;
|
|
2035
2045
|
}
|
|
2036
2046
|
}
|
|
2037
|
-
validateOptions(options) {
|
|
2047
|
+
#validateOptions(options) {
|
|
2038
2048
|
if (!options.timeout) throw new TransactionManagerError("timeout is required");
|
|
2039
2049
|
if (!options.maxWait) throw new TransactionManagerError("maxWait is required");
|
|
2040
2050
|
if (options.isolationLevel === "SNAPSHOT") throw new InvalidTransactionIsolationLevelError(options.isolationLevel);
|
|
@@ -9,9 +9,6 @@ export declare class TransactionNotFoundError extends TransactionManagerError {
|
|
|
9
9
|
export declare class TransactionClosedError extends TransactionManagerError {
|
|
10
10
|
constructor(operation: string);
|
|
11
11
|
}
|
|
12
|
-
export declare class TransactionClosingError extends TransactionManagerError {
|
|
13
|
-
constructor(operation: string);
|
|
14
|
-
}
|
|
15
12
|
export declare class TransactionRolledBackError extends TransactionManagerError {
|
|
16
13
|
constructor(operation: string);
|
|
17
14
|
}
|
|
@@ -20,10 +20,6 @@ export declare class TransactionManager {
|
|
|
20
20
|
startTransaction(options?: Options): Promise<TransactionInfo>;
|
|
21
21
|
commitTransaction(transactionId: string): Promise<void>;
|
|
22
22
|
rollbackTransaction(transactionId: string): Promise<void>;
|
|
23
|
-
getTransaction(txInfo: TransactionInfo, operation: string): Transaction
|
|
24
|
-
private getActiveTransaction;
|
|
23
|
+
getTransaction(txInfo: TransactionInfo, operation: string): Promise<Transaction>;
|
|
25
24
|
cancelAllTransactions(): Promise<void>;
|
|
26
|
-
private startTransactionTimeout;
|
|
27
|
-
private closeTransaction;
|
|
28
|
-
private validateOptions;
|
|
29
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-engine-runtime",
|
|
3
|
-
"version": "6.15.0-dev.
|
|
3
|
+
"version": "6.15.0-dev.3",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"nanoid": "5.1.5",
|
|
32
32
|
"ulid": "3.0.0",
|
|
33
33
|
"uuid": "11.1.0",
|
|
34
|
-
"@prisma/debug": "6.15.0-dev.
|
|
35
|
-
"@prisma/driver-adapter-utils": "6.15.0-dev.
|
|
34
|
+
"@prisma/debug": "6.15.0-dev.3",
|
|
35
|
+
"@prisma/driver-adapter-utils": "6.15.0-dev.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jest": "29.5.14",
|