MetalType documentation

This commit is contained in:
Gwendal Roué committed 2015-09-24 08:29:39 +02:00
1 parent d61e59cf6f
commit b28f855bd4
1 file changed
+15 -2
+15 -2
View File
@@ -1,14 +1,27 @@
/**
TODO
When a type adopts both DatabaseValueConvertible and MetalType, it is granted
with faster access to the SQLite database values.
*/
public protocol MetalType {
/**
Returns an instance initialized from a raw SQLite statement pointer.
As an example, here is the how Int64 adopts MetalType:
extension Int64: MetalType {
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)
}