Documentation

This commit is contained in:
Gwendal Roué committed 2016-12-08 18:41:16 +01:00
1 parent 9b6ec9ffd3
commit 9a0fa2f8b3
1 file changed
+2 -2
+2 -2
View File
@@ -3264,7 +3264,7 @@ protocol TypedRequest : Request {
}
```
The `prepare(_:)` function returns a tuple made of a [prepared statement](#prepared-statements) and an optional [row adapter](#row-adapters).
The `prepare(_:)` function returns a tuple made of a [prepared statement](#prepared-statements) and an optional [row adapter](#row-adapters). The prepared statement tells which SQL query should be executed. The row adapter can help *presenting* the fetched rows in the way expected by the row consumers (we'll see an example below).
A Request doesn't know what to fetch, but it can feed the [fetching methods](#fetching-methods) of any fetchable type ([row](#fetching-rows), [value](#value-queries), or [record](#records)):
@@ -3343,7 +3343,7 @@ You can now use the `someCustomRequest` method just like built-in requests from
try Person.someCustomRequest().fetchAll(db) // [Person]
```
Another example, which builds a JOIN request with a [row adapter](#row-adapters):
Another example which demonstrates a possible use case for [row adapters](#row-adapters):
```swift
struct BookAuthorPair : RowConvertible {