summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/pdo_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-20 14:43:15 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-20 14:43:15 +0100
commit870ad190f068ec16aad45622528ba6747c61c120 (patch)
tree5187330ec54e46fdd251d95a0212cf3fb7744b5b /system/database/drivers/pdo/pdo_driver.php
parent996c9fee5a53443de34240c41c3936c3527aa3ce (diff)
parent733921ecc4da80f08a9d50ff0fb05bccf23de09d (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index c8732ac3c..9b44e7c64 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -2,7 +2,7 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 5.1.6 or newer
+ * An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
*
@@ -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);
}
@@ -921,4 +942,4 @@ class CI_DB_pdo_driver extends CI_DB {
}
/* End of file pdo_driver.php */
-/* Location: ./system/database/drivers/pdo/pdo_driver.php */
+/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file