StatementColumnConvertible

public protocol StatementColumnConvertible

When a type adopts both DatabaseValueConvertible and StatementColumnConvertible, it is granted with faster access to the SQLite database values.

  • Returns a value initialized from a raw SQLite statement pointer.

    As an example, here is the how Int64 adopts StatementColumnConvertible:

    extension Int64: StatementColumnConvertible {
        public init(sqliteStatement: SQLiteStatement, index: Int32) {
            self = sqlite3_column_int64(sqliteStatement, index)
        }
    }
    

    When you implement this method, don’t check for NULL.

    See https://www.sqlite.org/c3ref/column_blob.html for more information.

    Declaration

    Swift

    init(sqliteStatement: SQLiteStatement, index: Int32)

    Parameters

    sqliteStatement

    A pointer to an SQLite statement.

    index

    The column index.