Skip to content

Commit cb81f6b

Browse files
cleanup
1 parent 06b5143 commit cb81f6b

File tree

1 file changed

+6
-0
lines changed
  • core/src/commonMain/kotlin/com/powersync/db

1 file changed

+6
-0
lines changed

core/src/commonMain/kotlin/com/powersync/db/Queries.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ public interface Queries {
122122
*
123123
* This lock ensures that only one write transaction can execute against the database at a time, even across separate database instances for the same file.
124124
*
125+
* In most cases, [writeTransaction] should be used instead.
126+
*
125127
* @param callback The callback to execute while holding the lock.
126128
* @return The result of the callback.
127129
* @throws PowerSyncException If a database error occurs.
@@ -135,6 +137,8 @@ public interface Queries {
135137
*
136138
* This takes a global lock, ensuring that only one write transaction can execute against the database at a time, even across separate database instances for the same file.
137139
*
140+
* Statements within the transaction must be done on the provided [PowerSyncTransaction] - attempting statements on the database instance will error cause a dead-lock.
141+
*
138142
* @param callback The callback to execute within the transaction.
139143
* @return The result of the callback.
140144
* @throws PowerSyncException If a database error occurs.
@@ -159,6 +163,8 @@ public interface Queries {
159163
/**
160164
* Opens a read-only transaction.
161165
*
166+
* Statements within the transaction must be done on the provided [PowerSyncTransaction] - executing statements on the database level will be executed on separate connections.
167+
*
162168
* @param callback The callback to execute within the transaction.
163169
* @return The result of the callback.
164170
* @throws PowerSyncException If a database error occurs.

0 commit comments

Comments
 (0)