Skip to content

Commit 52ed16d

Browse files
update read and write lock docs
1 parent 4e9c2a8 commit 52ed16d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/PowerSync/Protocol/QueriesProtocol.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,17 @@ public protocol Queries {
6262
options: WatchOptions<RowType>
6363
) throws -> AsyncThrowingStream<[RowType], Error>
6464

65-
/// Execute a write transaction with the given callback
65+
/// Takes a global lock, without starting a transaction.
66+
///
67+
/// In most cases, [writeTransaction] should be used instead.
6668
func writeLock<R>(
6769
callback: @escaping (any ConnectionContext) throws -> R
6870
) async throws -> R
6971

70-
/// Execute a read transaction with the given callback
72+
/// Takes a read lock, without starting a transaction.
73+
///
74+
/// The lock only applies to a single connection, and multiple
75+
/// connections may hold read locks at the same time.
7176
func readLock<R>(
7277
callback: @escaping (any ConnectionContext) throws -> R
7378
) async throws -> R

0 commit comments

Comments
 (0)