summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-27 11:15:47 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-27 11:15:47 +0200
commit5815dba069428514ce39e745328a898fc877773f (patch)
tree9ba5c1dc7bef0458c5f89e573f1b2acf05f3c688 /system/database/drivers/sqlite
parent9c9591c9b4a1d7ac412f7a85aeb5c92f50aa3490 (diff)
parentced2c9ab41450cb632c042730604111ec2a24e1f (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/sqlite')
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php32
-rw-r--r--system/database/drivers/sqlite/sqlite_forge.php38
-rw-r--r--system/database/drivers/sqlite/sqlite_result.php2
-rw-r--r--system/database/drivers/sqlite/sqlite_utility.php47
4 files changed, 9 insertions, 110 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 7936b6114..983b5fa58 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -29,7 +29,7 @@
* SQLite Database Adapter Class
*
* Note: _DB is an extender class that the app controller
- * creates dynamically based on whether the active record
+ * creates dynamically based on whether the query builder
* class is being used or not.
*
* @package CodeIgniter
@@ -410,36 +410,6 @@ class CI_DB_sqlite_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Delete statement
- *
- * Generates a platform-specific delete string from the supplied data
- *
- * @param string the table name
- * @param array the where clause
- * @param string the limit clause
- * @return string
- */
- protected function _delete($table, $where = array(), $like = array(), $limit = FALSE)
- {
- $conditions = '';
-
- if (count($where) > 0 OR count($like) > 0)
- {
- $conditions = "\nWHERE ".implode("\n", $this->ar_where);
-
- if (count($where) > 0 && count($like) > 0)
- {
- $conditions .= ' AND ';
- }
- $conditions .= implode("\n", $like);
- }
-
- return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit);
- }
-
- // --------------------------------------------------------------------
-
- /**
* Limit string
*
* Generates a platform-specific LIMIT clause
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index 70bb6a70b..ce8eac91e 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -40,7 +40,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
* @param string the database name
* @return bool
*/
- public function _create_database()
+ public function create_database($db_name = '')
{
// In SQLite, a database is created when you connect to the database.
// We'll return TRUE so that an error isn't generated
@@ -52,10 +52,10 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
/**
* Drop database
*
- * @param string the database name
+ * @param string the database name (ignored)
* @return bool
*/
- public function _drop_database($name)
+ public function drop_database($db_name = '')
{
if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database))
{
@@ -77,7 +77,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
* @param bool should 'IF NOT EXISTS' be added to the SQL
* @return bool
*/
- public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
+ protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
{
$sql = 'CREATE TABLE ';
@@ -147,18 +147,6 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
// --------------------------------------------------------------------
/**
- * Drop Table
- *
- * @return string
- */
- public function _drop_table($table)
- {
- return 'DROP TABLE '.$table.' IF EXISTS';
- }
-
- // --------------------------------------------------------------------
-
- /**
* Alter table query
*
* Generates a platform-specific query so that a table can be altered
@@ -173,7 +161,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
* @param string the field after which we should add the new field
* @return string
*/
- public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
+ protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
{
/* SQLite only supports adding new columns and it does
* NOT support the AFTER statement. Each new column will
@@ -192,22 +180,6 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
.(($null !== NULL && $default_value !== 'NULL') ? ' NOT NULL' : ' NULL');
}
- // --------------------------------------------------------------------
-
- /**
- * Rename a table
- *
- * Generates a platform-specific query so that a table can be renamed
- *
- * @param string the old table name
- * @param string the new table name
- * @return string
- */
- public function _rename_table($table_name, $new_table_name)
- {
- return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name);
- }
-
}
/* End of file sqlite_forge.php */
diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php
index 4af80abf7..741dc9d8d 100644
--- a/system/database/drivers/sqlite/sqlite_result.php
+++ b/system/database/drivers/sqlite/sqlite_result.php
@@ -112,7 +112,7 @@ class CI_DB_sqlite_result extends CI_DB_result {
* this internally before fetching results to make sure the
* result set starts at zero
*
- * @return array
+ * @return bool
*/
protected function _data_seek($n = 0)
{
diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php
index c07004c54..1bcb42d9f 100644
--- a/system/database/drivers/sqlite/sqlite_utility.php
+++ b/system/database/drivers/sqlite/sqlite_utility.php
@@ -34,50 +34,7 @@
*/
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
- *
- * @return bool
- */
- public function _list_databases()
- {
- return ($this->db_debug) ? $this->db->display_error('db_unsuported_feature') : FALSE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Optimize table query
- *
- * @param string the table name
- * @return bool
- */
- public function _optimize_table($table)
- {
- // Not supported
- return FALSE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Repair table query
- *
- * @param string the table name
- * @return bool
- */
- public function _repair_table($table)
- {
- // Not supported
- return FALSE;
- }
-
- // --------------------------------------------------------------------
+ protected $_list_databases = FALSE;
/**
* SQLite Export
@@ -85,7 +42,7 @@ class CI_DB_sqlite_utility extends CI_DB_utility {
* @param array Preferences
* @return mixed
*/
- public function _backup($params = array())
+ protected function _backup($params = array())
{
// Currently unsupported
return $this->db->display_error('db_unsuported_feature');