File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -1173,28 +1173,9 @@ let published = posts.filter(published_at <= Date())
11731173
11741174### Binary Data
11751175
1176- Any object that can be encoded and decoded can be stored as a blob of data in SQL.
1177-
1178- We can create an `Data` bridge rather trivially.
1179-
1180- ``` swift
1181- extension Data: Value {
1182- class var declaredDatatype: String {
1183- return Blob.declaredDatatype
1184- }
1185- class func fromDatatypeValue (blobValue : Blob) -> Self {
1186- return self (bytes : blobValue.bytes , length : blobValue.length )
1187- }
1188- var datatypeValue: Blob {
1189- return Blob (bytes : bytes, length : length)
1190- }
1191- }
1192- ```
1193-
11941176We can bridge any type that can be initialized from and encoded to `Data`.
11951177
11961178``` swift
1197- // assumes Data conformance, above
11981179extension UIImage: Value {
11991180 public class var declaredDatatype: String {
12001181 return Blob.declaredDatatype
You can’t perform that action at this time.
0 commit comments