mirror of https://github.com/vapor/docs.git
.all() example
This commit is contained in:
parent
3528a0fba0
commit
81a8100140
|
|
@ -144,6 +144,12 @@ query.execute().then {
|
|||
If you simply want to fetch all of the results, you can use the `.all()` convenience.
|
||||
This will automatically create a stream and return a future containing your results.
|
||||
|
||||
```swift
|
||||
query.all().then { rows in
|
||||
print(rows)
|
||||
}
|
||||
```
|
||||
|
||||
#### Sync
|
||||
|
||||
For situations where blocking is appropriate (perhaps in tests) you can use `.sync()` to block
|
||||
|
|
|
|||
Loading…
Reference in New Issue