summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlite3
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-04-09 15:14:20 +0200
committerAndrey Andreev <narf@bofh.bg>2012-04-09 15:14:20 +0200
commitb8949fab60082e17f219fc89c6c8a85d3ff73f19 (patch)
tree276943a51e282d0d684304048ada830b55f9fb2e /system/database/drivers/sqlite3
parent00aed0d9015040764fb7fe8edb7452459fc19213 (diff)
parentb457a4001ce2380e97f36b0a983b477c3e31de69 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/sqlite3')
-rw-r--r--system/database/drivers/sqlite3/sqlite3_driver.php29
-rw-r--r--system/database/drivers/sqlite3/sqlite3_forge.php48
-rw-r--r--system/database/drivers/sqlite3/sqlite3_result.php10
-rw-r--r--system/database/drivers/sqlite3/sqlite3_utility.php63
4 files changed, 22 insertions, 128 deletions
diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php
index 12354e1bc..49cfbe7ec 100644
--- a/system/database/drivers/sqlite3/sqlite3_driver.php
+++ b/system/database/drivers/sqlite3/sqlite3_driver.php
@@ -398,35 +398,6 @@ class CI_DB_sqlite3_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/sqlite3/sqlite3_forge.php b/system/database/drivers/sqlite3/sqlite3_forge.php
index 3a2060c3b..20f1e6f63 100644
--- a/system/database/drivers/sqlite3/sqlite3_forge.php
+++ b/system/database/drivers/sqlite3/sqlite3_forge.php
@@ -16,12 +16,12 @@
* through the world wide web, please send an email to
* licensing@ellislab.com so we can send you a copy immediately.
*
- * @package CodeIgniter
- * @author EllisLab Dev Team
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
- * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
- * @link http://codeigniter.com
- * @since Version 1.0
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
* @filesource
*/
@@ -40,7 +40,7 @@ class CI_DB_sqlite3_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_sqlite3_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 = '')
{
// In SQLite, a database is dropped when we delete a file
if (@file_exists($this->db->database))
@@ -85,7 +85,7 @@ class CI_DB_sqlite3_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 ';
@@ -156,19 +156,6 @@ class CI_DB_sqlite3_forge extends CI_DB_forge {
// --------------------------------------------------------------------
/**
- * Drop Table
- *
- * @param string the table name
- * @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
@@ -183,7 +170,7 @@ class CI_DB_sqlite3_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
@@ -202,21 +189,6 @@ class CI_DB_sqlite3_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 sqlite3_forge.php */
diff --git a/system/database/drivers/sqlite3/sqlite3_result.php b/system/database/drivers/sqlite3/sqlite3_result.php
index ddf59dbd0..64482e379 100644
--- a/system/database/drivers/sqlite3/sqlite3_result.php
+++ b/system/database/drivers/sqlite3/sqlite3_result.php
@@ -16,12 +16,12 @@
* through the world wide web, please send an email to
* licensing@ellislab.com so we can send you a copy immediately.
*
- * @package CodeIgniter
- * @author EllisLab Dev Team
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
- * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
- * @link http://codeigniter.com
- * @since Version 1.0
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
* @filesource
*/
diff --git a/system/database/drivers/sqlite3/sqlite3_utility.php b/system/database/drivers/sqlite3/sqlite3_utility.php
index a4dc875e1..965c838e5 100644
--- a/system/database/drivers/sqlite3/sqlite3_utility.php
+++ b/system/database/drivers/sqlite3/sqlite3_utility.php
@@ -16,12 +16,12 @@
* through the world wide web, please send an email to
* licensing@ellislab.com so we can send you a copy immediately.
*
- * @package CodeIgniter
- * @author EllisLab Dev Team
+ * @package CodeIgniter
+ * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
- * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
- * @link http://codeigniter.com
- * @since Version 1.0
+ * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * @link http://codeigniter.com
+ * @since Version 1.0
* @filesource
*/
@@ -34,56 +34,7 @@
*/
class CI_DB_sqlite3_utility extends CI_DB_utility {
- /**
- * List databases
- *
- * @return bool
- */
- public function _list_databases()
- {
- // Not supported
- return FALSE;
-
- // Do we use this?
- if ($this->db_debug)
- {
- return $this->db->display_error('db_unsuported_feature');
- }
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Optimize table query
- *
- * Is optimization even supported in SQLite?
- *
- * @param string the table name
- * @return bool
- */
- public function _optimize_table($table)
- {
- // Not supported
- return FALSE;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Repair table query
- *
- * Are table repairs even supported in SQLite?
- *
- * @param string the table name
- * @return object
- */
- public function _repair_table($table)
- {
- // Not supported
- return FALSE;
- }
-
- // --------------------------------------------------------------------
+ protected $_list_databases = FALSE;
/**
* SQLite Export
@@ -91,7 +42,7 @@ class CI_DB_sqlite3_utility extends CI_DB_utility {
* @param array Preferences
* @return mixed
*/
- public function _backup($params = array())
+ protected function _backup($params = array())
{
// Not supported
return $this->db->display_error('db_unsuported_feature');