             return nil
         }
         
+        let primaryKey: PrimaryKey
         let pkColumnInfos = columnInfos
             .filter { $0.primaryKeyIndex > 0 }
             .sort { $0.primaryKeyIndex < $1.primaryKeyIndex }

        switch pkColumnInfos.count {
        case 0:
            // No primary key column
            return PrimaryKey.None
        case 1:
            // Single column
            let pkColumnInfo = pkColumnInfos.first!

    func cachedSelectStatement(sql: String) throws -> SelectStatement {
        if let statement = selectStatementCache[sql] {
            return statement
        }
        
        let statement = try selectStatement(sql)
        selectStatementCache[sql] = statement
        return statement
    }
    
    
