summaryrefslogtreecommitdiff
path: root/framework/Data/Common/Sqlite/TSqliteMetaData.php
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2013-12-09 02:04:04 -0500
committerFabio Bas <ctrlaltca@gmail.com>2014-08-26 13:14:33 +0200
commit93792e60746f8d34fa675ba834ca36552f6016df (patch)
tree01052bbff4b2aafb8483e95bb8d8974dd7d1c164 /framework/Data/Common/Sqlite/TSqliteMetaData.php
parent6d4278bcaf8951e748ee08edd8db412588244217 (diff)
Support for all PRADO DB drivers!
Diffstat (limited to 'framework/Data/Common/Sqlite/TSqliteMetaData.php')
-rw-r--r--framework/Data/Common/Sqlite/TSqliteMetaData.php28
1 files changed, 11 insertions, 17 deletions
diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php
index 6c127f96..9bc345f3 100644
--- a/framework/Data/Common/Sqlite/TSqliteMetaData.php
+++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php
@@ -188,21 +188,15 @@ class TSqliteMetaData extends TDbMetaData
}
return false;
}
+
+ /**
+ * Returns all table names in the database.
+ * @param string $schema the schema of the tables. This is not used for sqlite database.
+ * @return array all table names in the database.
+ */
+ public function findTableNames($schema='')
+ {
+ $sql="SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name<>'sqlite_sequence'";
+ return $this->getDbConnection()->createCommand($sql)->queryColumn();
+ }
}
-
-/**
-
-CREATE TABLE foo
-(
- id INTEGER NOT NULL PRIMARY KEY,
- id2 CHAR(2)
-);
-
-CREATE TABLE bar
-(
- id INTEGER NOT NULL PRIMARY KEY,
- foo_id INTEGER
- CONSTRAINT fk_foo_id REFERENCES foo(id) ON DELETE CASCADE
-);
-*/
-