ColumnConvertible
public protocol ColumnConvertible
A type that can be initialized directly from a column in an SQLite result row.
The implementation should use one of the sqlite_column_X() functions documented at Result Values From A Query.
For example, the implementation for Int64 is:
extension Int64: ColumnConvertible {
public init(_ stmt: SQLitePreparedStatement, column idx: Int32) {
self = sqlite3_column_int64(stmt, idx)
}
}
-
Creates an instance containing the value of column
idxinstmt.Note
Column indexes are 0-based. The leftmost column in a row has index 0.
Precondition
sqlite3_column_type(stmt, idx) != SQLITE_NULLThrows
An error if initialization fails
Declaration
Swift
init(_ stmt: SQLitePreparedStatement, column idx: Int32) throwsParameters
stmtAn
sqlite3_stmt *objectidxThe index of the desired column
View on GitHub
ColumnConvertible Protocol Reference