From e885d787cde65d9ab003426bf79047de57c83ebe Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 23 Sep 2006 20:25:05 +0000 Subject: --- system/drivers/DB_sqlite.php | 77 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) (limited to 'system/drivers/DB_sqlite.php') diff --git a/system/drivers/DB_sqlite.php b/system/drivers/DB_sqlite.php index 48e2c8714..6d7b4294a 100644 --- a/system/drivers/DB_sqlite.php +++ b/system/drivers/DB_sqlite.php @@ -98,7 +98,7 @@ class CI_DB_sqlite extends CI_DB { * @param string an SQL query * @return resource */ - function execute($sql) + function _execute($sql) { $sql = $this->_prep_query($sql); return @sqlite_query($this->conn_id, $sql); @@ -119,6 +119,81 @@ class CI_DB_sqlite extends CI_DB { { return $sql; } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('BEGIN TRANSACTION'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + return TRUE; + } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b