@@ -756,7 +756,7 @@ for user in try db.prepare(users) {
756
756
promise to the compiler that they’ll never be ` NULL` ), while ` Expression<T?>`
757
757
values remain wrapped.
758
758
759
- ⚠ Column subscripts on ` Row` will force try and abort execution in error cases
759
+ ⚠ Column subscripts on ` Row` will force try and abort execution in error cases.
760
760
If you want to handle this yourself, use ` Row.get(_ column: Expression<V>)` :
761
761
762
762
` ` ` swift
@@ -1464,10 +1464,10 @@ the insertion, updating, and retrieval of basic Codable types.
1464
1464
1465
1465
# ## Inserting Codable Types
1466
1466
1467
- Queries have a method to allow inserting an Encodable type.
1467
+ Queries have a method to allow inserting an [ Encodable ][] type.
1468
1468
1469
1469
` ` ` swift
1470
- struct User: Codable {
1470
+ struct User: Encodable {
1471
1471
let name: String
1472
1472
}
1473
1473
try db.run(users.insert(User(name: "test")))
@@ -1482,6 +1482,8 @@ There are two other parameters also available to this method:
1482
1482
- ` otherSetters` allows you to specify additional setters on top of those
1483
1483
that are generated from the encodable types themselves.
1484
1484
1485
+ [Encodable ]: https: / /developer.apple.com/ documentation/ swift/ encodable
1486
+
1485
1487
# ## Updating Codable Types
1486
1488
1487
1489
Queries have a method to allow updating an Encodable type.
@@ -1504,7 +1506,7 @@ There are two other parameters also available to this method:
1504
1506
1505
1507
# ## Retrieving Codable Types
1506
1508
1507
- Rows have a method to decode a Decodable type.
1509
+ Rows have a method to decode a [ Decodable ][] type.
1508
1510
1509
1511
` ` ` swift
1510
1512
let loadedUsers: [User] = try db.prepare(users).map { row in
@@ -1548,6 +1550,8 @@ Both of the above methods also have the following optional parameter:
1548
1550
- ` userInfo` is a dictionary that is passed to the decoder and made available
1549
1551
to decodable types to allow customizing their behavior.
1550
1552
1553
+ [Decodable ]: https: / /developer.apple.com/ documentation/ swift/ decodable
1554
+
1551
1555
# ## Restrictions
1552
1556
1553
1557
There are a few restrictions on using Codable types:
0 commit comments