     }
 
     public func statementAdapter(with statement: SelectStatement) throws -> StatementAdapter {
-        return StatementMapping(columnBaseIndexes: statement.columnNames.suffixFrom(index).enumerate().map { ($0 + index, $1) })
+        return StatementMapping(columns: statement.columnNames.suffixFrom(index).enumerate().map { ($0 + index, $1) })
     }
 }
 

                return (index, mappedColumn)
            }
            .sort { return $0.0 < $1.0 }
        return StatementMapping(columnBaseIndexes: columnBaseIndexes)
    }
}


#endif

public struct StatementMapping {
    let columns: [(Int, String)]      // [(baseRowIndex, mappedColumn), ...]
    let lowercaseColumnIndexes: [String: Int]   // [mappedColumn: adaptedRowIndex]

    public init(columns: [(Int, String)]) {
        self.columns = columns
        self.lowercaseColumnIndexes = Dictionary(keyValueSequence: columns.enumerate().map { ($1.1.lowercaseString, $0) }.reverse())
    }

    var count: Int {
        return columns.count
    }

    func baseColumIndex(adaptedIndex index: Int) -> Int {
        return columns[index].0
    }

    func columnName(adaptedIndex index: Int) -> String {
        return columns[index].1
    }

    func adaptedIndexOfColumn(named name: String) -> Int? {
