alzalabany / sql-buddy

Automatically exported from code.google.com/p/sql-buddy
MIT License
0 stars 0 forks source link

Sqlite brings up JS error #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Choose Sqlite
type in your db (here: test.db)
then Submit

JS errors appear:
syntax error
var menujson = {"menu": [{"name": "test.db","items": ]}]}; //-->\n
Line 69

here is a patch:
--- Sql.php.orig 2008-10-23 16:26:30.000000000 +0000
+++ Sql.php  2008-10-23 16:26:43.000000000 +0000
@@ -463,7 +463,7 @@
                $output .= '{"name": "' . $this->db . '"';

                $tableSql = $this->listTables();
-               if ($tableSql) {
+               if ($tableSql->rowCount() > 0) {
                    $output .= ',"items": [';
                    while ($tableRow = $this->fetchArray($tableSql)) {
                        $countSql = $this->query("SELECT COUNT(*) AS 'RowCount' FROM '" .
$tableRow[0] . "'");

Original issue reported on code.google.com by g.sch...@googlemail.com on 23 Oct 2008 at 2:28

GoogleCodeExporter commented 9 years ago
Only happens if you dont have any tables in your sqlite db

Original comment by g.sch...@googlemail.com on 23 Oct 2008 at 2:28