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.
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
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 282
static
affectedRows()
deprecated
deprecated
No description
at line 296
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 305
static
insertId($sequence = null)
deprecated
deprecated
No description
at line 318
static void
begin($savepoint = null)
Begins a transaction - Monostate for Dibi\Connection::begin().
at line 330
static void
commit($savepoint = null)
Commits statements in a transaction - Monostate for Dibi\Connection::commit($savepoint = null).
at line 342
static void
rollback($savepoint = null)
Rollback changes in a transaction - Monostate for Dibi\Connection::rollback().
at line 352
static Database
getDatabaseInfo()
Gets a information about the current database - Monostate for Dibi\Connection::getDatabaseInfo().
at line 363
static int
loadFile($file)
Import SQL dump from file - extreme fast!
at line 375
static Fluent
command()
No description
at line 385
static Fluent
select($args)
No description
at line 397
static Fluent
update($table, $args)
No description
at line 408
static Fluent
insert($table, $args)
No description
at line 418
static Fluent
delete($table)
No description
at line 431
static HashMap
getSubstitutes()
Returns substitution hashmap - Monostate for Dibi\Connection::getSubstitutes().
at line 446
static string
dump($sql = null, $return = false)
Prints out a syntax highlighted version of the SQL command or Result.
Traits
Better OOP experience.