Skip to content

Commit 1a50a03

Browse files
author
JIm Boyd
committed
Updates to documentation
1 parent ef2257a commit 1a50a03

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Documentation/Index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,6 +1963,14 @@ using the following functions.
19631963
}
19641964
}
19651965
```
1966+
Statements with results may be iterated over, using a `RowIterator` if
1967+
useful.
1968+
1969+
```swift
1970+
let emailColumn = Expression<String>("email")
1971+
let stmt = try db.prepare("SELECT id, email FROM users")
1972+
let emails = try! stmt.prepareRowIterator().map { $0[emailColumn] }
1973+
```
19661974

19671975
- `run` prepares a single `Statement` object from a SQL string, optionally
19681976
binds values to it (using the statement’s `bind` function), executes,

0 commit comments

Comments
 (0)