Skip to content

Commit 2db494b

Browse files
CopilotpolRk
andcommitted
Add snapshotReadWrite isolation mode support
Co-authored-by: polRk <39828645+polRk@users.noreply.github.com>
1 parent d65484a commit 2db494b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/query/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ interface SessionContextCallback<T> {
3838
}
3939

4040
interface TransactionExecuteOptions extends Abortable {
41-
isolation?: 'serializableReadWrite' | 'snapshotReadOnly'
41+
isolation?:
42+
| 'serializableReadWrite'
43+
| 'snapshotReadOnly'
44+
| 'snapshotReadWrite'
4245
idempotent?: boolean
4346
}
4447

packages/query/src/query.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class Query<T extends any[] = unknown[]>
7373
| 'implicit'
7474
| 'serializableReadWrite'
7575
| 'snapshotReadOnly'
76+
| 'snapshotReadWrite'
7677
| 'onlineReadOnly'
7778
| 'staleReadOnly' = 'implicit'
7879
#isolationSettings: { allowInconsistentReads: boolean } | {} = {}
@@ -434,6 +435,7 @@ export class Query<T extends any[] = unknown[]>
434435
* @param mode Transaction isolation level:
435436
* - 'serializableReadWrite' — serializable read/write
436437
* - 'snapshotReadOnly' — snapshot read-only
438+
* - 'snapshotReadWrite' — snapshot read/write
437439
* - 'onlineReadOnly' — online read-only
438440
* - 'staleReadOnly' — stale read-only
439441
* - 'implicit' — isolation is not set, server decides
@@ -446,6 +448,7 @@ export class Query<T extends any[] = unknown[]>
446448
| 'implicit'
447449
| 'serializableReadWrite'
448450
| 'snapshotReadOnly'
451+
| 'snapshotReadWrite'
449452
| 'onlineReadOnly'
450453
| 'staleReadOnly',
451454
settings: { allowInconsistentReads: boolean } | {} | undefined = {}

0 commit comments

Comments
 (0)