diff --git a/GRDB/Core/Blob.swift b/GRDB/Core/Blob.swift index b514ba754..f80cd1541 100644 --- a/GRDB/Core/Blob.swift +++ b/GRDB/Core/Blob.swift @@ -71,8 +71,14 @@ public final class Blob : Equatable { /// Blob adopts DatabaseValueConvertible and MetalType. extension Blob : DatabaseValueConvertible, MetalType { - /// Metal Blob does not copy, does not take ownership of statement bytes. + /** + Returns an instance initialized from a raw SQLite statement pointer. + + - parameter sqliteStatement: A pointer to a SQLite statement. + - parameter index: The column index. + */ public convenience init(sqliteStatement: SQLiteStatement, index: Int32) { + // Metal Blob does not copy and does not take ownership of the statement bytes. let bytes = sqlite3_column_blob(sqliteStatement, index) let length = sqlite3_column_bytes(sqliteStatement, index) self.init(bytesNoCopy: bytes, length: Int(length), freeWhenDone: false)! diff --git a/GRDB/Core/Protocols/MetalType.swift b/GRDB/Core/Protocols/MetalType.swift index 37f070e23..98cb67763 100644 --- a/GRDB/Core/Protocols/MetalType.swift +++ b/GRDB/Core/Protocols/MetalType.swift @@ -1,3 +1,14 @@ +/** +TODO +*/ public protocol MetalType { + + /** + Returns an instance initialized from a raw SQLite statement pointer. + + - parameter sqliteStatement: A pointer to a SQLite statement. + - parameter index: The column index. + */ init(sqliteStatement: SQLiteStatement, index: Int32) + }