Skip to content

Commit e191c7d

Browse files
committed
Add failableNext() example to playground
1 parent 84a8788 commit e191c7d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

SQLite.playground/Contents.swift

+10
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ for user in try Array(rowIterator) {
5454
let mapRowIterator = try db.prepareRowIterator(users)
5555
let userIds = try mapRowIterator.map { $0[id] }
5656

57+
/// using `failableNext()` on `RowIterator`
58+
let iterator = try db.prepareRowIterator(users)
59+
do {
60+
while let row = try rowIterator.failableNext() {
61+
print(row)
62+
}
63+
} catch {
64+
// Handle error
65+
}
66+
5767
/// define a virtual tabe for the FTS index
5868
let emails = VirtualTable("emails")
5969

0 commit comments

Comments
 (0)