You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($version != $this->query('SELECT "version" from "sys/version";')->fetchColumn(0)) {
36
+
// reflection may take a while
37
+
set_time_limit(3600);
38
+
// update version data
39
+
$this->query('DELETE FROM "sys/version";');
40
+
$stmt = $this->pdo->prepare('INSERT into "sys/version" ("version") VALUES (?);');
41
+
$stmt->execute(array($version));
42
+
43
+
// update tables data
44
+
$this->query('DELETE FROM "sys/tables";');
45
+
$result = $this->query('SELECT "name", "type" FROM sqlite_master WHERE ("type" = \'table\' or "type" = \'view\') and name not like "sys/%" and name<>"sqlite_sequence";');
46
+
$tables = array();
47
+
foreach($resultas$row) {
48
+
$tables[] = $row['name'];
49
+
$stmt = $this->pdo->prepare('INSERT into "sys/tables" ("name", "type") VALUES (?, ?);');
@@ -42,6 +94,9 @@ private function getTablesSQL(): string
42
94
return'SELECT c.relname as "TABLE_NAME", c.relkind as "TABLE_TYPE" FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN (\'r\', \'v\') AND n.nspname <> \'pg_catalog\' AND n.nspname <> \'information_schema\' AND n.nspname !~ \'^pg_toast\' AND pg_catalog.pg_table_is_visible(c.oid) AND \'\' <> ? ORDER BY "TABLE_NAME";';
43
95
case'sqlsrv':
44
96
return'SELECT o.name as "TABLE_NAME", o.xtype as "TABLE_TYPE" FROM sysobjects o WHERE o.xtype IN (\'U\', \'V\') ORDER BY "TABLE_NAME"';
97
+
case'sqlite':
98
+
$this->createSqlLiteReflectionTables();
99
+
return'SELECT t.name as "TABLE_NAME", t.type as "TABLE_TYPE" FROM "sys/tables" t WHERE t.type IN (\'table\', \'view\') ORDER BY "TABLE_NAME"';
0 commit comments