dibi
class dibi
This class is static container class for creating DB objects and store connections info.
Constants
AFFECTED_ROWS |
|
IDENTIFIER |
|
VERSION |
version |
REVISION |
version |
ASC |
sorting order |
DESC |
sorting order |
deprecated TEXT |
|
deprecated BINARY |
|
deprecated BOOL |
|
deprecated INTEGER |
|
deprecated FLOAT |
|
deprecated DATE |
|
deprecated DATETIME |
|
deprecated TIME |
|
deprecated FIELD_TEXT |
|
deprecated FIELD_BINARY |
|
deprecated FIELD_BOOL |
|
deprecated FIELD_INTEGER |
|
deprecated FIELD_FLOAT |
|
deprecated FIELD_DATE |
|
deprecated FIELD_DATETIME |
|
deprecated FIELD_TIME |
|
Properties
static string | $sql | ||
static int | $elapsedTime | ||
static int | $totalTime | ||
static int | $numOfQueries | ||
static string | $defaultDriver |
Methods
Static class - cannot be instantiated.
Creates a new Connection object and connects it to specified database.
Disconnects from database (doesn't destroy Connection object).
Returns TRUE when connection was established.
Retrieve active connection.
Generates and executes SQL query - Monostate for Dibi\Connection::query().
Executes the SQL query - Monostate for Dibi\Connection::nativeQuery().
Generates and prints SQL query - Monostate for Dibi\Connection::test().
Generates and returns SQL query as DataSource - Monostate for Dibi\Connection::test().
Executes SQL query and fetch result - Monostate for Dibi\Connection::query() & fetch().
Executes SQL query and fetch results - Monostate for Dibi\Connection::query() & fetchAll().
Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle().
Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs().
Gets the number of affected rows.
Gets the number of affected rows. Alias for getAffectedRows().
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId().
Begins a transaction - Monostate for Dibi\Connection::begin().
Commits statements in a transaction - Monostate for Dibi\Connection::commit($savepoint = NULL).
Rollback changes in a transaction - Monostate for Dibi\Connection::rollback().
Gets a information about the current database - Monostate for Dibi\Connection::getDatabaseInfo().
Import SQL dump from file - extreme fast!
Returns substitution hashmap - Monostate for Dibi\Connection::getSubstitutes().
Prints out a syntax highlighted version of the SQL command or Result.
Details
at line 77
final
__construct()
Static class - cannot be instantiated.
at line 93
static Connection
connect($config = [], $name = '0')
Creates a new Connection object and connects it to specified database.
at line 103
static void
disconnect()
Disconnects from database (doesn't destroy Connection object).
at line 113
static bool
isConnected()
Returns TRUE when connection was established.
at line 125
static Connection
getConnection($name = NULL)
Retrieve active connection.
at line 148
static Connection
setConnection(Connection $connection)
Sets connection.
at line 157
static
activate($name)
deprecated
deprecated
No description
at line 173
static Result|int
query($args)
Generates and executes SQL query - Monostate for Dibi\Connection::query().
at line 185
static Result|int
nativeQuery($sql)
Executes the SQL query - Monostate for Dibi\Connection::nativeQuery().
at line 196
static bool
test($args)
Generates and prints SQL query - Monostate for Dibi\Connection::test().
at line 208
static DataSource
dataSource($args)
Generates and returns SQL query as DataSource - Monostate for Dibi\Connection::test().
at line 221
static Row
fetch($args)
Executes SQL query and fetch result - Monostate for Dibi\Connection::query() & fetch().
at line 234
static Row[]
fetchAll($args)
Executes SQL query and fetch results - Monostate for Dibi\Connection::query() & fetchAll().
at line 247
static mixed
fetchSingle($args)
Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle().
at line 260
static array
fetchPairs($args)
Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs().
at line 273
static int
getAffectedRows()
Gets the number of affected rows.
Monostate for Dibi\Connection::getAffectedRows()
at line 284
static int
affectedRows()
Gets the number of affected rows. Alias for getAffectedRows().
at line 297
static int
getInsertId($sequence = NULL)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
Monostate for Dibi\Connection::getInsertId()
at line 309
static int
insertId($sequence = NULL)
Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId().
at line 321
static void
begin($savepoint = NULL)
Begins a transaction - Monostate for Dibi\Connection::begin().
at line 333
static void
commit($savepoint = NULL)
Commits statements in a transaction - Monostate for Dibi\Connection::commit($savepoint = NULL).
at line 345
static void
rollback($savepoint = NULL)
Rollback changes in a transaction - Monostate for Dibi\Connection::rollback().
at line 355
static Database
getDatabaseInfo()
Gets a information about the current database - Monostate for Dibi\Connection::getDatabaseInfo().
at line 366
static int
loadFile($file)
Import SQL dump from file - extreme fast!
at line 378
static Fluent
command()
No description
at line 388
static Fluent
select($args)
No description
at line 400
static Fluent
update($table, $args)
No description
at line 411
static Fluent
insert($table, $args)
No description
at line 421
static Fluent
delete($table)
No description
at line 434
static HashMap
getSubstitutes()
Returns substitution hashmap - Monostate for Dibi\Connection::getSubstitutes().
at line 449
static string
dump($sql = NULL, $return = FALSE)
Prints out a syntax highlighted version of the SQL command or Result.
Traits
Better OOP experience.