You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/src/commonMain/kotlin/com/powersync/db/Queries.kt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,8 @@ public interface Queries {
122
122
*
123
123
* 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.
124
124
*
125
+
* In most cases, [writeTransaction] should be used instead.
126
+
*
125
127
* @param callback The callback to execute while holding the lock.
126
128
* @return The result of the callback.
127
129
* @throws PowerSyncException If a database error occurs.
@@ -135,6 +137,8 @@ public interface Queries {
135
137
*
136
138
* 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.
137
139
*
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
+
*
138
142
* @param callback The callback to execute within the transaction.
139
143
* @return The result of the callback.
140
144
* @throws PowerSyncException If a database error occurs.
@@ -159,6 +163,8 @@ public interface Queries {
159
163
/**
160
164
* Opens a read-only transaction.
161
165
*
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
+
*
162
168
* @param callback The callback to execute within the transaction.
163
169
* @return The result of the callback.
164
170
* @throws PowerSyncException If a database error occurs.
0 commit comments