factory
class factory implements driver_interface
Database Abstraction Layer
Properties
protected driver_interface | $driver | ||
protected ContainerInterface | $container |
Methods
Constructor.
Return the current driver (and retrieved it from the container if necessary)
Set value for load_time debug parameter
Set value for sql_explain debug parameter
Gets the name of the sql layer.
Gets the name of the database.
Wildcards for matching any (%) character within LIKE expressions
Wildcards for matching exactly one (_) character within LIKE expressions
Gets the connect ID.
Indicates if an error was triggered.
Gets the last faulty query
Indicates if we are in a transaction.
Gets the time spent into the queries
Gets the returned error.
Indicates if multiple insertion can be used
Set if multiple insertion can be used
Gets the exact number of rows in a specified table.
Gets the estimated number of rows in a specified table.
Run LOWER() on DB column of type text (i.e. neither varchar nor char).
Display sql error page
Returns whether results of a query need to be buffered to run a transaction while iterating over them.
Run binary OR operator on DB column.
Version information about used database
Return on error or display error message
Build sql statement from an array
Fetch all rows
SQL Transaction
Build a concatenated expression
Build a case expression
Build sql statement from array for select and select distinct statements
Fetch field if rownum is false, the current row is used, else it is pointing to the row (zero-based)
Fetch current row
Returns SQL string to cast a string expression to an int.
Gets the ID of the last inserted row immediately after an INSERT statement.
Gets the ID of the last inserted row immediately after an INSERT statement. The returned value can be used for selecting the item that has just been inserted or for updating another table with an ID pointing to that item.
Add to query count
Build LIMIT query
Base query method
Returns SQL string to cast an integer expression to a string.
Connect to server
Run binary AND operator on DB column.
Free sql result
Return number of sql queries and cached sql queries used
Run more than one insert statement.
Return number of affected rows
DBAL garbage collection, close SQL connection
Seek to given row number
Escape string used in sql query
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way
Correctly adjust NOT LIKE expression for special characters Some DBMS are handling them in a different way
Explain queries
Build IN or NOT IN sql comparison string, uses <> or = on single element arrays to improve comparison speed
Quote identifiers used in sql query
Ensure query ID can be used by cache
Details
at line 38
__construct(ContainerInterface $container)
Constructor.
at line 48
protected driver_interface
get_driver()
Return the current driver (and retrieved it from the container if necessary)
at line 63
set_driver(driver_interface $driver)
Set the current driver
at line 71
set_debug_load_time(bool $value)
Set value for load_time debug parameter
at line 79
set_debug_sql_explain(bool $value)
Set value for sql_explain debug parameter
at line 87
string
get_sql_layer()
Gets the name of the sql layer.
at line 95
string
get_db_name()
Gets the name of the database.
at line 103
string
get_any_char()
Wildcards for matching any (%) character within LIKE expressions
at line 111
string
get_one_char()
Wildcards for matching exactly one (_) character within LIKE expressions
at line 119
mixed
get_db_connect_id()
Gets the connect ID.
at line 127
bool
get_sql_error_triggered()
Indicates if an error was triggered.
at line 135
string
get_sql_error_sql()
Gets the last faulty query
at line 143
bool
get_transaction()
Indicates if we are in a transaction.
at line 151
int
get_sql_time()
Gets the time spent into the queries
at line 159
array
get_sql_error_returned()
Gets the returned error.
at line 167
bool
get_multi_insert()
Indicates if multiple insertion can be used
at line 175
set_multi_insert(bool $multi_insert)
Set if multiple insertion can be used
at line 183
string
get_row_count(string $table_name)
Gets the exact number of rows in a specified table.
at line 191
string
get_estimated_row_count(string $table_name)
Gets the estimated number of rows in a specified table.
at line 199
string
sql_lower_text(string $column_name)
Run LOWER() on DB column of type text (i.e. neither varchar nor char).
at line 207
mixed
sql_error(string $sql = '')
Display sql error page
at line 215
bool
sql_buffer_nested_transactions()
Returns whether results of a query need to be buffered to run a transaction while iterating over them.
at line 223
string
sql_bit_or(string $column_name, int $bit, string $compare = '')
Run binary OR operator on DB column.
at line 231
string
sql_server_info(bool $raw = false, bool $use_cache = true)
Version information about used database
at line 239
null
sql_return_on_error(bool $fail = false)
Return on error or display error message
at line 247
string
sql_build_array(string $query, array $assoc_ary = array())
Build sql statement from an array
at line 255
mixed
sql_fetchrowset(mixed $query_id = false)
Fetch all rows
at line 263
mixed
sql_transaction(string $status = 'begin')
SQL Transaction
at line 271
string
sql_concatenate(string $expr1, string $expr2)
Build a concatenated expression
at line 279
string
sql_case(string $condition, string $action_true, mixed $action_false = false)
Build a case expression
Note: The two statements action_true and action_false must have the same data type (int, vchar, ...) in the database!
at line 287
string
sql_build_query(string $query, array $array)
Build sql statement from array for select and select distinct statements
Possible query values: SELECT, SELECT_DISTINCT
at line 295
mixed
sql_fetchfield(string $field, mixed $rownum = false, mixed $query_id = false)
Fetch field if rownum is false, the current row is used, else it is pointing to the row (zero-based)
at line 303
mixed
sql_fetchrow(mixed $query_id = false)
Fetch current row
at line 311
string
cast_expr_to_bigint(string $expression)
Returns SQL string to cast a string expression to an int.
at line 319
string|false
sql_nextid()
Gets the ID of the last inserted row immediately after an INSERT statement.
Note: Despite the name, the returned ID refers to the row that has just been inserted, rather than the hypothetical ID of the next row if a new one was to be inserted.
The returned value can be used for selecting the item that has just been inserted or for updating another table with an ID pointing to that item.
Alias of sql_last_inserted_id
.
at line 327
string|false
sql_last_inserted_id()
Gets the ID of the last inserted row immediately after an INSERT statement. The returned value can be used for selecting the item that has just been inserted or for updating another table with an ID pointing to that item.
at line 335
null
sql_add_num_queries(bool $cached = false)
Add to query count
at line 343
mixed
sql_query_limit(string $query, int $total, int $offset = 0, int $cache_ttl = 0)
Build LIMIT query
at line 351
mixed
sql_query(string $query = '', int $cache_ttl = 0)
Base query method
at line 359
string
cast_expr_to_string(string $expression)
Returns SQL string to cast an integer expression to a string.
at line 367
mixed
sql_connect(string $sqlserver, string $sqluser, string $sqlpassword, string $database, mixed $port = false, bool $persistency = false, bool $new_link = false)
Connect to server
at line 375
string
sql_bit_and(string $column_name, int $bit, string $compare = '')
Run binary AND operator on DB column.
Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}"
at line 383
null
sql_freeresult(mixed $query_id = false)
Free sql result
at line 391
int
sql_num_queries(bool $cached = false)
Return number of sql queries and cached sql queries used
at line 399
bool
sql_multi_insert(string $table, array $sql_ary)
Run more than one insert statement.
at line 407
mixed
sql_affectedrows()
Return number of affected rows
at line 415
mixed
sql_close()
DBAL garbage collection, close SQL connection
at line 423
bool
sql_rowseek(mixed $rownum, mixed $query_id)
Seek to given row number
at line 431
string
sql_escape(string $msg)
Escape string used in sql query
at line 439
string
sql_like_expression(string $expression)
Correctly adjust LIKE expression for special characters Some DBMS are handling them in a different way
at line 447
string
sql_not_like_expression(string $expression)
Correctly adjust NOT LIKE expression for special characters Some DBMS are handling them in a different way
at line 455
mixed
sql_report(string $mode, string $query = '')
Explain queries
at line 463
string
sql_in_set(string $field, array $array, bool $negate = false, bool $allow_empty_set = false)
Build IN or NOT IN sql comparison string, uses <> or = on single element arrays to improve comparison speed
at line 471
string
sql_quote(string $msg)
Quote identifiers used in sql query
at line 479
int|string
clean_query_id(resource|int|string $query_id)
Ensure query ID can be used by cache