Public Member Functions | Protected Member Functions

SQLiteConnection Class Reference

Inheritance diagram for SQLiteConnection:
Collaboration diagram for SQLiteConnection:

List of all members.

Public Member Functions

 sql_t ($sql)
 replace_concat ($matches)
 connect ($connect_string, $db_user, $db_pass)
 dbdelta ($queries, $execute=true, $silent=true, $doinserts=false)
 execute_procedure ($procedure, $args=array())
 upgrade_pre ($old_version, $upgrade_path= '')
 upgrade_post ($old_version, $upgrade_path= '')

Protected Member Functions

 filter_fieldnames ($row)

Detailed Description

Definition at line 10 of file connection.php.


Member Function Documentation

SQLiteConnection::connect ( connect_string,
db_user,
db_pass 
)

Connect to SQLite Overrides the DatabaseConnection to return false if the SQLite file doesn't exist.

Parameters:
connection_string string a PDO connection string
db_user string the database user name
db_pass string the database user password
Returns:
boolean True if connection succeeded, false if not.

Reimplemented from DatabaseConnection.

Definition at line 59 of file connection.php.

SQLiteConnection::dbdelta ( queries,
execute = true,
silent = true,
doinserts = false 
)

automatic diffing function - used for determining required database upgrades based on Owen Winkler's microwiki upgrade function

Parameters:
queries array of create table and insert statements which constitute a fresh install
(optional) execute should the queries be executed against the database or just simulated. default = true
(optional) silent silent running with no messages printed? default = true
Returns:
string translated SQL string

Definition at line 88 of file connection.php.

SQLiteConnection::execute_procedure ( procedure,
args = array() 
)

Execute a stored procedure

Parameters:
procedure name of the stored procedure
args arguments for the procedure
Returns:
mixed whatever the procedure returns... Not supported with SQLite

Reimplemented from DatabaseConnection.

Definition at line 197 of file connection.php.

SQLiteConnection::filter_fieldnames ( row  )  [protected]

Filter out the fieldnames from whole pragma rows

Parameters:
\StdClass $row A row result from a SQLite PRAGMA table_info query
Returns:
string The name of the associated field

Definition at line 230 of file connection.php.

SQLiteConnection::replace_concat ( matches  ) 

Replaces the MySQL CONCAT function with SQLite-compatible statements

Todo:
needs work, kind of sucky conversion
Parameters:
array $matches Matches from the regex in sql_t()
Returns:
string The replacement for the MySQL SQL
See also:
SQLiteConnection::sql_t()

Definition at line 44 of file connection.php.

SQLiteConnection::sql_t ( sql  ) 

database specific SQL translation function, loosely modelled on the internationalization _t() function Call with a database independent SQL string and it will be translated to a SQLite specific SQL string

Parameters:
sql database independent SQL
Returns:
string translated SQL string

Reimplemented from DatabaseConnection.

Definition at line 21 of file connection.php.

SQLiteConnection::upgrade_post ( old_version,
upgrade_path = '' 
)

Run all of the upgrades slated for post-dbdelta since the last database revision.

Parameters:
integer $old_version The current version of the database that is being upgraded
Returns:
boolean True on success

Definition at line 219 of file connection.php.

SQLiteConnection::upgrade_pre ( old_version,
upgrade_path = '' 
)

Run all of the upgrades slated for pre-dbdelta since the last database revision.

Parameters:
integer $old_version The current version of the database that is being upgraded
Returns:
boolean True on success

Definition at line 208 of file connection.php.


The documentation for this class was generated from the following file: