]> git.joonet.de Git - adminer.git/commitdiff
SQLite: vacuum
authorJakub Vrana <jakubv@fb.com>
Wed, 29 Feb 2012 18:49:17 +0000 (10:49 -0800)
committerJakub Vrana <jakubv@fb.com>
Wed, 29 Feb 2012 18:49:17 +0000 (10:49 -0800)
adminer/db.inc.php
adminer/lang/cs.inc.php
changes.txt

index 24c587f4a78aaa1d714c8b4c03a12acb2eda1347..76223f4ac79b0524b1230eea35d814e206348c8e 100644 (file)
@@ -26,6 +26,9 @@ if ($tables_views && !$error && !$_POST["search"]) {
                        $result = drop_tables($_POST["tables"]);
                }
                $message = lang('Tables have been dropped.');
+       } elseif ($jush == "sqlite") {
+               $result = queries("VACUUM");
+               $message = lang('Tables have been optimized.');
        } elseif ($_POST["tables"] && ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"]))))) {
                while ($row = $result->fetch_assoc()) {
                        $message .= "<b>" . h($row["Table"]) . "</b>: " . h($row["Msg_text"]) . "<br>";
@@ -91,7 +94,10 @@ if ($adminer->homepage()) {
                        echo "</table>\n";
                        echo "<script type='text/javascript'>tableCheck();</script>\n";
                        if (!information_schema(DB)) {
-                               echo "<p>" . ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm("formChecked(this, /tables/)") . "> <input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /tables|views/)", 1) . ">\n"; // 1 - eventStop
+                               echo "<p>" . (ereg('^(sql|sqlite)$', $jush)
+                                       ? ($jush != "sqlite" ? "<input type='submit' value='" . lang('Analyze') . "'> " : "")
+                                       . "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " : ""
+                               ) . ($jush == "sql" ? "<input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm("formChecked(this, /tables/)") . "> <input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /tables|views/)", 1) . ">\n"; // 1 - eventStop
                                $databases = (support("scheme") ? schemas() : $adminer->databases());
                                if (count($databases) != 1 && $jush != "sqlite") {
                                        $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
index 2845fec564990843b40d1d46048ea121607b9f70..f903913f67e3a6085aea43f8bdf29eeb175f7b33 100644 (file)
@@ -147,6 +147,7 @@ $translations = array(
        'Create new table' => 'Vytvořit novou tabulku',
        'Table has been dropped.' => 'Tabulka byla odstraněna.',
        'Tables have been dropped.' => 'Tabulky byly odstraněny.',
+       'Tables have been optimized.' => 'Tabulky byly optimalizovány.',
        'Table has been altered.' => 'Tabulka byla změněna.',
        'Table has been created.' => 'Tabulka byla vytvořena.',
        'Table name' => 'Název tabulky',
index 8c61fb38869cf99bbb4d9b7b2bcb6c3853c8185d..35cb4732407291f9d8c44000351554c5280d95d5 100644 (file)
@@ -11,6 +11,7 @@ Don't quote bit type in export
 Ability to disable export (customization)
 Extensible list of databases (customization)
 MySQL: set autocommit after connect
+SQLite: vacuum
 PostgreSQL: fix alter foreign key
 PostgreSQL, SQLite: don't use LIKE for numbers (bug #3420408)
 PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619)