@@ -56,8 +56,8 @@ struct Reminder: Hashable, Identifiable {
56
56
extension Updates < Reminder > {
57
57
mutating func toggleStatus( ) {
58
58
self . status = Case ( self . status)
59
- . when ( Reminder . Status . incomplete, then: Reminder . Status . completing)
60
- . else ( Reminder . Status . incomplete)
59
+ . when ( #bind ( . incomplete) , then: #bind ( . completing) )
60
+ . else ( #bind ( . incomplete) )
61
61
}
62
62
}
63
63
@@ -101,13 +101,13 @@ extension Tag {
101
101
}
102
102
103
103
@Table ( " remindersTags " )
104
- struct ReminderTag : Hashable , Identifiable {
104
+ struct ReminderTag : Identifiable {
105
105
let id : UUID
106
- var reminderID : Reminder . ID
107
- var tagID : Tag . ID
106
+ let reminderID : Reminder . ID
107
+ let tagID : Tag . ID
108
108
}
109
109
110
- @Table @ Selection
110
+ @Table
111
111
struct ReminderText : FTS5 {
112
112
let rowid : Int
113
113
let title : String
@@ -335,7 +335,7 @@ func appDatabase() throws -> any DatabaseWriter {
335
335
} forEachRow: { _, _ in
336
336
Values ( $handleReminderStatusUpdate ( ) )
337
337
} when: { _, new in
338
- new. status. eq ( Reminder . Status . completing)
338
+ new. status. eq ( #bind ( . completing) )
339
339
}
340
340
)
341
341
. execute ( db)
@@ -359,7 +359,7 @@ func handleReminderStatusUpdate() {
359
359
try await clock. sleep ( for: . seconds( 5 ) )
360
360
try await database. write { db in
361
361
try Reminder
362
- . where { $0. status. eq ( Reminder . Status . completing) }
362
+ . where { $0. status. eq ( #bind ( . completing) ) }
363
363
. update { $0. status = . completed }
364
364
. execute ( db)
365
365
}
0 commit comments