diff --git a/Sources/SQLite/Typed/Query.swift b/Sources/SQLite/Typed/Query.swift index c9d2ea9c..77ec10ee 100644 --- a/Sources/SQLite/Typed/Query.swift +++ b/Sources/SQLite/Typed/Query.swift @@ -1062,6 +1062,18 @@ public struct Row { return valueAtIndex(idx) } + /// Checks if the row has a value for the given column. + /// + /// - Parameter column: An expression representing a column selected in a Query. + /// + /// - Returns: True if the row has a value for the given column. + public func hasColumn(_ column: Expression) -> Bool { + return hasColumn(Expression(column)) + } + public func hasColumn(_ column: Expression) -> Bool { + return (columnNames[column.template] != nil) + } + // FIXME: rdar://problem/18673897 // subscript… public subscript(column: Expression) -> Blob {