@@ -39,7 +39,7 @@ extension MutablePersistableRecord {
39
39
/// - parameter columns: The columns to update.
40
40
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
41
41
/// error thrown by the persistence callbacks defined by the record type,
42
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
42
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
43
43
/// primary key does not match any row in the database.
44
44
@inlinable // allow specialization so that empty callbacks are removed
45
45
public func update< Columns> (
@@ -83,7 +83,7 @@ extension MutablePersistableRecord {
83
83
/// - parameter columns: The columns to update.
84
84
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
85
85
/// error thrown by the persistence callbacks defined by the record type,
86
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
86
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
87
87
/// primary key does not match any row in the database.
88
88
@inlinable // allow specialization so that empty callbacks are removed
89
89
public func update< Columns> (
@@ -115,7 +115,7 @@ extension MutablePersistableRecord {
115
115
/// is used.
116
116
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
117
117
/// error thrown by the persistence callbacks defined by the record type,
118
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
118
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
119
119
/// primary key does not match any row in the database.
120
120
@inlinable // allow specialization so that empty callbacks are removed
121
121
public func update(
@@ -158,7 +158,7 @@ extension MutablePersistableRecord {
158
158
/// - returns: Whether the record had changes.
159
159
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
160
160
/// error thrown by the persistence callbacks defined by the record type,
161
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
161
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
162
162
/// primary key does not match any row in the database.
163
163
/// - SeeAlso: updateChanges(_:with:)
164
164
@discardableResult
@@ -202,7 +202,7 @@ extension MutablePersistableRecord {
202
202
/// - returns: Whether the record had changes.
203
203
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
204
204
/// error thrown by the persistence callbacks defined by the record type,
205
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
205
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
206
206
/// primary key does not match any row in the database.
207
207
@discardableResult
208
208
@inlinable // allow specialization so that empty callbacks are removed
@@ -233,7 +233,7 @@ extension MutablePersistableRecord {
233
233
/// conflict policy is `IGNORE`.
234
234
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
235
235
/// error thrown by the persistence callbacks defined by the record type,
236
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
236
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
237
237
/// primary key does not match any row in the database.
238
238
@inlinable // allow specialization so that empty callbacks are removed
239
239
public func updateAndFetch(
@@ -257,7 +257,7 @@ extension MutablePersistableRecord {
257
257
/// the conflict policy is `IGNORE`.
258
258
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
259
259
/// error thrown by the persistence callbacks defined by the record type,
260
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
260
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
261
261
/// primary key does not match any row in the database.
262
262
@inlinable // allow specialization so that empty callbacks are removed
263
263
public func updateAndFetch< T: FetchableRecord & TableRecord > (
@@ -285,7 +285,7 @@ extension MutablePersistableRecord {
285
285
/// in case of a failed update due to the `IGNORE` conflict policy.
286
286
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
287
287
/// error thrown by the persistence callbacks defined by the record type,
288
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
288
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
289
289
/// primary key does not match any row in the database.
290
290
@inlinable // allow specialization so that empty callbacks are removed
291
291
public mutating func updateChangesAndFetch(
@@ -314,7 +314,7 @@ extension MutablePersistableRecord {
314
314
/// conflict policy.
315
315
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
316
316
/// error thrown by the persistence callbacks defined by the record type,
317
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
317
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
318
318
/// primary key does not match any row in the database.
319
319
@inlinable // allow specialization so that empty callbacks are removed
320
320
public mutating func updateChangesAndFetch< T: FetchableRecord & TableRecord > (
@@ -358,7 +358,7 @@ extension MutablePersistableRecord {
358
358
/// - returns: The result of the `fetch` function.
359
359
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
360
360
/// error thrown by the persistence callbacks defined by the record type,
361
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
361
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
362
362
/// primary key does not match any row in the database.
363
363
/// - precondition: `selection` is not empty.
364
364
@inlinable // allow specialization so that empty callbacks are removed
@@ -419,7 +419,7 @@ extension MutablePersistableRecord {
419
419
/// - returns: The result of the `fetch` function.
420
420
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
421
421
/// error thrown by the persistence callbacks defined by the record type,
422
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
422
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
423
423
/// primary key does not match any row in the database.
424
424
/// - precondition: `selection` is not empty.
425
425
@inlinable // allow specialization so that empty callbacks are removed
@@ -462,7 +462,7 @@ extension MutablePersistableRecord {
462
462
/// - returns: The result of the `fetch` function.
463
463
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
464
464
/// error thrown by the persistence callbacks defined by the record type,
465
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
465
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
466
466
/// primary key does not match any row in the database.
467
467
/// - precondition: `selection` is not empty.
468
468
@inlinable // allow specialization so that empty callbacks are removed
@@ -497,7 +497,7 @@ extension MutablePersistableRecord {
497
497
/// - returns: The result of the `fetch` function.
498
498
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
499
499
/// error thrown by the persistence callbacks defined by the record type,
500
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
500
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
501
501
/// primary key does not match any row in the database.
502
502
/// - precondition: `selection` is not empty.
503
503
@inlinable // allow specialization so that empty callbacks are removed
@@ -529,7 +529,7 @@ extension MutablePersistableRecord {
529
529
/// conflict policy is `IGNORE`.
530
530
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
531
531
/// error thrown by the persistence callbacks defined by the record type,
532
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
532
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
533
533
/// primary key does not match any row in the database.
534
534
@inlinable // allow specialization so that empty callbacks are removed
535
535
@available ( iOS 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , macOS 12 . 0 , * ) // SQLite 3.35.0+
@@ -554,7 +554,7 @@ extension MutablePersistableRecord {
554
554
/// the conflict policy is `IGNORE`.
555
555
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
556
556
/// error thrown by the persistence callbacks defined by the record type,
557
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
557
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
558
558
/// primary key does not match any row in the database.
559
559
@inlinable // allow specialization so that empty callbacks are removed
560
560
@available ( iOS 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , macOS 12 . 0 , * ) // SQLite 3.35.0+
@@ -583,7 +583,7 @@ extension MutablePersistableRecord {
583
583
/// in case of a failed update due to the `IGNORE` conflict policy.
584
584
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
585
585
/// error thrown by the persistence callbacks defined by the record type,
586
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
586
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
587
587
/// primary key does not match any row in the database.
588
588
@inlinable // allow specialization so that empty callbacks are removed
589
589
@available ( iOS 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , macOS 12 . 0 , * ) // SQLite 3.35.0+
@@ -613,7 +613,7 @@ extension MutablePersistableRecord {
613
613
/// conflict policy.
614
614
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
615
615
/// error thrown by the persistence callbacks defined by the record type,
616
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
616
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
617
617
/// primary key does not match any row in the database.
618
618
@inlinable // allow specialization so that empty callbacks are removed
619
619
@available ( iOS 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , macOS 12 . 0 , * ) // SQLite 3.35.0+
@@ -658,7 +658,7 @@ extension MutablePersistableRecord {
658
658
/// - returns: The result of the `fetch` function.
659
659
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
660
660
/// error thrown by the persistence callbacks defined by the record type,
661
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
661
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
662
662
/// primary key does not match any row in the database.
663
663
/// - precondition: `selection` is not empty.
664
664
@inlinable // allow specialization so that empty callbacks are removed
@@ -720,7 +720,7 @@ extension MutablePersistableRecord {
720
720
/// - returns: The result of the `fetch` function.
721
721
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
722
722
/// error thrown by the persistence callbacks defined by the record type,
723
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
723
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
724
724
/// primary key does not match any row in the database.
725
725
/// - precondition: `selection` is not empty.
726
726
@inlinable // allow specialization so that empty callbacks are removed
@@ -764,7 +764,7 @@ extension MutablePersistableRecord {
764
764
/// - returns: The result of the `fetch` function.
765
765
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
766
766
/// error thrown by the persistence callbacks defined by the record type,
767
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
767
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
768
768
/// primary key does not match any row in the database.
769
769
/// - precondition: `selection` is not empty.
770
770
@inlinable // allow specialization so that empty callbacks are removed
@@ -800,7 +800,7 @@ extension MutablePersistableRecord {
800
800
/// - returns: The result of the `fetch` function.
801
801
/// - throws: A ``DatabaseError`` whenever an SQLite error occurs, or any
802
802
/// error thrown by the persistence callbacks defined by the record type,
803
- /// or ``PersistenceError /recordNotFound(databaseTableName:key:)`` if the
803
+ /// or ``RecordError /recordNotFound(databaseTableName:key:)`` if the
804
804
/// primary key does not match any row in the database.
805
805
/// - precondition: `selection` is not empty.
806
806
@inlinable // allow specialization so that empty callbacks are removed
@@ -942,12 +942,12 @@ extension MutablePersistableRecord {
942
942
returning: selection)
943
943
else {
944
944
// Nil primary key
945
- throw dao. makeRecordNotFoundError ( )
945
+ try dao. recordNotFound ( )
946
946
}
947
947
let returned = try fetch ( statement)
948
948
if db. changesCount == 0 {
949
949
// No row was updated
950
- throw dao. makeRecordNotFoundError ( )
950
+ try dao. recordNotFound ( )
951
951
}
952
952
let updated = PersistenceSuccess ( persistenceContainer: dao. persistenceContainer)
953
953
return ( updated, returned)
0 commit comments