mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
28 lines
959 B
Swift
28 lines
959 B
Swift
/**
|
|
When a type adopts both DatabaseValueConvertible and SQLiteStatementConvertible, it is granted
|
|
with faster access to the SQLite database values.
|
|
*/
|
|
public protocol SQLiteStatementConvertible {
|
|
|
|
/**
|
|
Returns an instance initialized from a raw SQLite statement pointer.
|
|
|
|
As an example, here is the how Int64 adopts SQLiteStatementConvertible:
|
|
|
|
extension Int64: SQLiteStatementConvertible {
|
|
public init(sqliteStatement: SQLiteStatement, index: Int32) {
|
|
self = sqlite3_column_int64(sqliteStatement, index)
|
|
}
|
|
}
|
|
|
|
Implement this method in an optimistic mind: don't check for NULL, don't
|
|
check for type mismatch.
|
|
|
|
See https://www.sqlite.org/c3ref/column_blob.html for more information.
|
|
|
|
- parameter sqliteStatement: A pointer to a SQLite statement.
|
|
- parameter index: The column index.
|
|
*/
|
|
init(sqliteStatement: SQLiteStatement, index: Int32)
|
|
}
|