dibi
class dibi
Static container class for Dibi connections.
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|null | $sql | ||
static float|null | $elapsedTime | ||
static float | $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.
Strips microseconds part.
Details
at line 76
final
__construct()
Static class - cannot be instantiated.
at line 92
static Connection
connect($config = [], $name = '0')
Creates a new Connection object and connects it to specified database.
at line 102
static void
disconnect()
Disconnects from database (doesn't destroy Connection object).
at line 112
static bool
isConnected()
Returns true when connection was established.
at line 124
static Connection
getConnection($name = null)
Retrieve active connection.
at line 147
static Connection
setConnection(Connection $connection)
Sets connection.
at line 156
static
activate($name)
deprecated
deprecated
No description
at line 172
static Result|int
query($args)
Generates and executes SQL query - Monostate for Dibi\Connection::query().
at line 184
static Result|int
nativeQuery($sql)
Executes the SQL query - Monostate for Dibi\Connection::nativeQuery().
at line 195
static bool
test($args)
Generates and prints SQL query - Monostate for Dibi\Connection::test().
at line 207
static DataSource
dataSource($args)
Generates and returns SQL query as DataSource - Monostate for Dibi\Connection::test().
at line 220
static Row
fetch($args)
Executes SQL query and fetch result - Monostate for Dibi\Connection::query() & fetch().
at line 233
static Row[]
fetchAll($args)
Executes SQL query and fetch results - Monostate for Dibi\Connection::query() & fetchAll().
at line 246
static mixed
fetchSingle($args)
Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle().
at line 259
static array
fetchPairs($args)
Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs().
at line 272
static int
getAffectedRows()
Gets the number of affected rows.
Monostate for Dibi\Connection::getAffectedRows()
at line 281
static
affectedRows()
deprecated
deprecated
No description
at line 295
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 304
static
insertId($sequence = null)
deprecated
deprecated
No description
at line 317
static void
begin($savepoint = null)
Begins a transaction - Monostate for Dibi\Connection::begin().
at line 329
static void
commit($savepoint = null)
Commits statements in a transaction - Monostate for Dibi\Connection::commit($savepoint = null).
at line 341
static void
rollback($savepoint = null)
Rollback changes in a transaction - Monostate for Dibi\Connection::rollback().
at line 351
static Database
getDatabaseInfo()
Gets a information about the current database - Monostate for Dibi\Connection::getDatabaseInfo().
at line 362
static int
loadFile($file)
Import SQL dump from file - extreme fast!
at line 374
static Fluent
command()
No description
at line 384
static Fluent
select($args)
No description
at line 396
static Fluent
update($table, $args)
No description
at line 407
static Fluent
insert($table, $args)
No description
at line 417
static Fluent
delete($table)
No description
at line 430
static HashMap
getSubstitutes()
Returns substitution hashmap - Monostate for Dibi\Connection::getSubstitutes().
at line 445
static string|null
dump($sql = null, $return = false)
Prints out a syntax highlighted version of the SQL command or Result.
at line 456
static DateTime|DateTimeInterface
stripMicroseconds($dt)
Strips microseconds part.
Traits
Better OOP experience.