     }
     
     
-    // MARK: UnsafeRowImpl
+    // MARK: - UnsafeRowImpl
     
     /// See Row.init(statement:unsafe:)
     private struct UnsafeRowImpl : RowImpl {

    
    - parameter sqliteDictionary: A dictionary of SQLiteValue.
    */
    public init(sqliteDictionary: [String: SQLiteValue]) {
        // IMPLEMENTATION NODE
        //
        // This initializer is used by RowModel.insert() so that it can call

*/
public struct Row: CollectionType {
    
    // MARK: - SQLiteValueConvertible value
    
    /**
    Returns the value at given index.
    
    Indexes span from 0 for the leftmost column to (row.count - 1) for the
    righmost column.
    
    If not nil (for NULL), its type is guaranteed to be one of the following:
    Int64, Double, String, and Blob.
    
        let value = row.value(atIndex: 0)
    
    - parameter index: The index of a column.
    - returns: An optional SQLiteValueConvertible.
    */
    public func value(atIndex index: Int) -> SQLiteValueConvertible? {
        return impl.sqliteValue(atIndex: index).value()
    }
    
    /**
    Returns the value at given index, converted to the requested type.
    
    Indexes span from 0 for the leftmost column to (row.count - 1) for the
    righmost column.
    
    The conversion returns nil if the fetched SQLite value is NULL, or can't be
    converted to the requested type:
    
        let value: Bool? = row.value(atIndex: 0)
        let value: Int? = row.value(atIndex: 0)
        let value: Double? = row.value(atIndex: 0)
    
    Your custom types that adopt the SQLiteValueConvertible protocol handle
    their own conversion from raw SQLite values. Yet, here is the reference for
    built-in types:
    
        SQLite value: | NULL    INTEGER         REAL            TEXT        BLOB
        --------------|---------------------------------------------------------
        Bool          | nil     false if 0      false if 0.0    nil         nil
        Int           | nil     Int(*)          Int(*)          nil         nil
        Int64         | nil     Int64           Int64(*)        nil         nil
        Double        | nil     Double          Double          nil         nil
        String        | nil     nil             nil             String      nil
        Blob          | nil     nil             nil             nil         Blob
    
    (*) Conversions to Int and Int64 crash if the value is too big.
    
    - parameter index: The index of a column.
    - returns: An optional *Value*.
    */
    public func value<Value: SQLiteValueConvertible>(atIndex index: Int) -> Value? {
        return impl.sqliteValue(atIndex: index).value()
    }
    
    /**
    Returns the value for the given column.
    
    If not nil (for NULL), its type is guaranteed to be one of the following:
    Int64, Double, String, and Blob.
    
        let value = row.value(named: "name")
    
    - parameter name: A column name.
    - returns: An optional SQLiteValueConvertible.
    */
    public func value(named columnName: String) -> SQLiteValueConvertible? {
        if let index = impl.indexForColumn(named: columnName) {
            return impl.sqliteValue(atIndex: index).value()
        } else {
            return nil
        }
    }
    
    /**
    Returns the value for the given column, converted to the requested type.
    
    The conversion returns nil if the fetched SQLite value is NULL, or can't be
    converted to the requested type:
    
        let value: Bool? = row.value(named: "count")
        let value: Int? = row.value(named: "count")
        let value: Double? = row.value(named: "count")
    
    Your custom types that adopt the SQLiteValueConvertible protocol handle
    their own conversion from raw SQLite values. Yet, here is the reference for
    built-in types:
    
        SQLite value: | NULL    INTEGER         REAL            TEXT        BLOB
        --------------|---------------------------------------------------------
        Bool          | nil     false if 0      false if 0.0    nil         nil
        Int           | nil     Int(*)          Int(*)          nil         nil
        Int64         | nil     Int64           Int64(*)        nil         nil
        Double        | nil     Double          Double          nil         nil
        String        | nil     nil             nil             String      nil
        Blob          | nil     nil             nil             nil         Blob
    
    (*) Conversions to Int and Int64 crash if the value is too big.
    
    - parameter name: A column name.
    - returns: An optional *Value*.
    */
    public func value<Value: SQLiteValueConvertible>(named columnName: String) -> Value? {
        if let index = impl.indexForColumn(named: columnName) {
            return impl.sqliteValue(atIndex: index).value()
        } else {
            return nil
        }
    }
    
    
    // MARK: - SQLiteValue
    
    /**
    Returns a SQLiteValue, the intermediate type between SQLite storage and your
    values, if and only if the row contains the requested column.
    
        // Test if the column `name` is present:
        if let sqliteValue = row["name"] {
            let name: String? = sqliteValue.value()
        }

    - parameter columnName: A column name.
    - returns: A SQLiteValue if the row contains the requested column.
    */
    public subscript(columnName: String) -> SQLiteValue? {
        if let index = impl.indexForColumn(named: columnName) {
            return impl.sqliteValue(atIndex: index)
        } else {
            return nil
        }
    }
    
    /**
    Row is a *collection* of (columnName, sqliteValue) pairs, ordered from left
    to right.

    Returns a *generator* over elements.
    */
    public func generate() -> IndexingGenerator<Row> {
        return IndexingGenerator(self)
    }
    
    /**
    Row is a *collection* of (columnName, sqliteValue) pairs, ordered from left
    to right.

    The index of the first element.
    */
    public var startIndex: RowIndex {
        return Index(0)
    }
    
    /**
    Row is a *collection* of (columnName, sqliteValue) pairs, ordered from left
    to right.

    Return the "past-the-end" index, successor of the index of the last element.
    */
    public var endIndex: RowIndex {
        return Index(impl.columnCount)
    }
    
    /**
    Row is a *collection* of (columnName, sqliteValue) pairs, ordered from left
    to right.
    
    Returns the element at given index.
    */
    public subscript(index: RowIndex) -> (String, SQLiteValue) {
        return (
            self.impl.columnName(atIndex: index.index),
            self.impl.sqliteValue(atIndex: index.index))
    }
    
    
    // MARK: - Not Public, dedicated to tests
    
    /**
    Builds a row from an dictionary of SQLite values.
    
