Skip to content

Commit 07df335

Browse files
committed
No longer applies
1 parent d80a5ef commit 07df335

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

Documentation/Index.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
- [Custom Types](#custom-types)
5151
- [Date-Time Values](#date-time-values)
5252
- [Binary Data](#binary-data)
53-
- [Custom Type Caveats](#custom-type-caveats)
5453
- [Codable Types](#codable-types)
5554
- [Other Operators](#other-operators)
5655
- [Core SQLite Functions](#core-sqlite-functions)
@@ -1410,9 +1409,6 @@ through before serialization and deserialization (see [Building Type-Safe SQL
14101409
> directly map SQLite types to Swift types. **Do _not_** conform custom types
14111410
> to the `Binding` protocol.
14121411

1413-
Once extended, the type can be used [_almost_](#custom-type-caveats) wherever
1414-
typed expressions can be.
1415-
14161412

14171413
### Date-Time Values
14181414

@@ -1458,49 +1454,6 @@ extension UIImage: Value {
14581454

14591455
[Archives and Serializations Programming Guide]: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Archiving/Archiving.html
14601456

1461-
### Custom Type Caveats
1462-
1463-
Swift does _not_ currently support generic subscripting, which means we
1464-
cannot, by default, subscript Expressions with custom types to:
1465-
1466-
1. **Namespace expressions**. Use the `namespace` function, instead:
1467-
1468-
```swift
1469-
let avatar = Expression<UIImage?>("avatar")
1470-
users[avatar] // fails to compile
1471-
users.namespace(avatar) // "users"."avatar"
1472-
```
1473-
1474-
2. **Access column data**. Use the `get` function, instead:
1475-
1476-
```swift
1477-
let user = users.first!
1478-
user[avatar] // fails to compile
1479-
user.get(avatar) // UIImage?
1480-
```
1481-
1482-
We can, of course, write extensions, but they’re rather wordy.
1483-
1484-
```swift
1485-
extension Query {
1486-
subscript(column: Expression<UIImage>) -> Expression<UIImage> {
1487-
return namespace(column)
1488-
}
1489-
subscript(column: Expression<UIImage?>) -> Expression<UIImage?> {
1490-
return namespace(column)
1491-
}
1492-
}
1493-
1494-
extension Row {
1495-
subscript(column: Expression<UIImage>) -> UIImage {
1496-
return get(column)
1497-
}
1498-
subscript(column: Expression<UIImage?>) -> UIImage? {
1499-
return get(column)
1500-
}
1501-
}
1502-
```
1503-
15041457
## Codable Types
15051458

15061459
[Codable types][Encoding and Decoding Custom Types] were introduced as a part

0 commit comments

Comments
 (0)