alzalabany / sql-buddy

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

Sqlite version #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I found another problem with sqlite.
my sqlite extension is version 2.8.17 
But in PDO i have sqlite 3 and sqlite 2 support.
Now sqlite_libversion always returns 2.8.17 

But my database is sqlite3 =)

my sqlite connection code for sqlbuddy now:

        if ($this->adapter == "sqlite") {
            $this->method = "pdo";

            if (class_exists('PDO') && in_array('sqlite2',
PDO::getAvailableDrivers())) {
                // pdo_sqlite2 throw no exception on connect
                $this->conn = new PDO("sqlite2:" . $database, null, null,
array(PDO::ATTR_PERSISTENT => true));

            }
            if (is_null($this->conn) && class_exists('PDO') && in_array('sqlite',
PDO::getAvailableDrivers())) {
                try
                {
                    $this->conn = new PDO("sqlite:" . $database, null, null,
array(PDO::ATTR_PERSISTENT => true));
                }
                catch (PDOException $error) {
                    $this->conn = false;
                    $this->errorMessage = $error->getMessage();
                }   
            } elseif (is_null($this->conn)) {
                $this->method = "sqlite";
                $this->conn = sqlite_open($database, 0666, $sqliteError);
            }
        } else { ....

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

GoogleCodeExporter commented 9 years ago
Also strtolower in includes/browse.php on line 76 would be good =)

if (strpos(strtolower($column[1]), "primary key") > 0) {

Original comment by g.sch...@googlemail.com on 23 Oct 2008 at 4:31