]> git.nbdom.net Git - nb.git/commitdiff
Add view for sqlite
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 1 Mar 2016 21:25:40 +0000 (21:25 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 1 Mar 2016 21:25:40 +0000 (21:25 +0000)
lib/php/db.php

index 287912061e3d76a966db8beea3a15abd7559790f..6d2c042856fc1f0603810f4ace49e7155f6691c9 100644 (file)
@@ -213,7 +213,7 @@ class db extends nb {
     if (isset($this->_tables) and $this->_tables) return $this->_tables;
 
     if ($this->type == 'sqlite') {
-      $sql = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' ORDER BY name";
+      $sql = "SELECT name FROM sqlite_master WHERE type IN('table','view') AND name NOT LIKE 'sqlite_%' ORDER BY name";
 
     } elseif ($this->type == 'pgsql') {
       $sql = "SELECT table_name FROM information_schema.tables WHERE table_type in('BASE TABLE','VIEW') AND table_schema NOT IN ('pg_catalog', 'information_schema')";