summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/sqlite')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php39
-rw-r--r--system/database/drivers/sqlite/sqlite_utility.php46
2 files changed, 42 insertions, 43 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 45dd7a892..f57c4b8c8 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -278,7 +278,44 @@ class CI_DB_sqlite_driver extends CI_DB {
$row = $query->row();
return $row->numrows;
}
-
+
+ // --------------------------------------------------------------------
+
+ /**
+ * List databases
+ *
+ * I don't believe you can do a database listing with SQLite
+ * since each database is its own file. I suppose we could
+ * try reading a directory looking for SQLite files, but
+ * that doesn't seem like a terribly good idea
+ *
+ * @access private
+ * @return bool
+ */
+ function _list_databases()
+ {
+ if ($this->db_debug)
+ {
+ return $this->display_error('db_unsuported_feature');
+ }
+ return array();
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * List table query
+ *
+ * Generates a platform-specific query string so that the table names can be fetched
+ *
+ * @access private
+ * @return string
+ */
+ function _list_tables()
+ {
+ return "SELECT name from sqlite_master WHERE type='table'";
+ }
+
// --------------------------------------------------------------------
/**
diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php
index ae241db87..801660d94 100644
--- a/system/database/drivers/sqlite/sqlite_utility.php
+++ b/system/database/drivers/sqlite/sqlite_utility.php
@@ -52,9 +52,9 @@ class CI_DB_sqlite_utility extends CI_DB_utility {
{
if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database))
{
- if ($this->db_debug)
+ if ($this->db->db_debug)
{
- return $this->display_error('db_unable_to_drop');
+ return $this->db->display_error('db_unable_to_drop');
}
return FALSE;
}
@@ -64,44 +64,6 @@ class CI_DB_sqlite_utility extends CI_DB_utility {
// --------------------------------------------------------------------
/**
- * List databases
- *
- * I don't believe you can do a database listing with SQLite
- * since each database is its own file. I suppose we could
- * try reading a directory looking for SQLite files, but
- * that doesn't seem like a terribly good idea
- *
- * @access private
- * @return bool
- */
- function _list_databases()
- {
-
- if ($this->db_debug)
- {
- return $this->display_error('db_unsuported_feature');
- }
- return array();
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Show table query
- *
- * Generates a platform-specific query string so that the table names can be fetched
- *
- * @access private
- * @return string
- */
- function _list_tables()
- {
- return "SELECT name from sqlite_master WHERE type='table'";
- }
-
- // --------------------------------------------------------------------
-
- /**
* Drop Table
*
* Unsupported feature in SQLite
@@ -111,9 +73,9 @@ class CI_DB_sqlite_utility extends CI_DB_utility {
*/
function _drop_table($table)
{
- if ($this->db_debug)
+ if ($this->db->db_debug)
{
- return $this->display_error('db_unsuported_feature');
+ return $this->db->display_error('db_unsuported_feature');
}
return array();
}