@@ -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 " )
0 commit comments