mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
README.md
This commit is contained in:
1 parent
81b56daedf
commit
344a5c068d
1 file changed
+6
-2
@@ -455,15 +455,19 @@ if let databaseValue = row["date"] {
|
||||
}
|
||||
```
|
||||
|
||||
Row adopts the CollectionType protocol: you can iterate all the tuples (columnName, databaseValue) in a row, from left to right:
|
||||
Row adopts the CollectionType protocol:
|
||||
|
||||
```swift
|
||||
// the number of columns
|
||||
row.count
|
||||
|
||||
// All the (columnName, databaseValue) tuples, from left to right:
|
||||
for (columnName, databaseValue) in row {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Rows are not real dictionaries, though. They may contain duplicate keys:
|
||||
Rows are not real dictionaries, though, since they may contain duplicate keys:
|
||||
|
||||
```swift
|
||||
let row = Row.fetchOne(db, "SELECT 1 AS foo, 2 AS foo")!
|
||||
|
||||
Reference in new issue
Block a user