mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
Non-generic Row.value(atIndex:) & Row.value(named:) return DatabaseValue?
This commit is contained in:
1 parent
34989c8d2a
commit
b2ae0b138e
1 file changed
+12
@@ -31,10 +31,22 @@ public struct Row {
|
||||
return impl.sqliteDictionary.indexForKey(name) != nil
|
||||
}
|
||||
|
||||
public func value(atIndex index: Int) -> DatabaseValue? {
|
||||
return impl.sqliteValueAtIndex(index).value()
|
||||
}
|
||||
|
||||
public func value<DatabaseValue: GRDB.DatabaseValue>(atIndex index: Int) -> DatabaseValue? {
|
||||
return impl.sqliteValueAtIndex(index).value() as DatabaseValue?
|
||||
}
|
||||
|
||||
public func value(named columnName: String) -> DatabaseValue? {
|
||||
if let index = impl.indexForColumnNamed(columnName) {
|
||||
return impl.sqliteValueAtIndex(index).value()
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
public func value<DatabaseValue: GRDB.DatabaseValue>(named columnName: String) -> DatabaseValue? {
|
||||
if let index = impl.indexForColumnNamed(columnName) {
|
||||
return impl.sqliteValueAtIndex(index).value() as DatabaseValue?
|
||||
|
||||
Reference in new issue
Block a user