Skip to content

Commit e7b6af6

Browse files
fix transaction example (#145)
1 parent a22cff5 commit e7b6af6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client-sdk-references/kotlin-multiplatform.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ The `execute` method executes a write query (INSERT, UPDATE, DELETE) and returns
256256

257257
```kotlin
258258
suspend fun insertCustomer(name: String, email: String) {
259-
database.writeTransaction {
260-
database.execute(
259+
database.writeTransaction { tx ->
260+
tx.execute(
261261
sql = "INSERT INTO customers (id, name, email) VALUES (uuid(), ?, ?)",
262262
parameters = listOf(name, email)
263263
)
@@ -281,8 +281,8 @@ suspend fun deleteCustomer(id: String? = null) {
281281
}
282282
) ?: return
283283

284-
database.writeTransaction {
285-
database.execute(
284+
database.writeTransaction { tx ->
285+
tx.execute(
286286
sql = "DELETE FROM customers WHERE id = ?",
287287
parameters = listOf(targetId)
288288
)

0 commit comments

Comments
 (0)