Properties

$last_query

$last_query : string

Last query executed

Type

string

$table_prefix

$table_prefix : string

Prefix to apply to table names

Type

string

$statement

$statement : \PDOStatement

Reference to the last executed query

Type

\PDOStatement

$statement_link

$statement_link : resource

Reference to the resource returned by the last query executed

Type

resource

$trans

$trans : resource

Reference to the current transaction

Type

resource

$conn

$conn : resource

Reference to the connection resource

Type

resource

$service

$service : resource

Reference to the service resource

Type

resource

$has_truncate

$has_truncate : bool

Whether the driver supports 'TRUNCATE'

Type

bool

$escape_char

$escape_char : string

Character to escape identifiers

Type

string

Methods

__construct()

__construct(string $dsn, string $username, string $password, array $driver_options)

PDO constructor wrapper

Parameters

string $dsn
string $username
string $password
array $driver_options

__destruct()

__destruct()

Cleanup some loose ends

get_service()

get_service() : resource

Return service handle

Returns

resource

exec()

exec(string $sql) : int

Execute an sql statement and return number of affected rows

Parameters

string $sql

Returns

int

getAttribute()

getAttribute(int $attribute) : mixed

Implement for compatibility with PDO

Parameters

int $attribute

Returns

mixed

inTransaction()

inTransaction() : bool

Return whether the current statement is in a transaction

Returns

bool

lastInsertId()

lastInsertId(string $name) : mixed

Returns the last value of the specified generator

Parameters

string $name

Returns

mixed

query()

query(string $sql) : \Query\Driver\Firebird_Result

Wrapper public function to better match PDO

Parameters

string $sql

Throws

\Query\Driver\PDOException

Returns

\Query\Driver\Firebird_Result

prepare()

prepare(string $query, array $options) : \Query\Driver\Firebird_Result

Emulate PDO prepare

Parameters

string $query
array $options

Throws

\PDOException

Returns

\Query\Driver\Firebird_Result

beginTransaction()

beginTransaction() : boolean|null

Start a database transaction

Returns

boolean|null

commit()

commit() : bool

Commit a database transaction

Returns

bool

rollBack()

rollBack() : bool

Rollback a transaction

Returns

bool

setAttribute()

setAttribute(int $attribute, mixed $value) : bool

Set a connection attribute

Parameters

int $attribute
mixed $value

Returns

bool

prepare_execute()

prepare_execute(string $sql, array $params) : \PDOStatement

Create and execute a prepared statement with the provided parameters

Parameters

string $sql
array $params

Returns

\PDOStatement

quote()

quote(string $str, int $param_type) : string

Method to emulate PDO->quote

Parameters

string $str
int $param_type

Returns

string

errorInfo()

errorInfo() : array

Method to emulate PDO->errorInfo / PDOStatement->errorInfo

Returns

array

errorCode()

errorCode() : array

Method to emulate PDO->errorCode

Returns

array

prepare_query()

prepare_query(string $sql, array $data) : \PDOStatement

Simplifies prepared statements for database queries

Parameters

string $sql
array $data

Throws

\InvalidArgumentException

Returns

\PDOStatement —

| FALSE

insert_batch()

insert_batch(string $table, array $data) : array

Create sql for batch insert

Parameters

string $table
array $data

Returns

array

__call()

__call(string $name, array $args) : mixed

Allow invoke to work on table object

Parameters

string $name
array $args

Returns

mixed

affected_rows()

affected_rows() : int

Returns number of rows affected by an INSERT, UPDATE, DELETE type query

Returns

int

prefix_table()

prefix_table(string $table) : string

Prefixes a table if it is not already prefixed

Parameters

string $table

Returns

string

quote_table()

quote_table(string $table) : string

Quote database table name, and set prefix

Parameters

string $table

Returns

string

quote_ident()

quote_ident(mixed $ident) : string

Surrounds the string with the databases identifier escape characters

Parameters

mixed $ident

Returns

string

get_schemas()

get_schemas() : array

Return schemas for databases that list them

Returns

array

get_tables()

get_tables() : array

Return list of tables for the current database

Returns

array

get_dbs()

get_dbs() : array

Return list of dbs for the current connection, if possible

Returns

array

get_views()

get_views() : array

Return list of views for the current database

Returns

array

get_sequences()

get_sequences() : array

Return list of sequences for the current database, if they exist

Returns

array

get_functions()

get_functions() : array

Return list of functions for the current database

Returns

array

get_procedures()

get_procedures() : array

Return list of stored procedures for the current database

Returns

array

get_triggers()

get_triggers() : array

Return list of triggers for the current database

Returns

array

get_system_tables()

get_system_tables() : array

Retrieves an array of non-user-created tables for the connection/database

Returns

array

get_columns()

get_columns(string $table) : array

Retrieve column information for the current database table

Parameters

string $table

Returns

array

get_fks()

get_fks(string $table) : array

Retrieve foreign keys for the table

Parameters

string $table

Returns

array

get_indexes()

get_indexes(string $table) : array

Retrieve indexes for the table

Parameters

string $table

Returns

array

get_types()

get_types() : array

Retrieve list of data types for the database

Returns

array

driver_query()

driver_query(string|array|null $query, bool $filtered_index) : array

Method to simplify retrieving db results for meta-data queries

Parameters

string|array|null $query
bool $filtered_index

Returns

array

num_rows()

num_rows() : int

Return the number of rows returned for a SELECT query

Returns

int

_quote()

_quote(mixed $str) : mixed

Helper method for quote_ident

Parameters

mixed $str

Returns

mixed

truncate()

truncate(string $table) : \PDOStatement

Empty the passed table

Parameters

string $table

Returns

\PDOStatement

_load_sub_classes()

_load_sub_classes() : void

Loads the subclasses for the driver

_prefix()

_prefix(string $str) : string

Sets the table prefix on the passed string

Parameters

string $str

Returns

string