@@ -56,20 +56,10 @@ class SystemManager {
56
56
}
57
57
58
58
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
-
61
59
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]
64
62
)
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
- // })
73
63
}
74
64
75
65
func deleteList( id: String ) async throws {
@@ -97,8 +87,8 @@ class SystemManager {
97
87
listId: cursor. getString ( name: " list_id " ) ,
98
88
photoId: cursor. getStringOptional ( name: " photo_id " ) ,
99
89
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 " ) ,
102
92
completedAt: cursor. getStringOptional ( name: " completed_at " ) ,
103
93
createdBy: cursor. getStringOptional ( name: " created_by " ) ,
104
94
completedBy: cursor. getStringOptional ( name: " completed_by " )
0 commit comments