1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Improve speed of CSV import

This commit is contained in:
Jakub Vrana
2013-07-09 11:34:12 -07:00
parent 9de402aaf0
commit 56b0917acd
8 changed files with 74 additions and 37 deletions

View File

@@ -208,8 +208,12 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
class Min_Driver extends Min_SQL {
function insertUpdate($table, $set, $primary) {
return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")");
function insertUpdate($table, $rows, $primary) {
$values = array();
foreach ($rows as $set) {
$values[] = "(" . implode(", ", $set) . ")";
}
return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys(reset($rows))) . ") VALUES\n" . implode(",\n", $values));
}
}