Skip to content

Commit c4f14d6

Browse files
cleanup
1 parent 1e4fee9 commit c4f14d6

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

Demo/PowerSyncExample/PowerSync/SystemManager.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,10 @@ class SystemManager {
5656
}
5757

5858
func insertList(_ list: NewListContent) async throws {
59-
let id = try await self.db.get(sql: "select uuid() as uuid", parameters: [], mapper: {cursor in try cursor.getString(name: "uuid")})
60-
6159
let result = try await self.db.execute(
62-
sql: "INSERT INTO \(LISTS_TABLE) (id, created_at, name, owner_id) VALUES (?, datetime(), ?, ?)",
63-
parameters: [id, list.name, connector.currentUserID]
60+
sql: "INSERT INTO \(LISTS_TABLE) (id, created_at, name, owner_id) VALUES (uuid(), datetime(), ?, ?)",
61+
parameters: [list.name, connector.currentUserID]
6462
)
65-
66-
// insert 2000k todos
67-
// try await self.db.writeTransaction(callback: { tx in
68-
// for (_) in 0..<10000 {
69-
// try tx.execute(sql: "INSERT INTO \(TODOS_TABLE) (id, list_id, description) VALUES (uuid(), ?, ?)", parameters: [id, "Todo \(Int.random(in: 0..<1000))"])
70-
// }
71-
72-
// })
7363
}
7464

7565
func deleteList(id: String) async throws {
@@ -97,8 +87,8 @@ class SystemManager {
9787
listId: cursor.getString(name: "list_id"),
9888
photoId: cursor.getStringOptional(name: "photo_id"),
9989
description: cursor.getString(name: "description"),
100-
isComplete: cursor.getBooleanOptional(name: "completed") ?? false,
101-
createdAt: cursor.getStringOptional(name: "created_at"),
90+
isComplete: cursor.getBoolean(name: "completed"),
91+
createdAt: cursor.getString(name: "created_at"),
10292
completedAt: cursor.getStringOptional(name: "completed_at"),
10393
createdBy: cursor.getStringOptional(name: "created_by"),
10494
completedBy: cursor.getStringOptional(name: "completed_by")

Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ final class KotlinPowerSyncDatabaseImplTests: XCTestCase {
226226

227227
let watchTask = Task {
228228
for try await names in stream {
229-
print(names)
230229
await resultsStore.append(names)
231230
if await resultsStore.count() == 2 {
232231
expectation.fulfill()

0 commit comments

Comments
 (0)