summaryrefslogtreecommitdiff
path: root/framework/Data/Common/Sqlite
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2013-12-09 02:04:04 -0500
committerDaniel <darthdaniel85@gmail.com>2013-12-09 02:04:04 -0500
commit4312f846098706c19576a4438704a5f22eb2d32d (patch)
tree012d2c682821d23c56a3804aa8eeddbc5584c694 /framework/Data/Common/Sqlite
parente04fb5c765252593fb88fb56eaefbdc88bbeb7d1 (diff)
Support for all PRADO DB drivers!
Diffstat (limited to 'framework/Data/Common/Sqlite')
-rw-r--r--framework/Data/Common/Sqlite/TSqliteMetaData.php30
1 files changed, 12 insertions, 18 deletions
diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php
index 3d789500..c66825c7 100644
--- a/framework/Data/Common/Sqlite/TSqliteMetaData.php
+++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php
@@ -190,21 +190,15 @@ class TSqliteMetaData extends TDbMetaData
}
return false;
}
-}
-
-/**
-
-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
-);
-*/
-
+
+ /**
+ * 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();
+ }
+} \ No newline at end of file