\CI_DB_sqlite_driver

SQLite Database Adapter Class

Note: _DB is an extender class that the app controller creates dynamically based on whether the active record class is being used or not.

Summary

Methods
Properties
Constants
db_connect()
db_pconnect()
reconnect()
db_select()
db_set_charset()
_version()
_execute()
_prep_query()
trans_begin()
trans_commit()
trans_rollback()
escape_str()
affected_rows()
insert_id()
count_all()
_list_tables()
_list_columns()
_field_data()
_error_message()
_error_number()
_escape_identifiers()
_from_tables()
_insert()
_update()
_truncate()
_delete()
_limit()
_close()
$dbdriver
$_escape_char
$_like_escape_str
$_like_escape_chr
$_count_string
$_random_keyword
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$dbdriver

$dbdriver : 

Type

$_escape_char

$_escape_char : 

Type

$_like_escape_str

$_like_escape_str : 

Type

$_like_escape_chr

$_like_escape_chr : 

Type

$_count_string

$_count_string : 

The syntax to count rows is slightly different across different database engines, so this string appears in each driver and is used for the count_all() and count_all_results() functions.

Type

$_random_keyword

$_random_keyword : 

Type

Methods

db_connect()

db_connect() : resource

Non-persistent database connection

Returns

resource

db_pconnect()

db_pconnect() : resource

Persistent database connection

Returns

resource

reconnect()

reconnect() : void

Reconnect

Keep / reestablish the db connection if no queries have been sent for a length of time exceeding the server's idle timeout

db_select()

db_select() : resource

Select the database

Returns

resource

db_set_charset()

db_set_charset(  $charset,   $collation) : resource

Set client character set

Parameters

$charset
$collation

Returns

resource

_version()

_version() : string

Version number query string

Returns

string

_execute()

_execute(  $sql) : resource

Execute the query

Parameters

$sql

Returns

resource

_prep_query()

_prep_query(  $sql) : string

Prep the query

If needed, each database adapter can prep the query string

Parameters

$sql

Returns

string

trans_begin()

trans_begin(  $test_mode = FALSE) : boolean

Begin Transaction

Parameters

$test_mode

Returns

boolean

trans_commit()

trans_commit() : boolean

Commit Transaction

Returns

boolean

trans_rollback()

trans_rollback() : boolean

Rollback Transaction

Returns

boolean

escape_str()

escape_str(  $str,   $like = FALSE) : string

Escape String

Parameters

$str
$like

Returns

string

affected_rows()

affected_rows() : integer

Affected Rows

Returns

integer

insert_id()

insert_id() : integer

Insert ID

Returns

integer

count_all()

count_all(  $table = '') : string

"Count All" query

Generates a platform-specific query string that counts all records in the specified database

Parameters

$table

Returns

string

_list_tables()

_list_tables(  $prefix_limit = FALSE) : string

List table query

Generates a platform-specific query string so that the table names can be fetched

Parameters

$prefix_limit

Returns

string

_list_columns()

_list_columns(  $table = '') : string

Show column query

Generates a platform-specific query string so that the column names can be fetched

Parameters

$table

Returns

string

_field_data()

_field_data(  $table) : object

Field data query

Generates a platform-specific query so that the column data can be retrieved

Parameters

$table

Returns

object

_error_message()

_error_message() : string

The error message string

Returns

string

_error_number()

_error_number() : integer

The error message number

Returns

integer

_escape_identifiers()

_escape_identifiers(  $item) : string

Escape the SQL Identifiers

This function escapes column and table names

Parameters

$item

Returns

string

_from_tables()

_from_tables(  $tables) : \type

From Tables

This function implicitly groups FROM tables so there is no confusion about operator precedence in harmony with SQL standards

Parameters

$tables

Returns

\type

_insert()

_insert(  $table,   $keys,   $values) : string

Insert statement

Generates a platform-specific insert string from the supplied data

Parameters

$table
$keys
$values

Returns

string

_update()

_update(  $table,   $values,   $where,   $orderby = array(),   $limit = FALSE) : string

Update statement

Generates a platform-specific update string from the supplied data

Parameters

$table
$values
$where
$orderby
$limit

Returns

string

_truncate()

_truncate(  $table) : string

Truncate statement

Generates a platform-specific truncate string from the supplied data If the database does not support the truncate() command This function maps to "DELETE FROM table"

Parameters

$table

Returns

string

_delete()

_delete(  $table,   $where = array(),   $like = array(),   $limit = FALSE) : string

Delete statement

Generates a platform-specific delete string from the supplied data

Parameters

$table
$where
$like
$limit

Returns

string

_limit()

_limit(  $sql,   $limit,   $offset) : string

Limit string

Generates a platform-specific LIMIT clause

Parameters

$sql
$limit
$offset

Returns

string

_close()

_close(  $conn_id) : void

Close DB Connection

Parameters

$conn_id