SelectStatement
public final class SelectStatement : Statement
A subclass of Statement that fetches database rows.
You create SelectStatement with the Database.makeSelectStatement() method:
try dbQueue.inDatabase { db in
let statement = try db.makeSelectStatement("SELECT COUNT(*) FROM persons WHERE age > ?")
let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
}
-
Information about the table and columns read by a SelectStatement
Declaration
Swift
public private(set) var selectionInfo: SelectionInfo
-
The number of columns in the resulting rows.
Declaration
Swift
public lazy var columnCount: Int =
-
The column names, ordered from left to right.
Declaration
Swift
public lazy var columnNames: [String] =
-
Information about the table and columns read by a SelectStatement
See moreDeclaration
Swift
public struct SelectionInfo : CustomStringConvertible
-
Part of the RowLayout protocol.
Declaration
Swift
public var layoutColumns: [(Int, String)]
-
Part of the RowLayout protocol.
Declaration
Swift
public func layoutIndex(ofColumn name: String) -> Int?