     var lastErrorMessage: String? { return String.fromCString(sqlite3_errmsg(sqliteConnection)) }
     
     private var columnInfosCache: [String: [ColumnInfo]] = [:]
+    private var primaryKeyCache: [String: PrimaryKey] = [:]
     private var updateStatementCache: [String: UpdateStatement] = [:]
     private var selectStatementCache: [String: SelectStatement] = [:]
     

            // We ignore the exception, and consider all INTEGER primary keys as
            // aliases for the rowid:
            if pkColumnInfo.type.uppercaseString == "INTEGER" {
                return .Managed(pkColumnInfo.name)
            } else {
                return .Unmanaged([pkColumnInfo.name])
            }
        default:
            // Multi-columns primary key
            return .Unmanaged(pkColumnInfos.map { $0.name })
        }
    }
    
    // CREATE TABLE persons (

    private func columnInfos(tableName: String) -> [ColumnInfo] {
        if let columnInfos = columnInfosCache[tableName] {
            return columnInfos
        }
        
        let columnInfos = ColumnInfo.fetchAll(self, "PRAGMA table_info(\(tableName.quotedDatabaseIdentifier))")
        columnInfosCache[tableName] = columnInfos
        return columnInfos
    }
    
    
