diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-20 14:40:56 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-20 14:40:56 +0100 |
commit | 84a3b25b11da0f5b69c9a128cd79b98bfb70dc30 (patch) | |
tree | a5fd16fe0ae7b0ab3e8ee9a56683da7c3cc7225a /system/database/drivers/pdo/pdo_driver.php | |
parent | 75124a53cf54f2a8c094756f9189be9159957f28 (diff) | |
parent | 820999cb0d82c80d6dc5dde133568812c8113e29 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-helpers-sst
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r-- | system/database/drivers/pdo/pdo_driver.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 09764779a..658a3d5a0 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -561,6 +561,11 @@ class CI_DB_pdo_driver extends CI_DB { // Analog function to show all tables in postgre $sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"; } + elseif ($this->pdodriver == 'sqlite') + { + // Analog function to show all tables in sqlite + $sql = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'"; + } else { $sql = "SHOW TABLES FROM `".$this->database."`"; @@ -603,6 +608,22 @@ class CI_DB_pdo_driver extends CI_DB { */ function _field_data($table) { + if ($this->pdodriver == 'mysql' or $this->pdodriver == 'pgsql') + { + // Analog function for mysql and postgre + return 'SELECT * FROM '.$this->_from_tables($table).' LIMIT 1'; + } + elseif ($this->pdodriver == 'oci') + { + // Analog function for oci + return 'SELECT * FROM '.$this->_from_tables($table).' WHERE ROWNUM <= 1'; + } + elseif ($this->pdodriver == 'sqlite') + { + // Analog function for sqlite + return 'PRAGMA table_info('.$this->_from_tables($table).')'; + } + return 'SELECT TOP 1 FROM '.$this->_from_tables($table); } |