Class DibiFirebirdDriver


The dibi driver for Firebird/InterBase database.

Driver options:

  • database => the path to database file (server:/path/database.fdb)
  • username (or user)
  • password (or pass)
  • charset => character encoding to set
  • buffers (int) => buffers is the number of database buffers to allocate for the server-side cache. If 0 or omitted, server chooses its own default.
  • resource (resource) => existing connection resource
  • lazy, profiler, result, substitutes, ... => see DibiConnection options

DibiObject
   |
   --DibiFirebirdDriver

Implements interfaces:

IDibiDriver, IDibiResultDriver, IDibiReflector
Author: Tomáš Kraina, Roman Sklenář
Copyright: Copyright (c) 2010
Located: in /drivers/firebird.php (line 30)
Constructor Summary
public
Method Summary
void
applyLimit (string &$sql, int $limit, int $offset)
Injects LIMIT/OFFSET to the SQL query.
void
begin ([string $savepoint = NULL])
Begins a transaction (if supported).
void
commit ([string $savepoint = NULL])
Commits statements in a transaction.
void
connect (&$config)
Connects to a database.
void
Disconnects from a database.
string
escape (mixed $value, string $type)
Encodes data for use in a SQL statement.
string
escapeLike (string $value, int $pos)
Encodes string for use in a LIKE statement.
array
fetch (bool $assoc)
Fetches the row at current position and moves the internal cursor to the next position.
void
free ()
Frees the resources allocated for this result set.
int|FALSE
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
array
getColumns (string $table)
Returns metadata for all columns in a table.
array
getConstraints (string $table)
Returns list of constraints in given table.
array
getForeignKeys (string $table)
Returns metadata for all foreign keys in a table.
array
Returns list of user defined functions (UDF).
array
Returns list of generators.
array
getIndexes (string $table)
Returns metadata for all indexes in a table (the constraints are included).
array
getIndices (string $table)
Returns list of indices in given table (the constraints are not listed).
int|FALSE
getInsertId (string $sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
array
Returns list of stored procedures.
array
getProceduresMeta (string 0)
Returns metadata from stored procedures and their input and output parameters.
resource
Returns the connection resource.
array
Returns metadata for all columns in a result set.
mysqli_result
Returns the result set resource.
int
Returns the number of rows in a result set.
array
Returns list of tables.
array
getTriggers ([string $table = NULL])
Returns list of triggers for given table.
array
getTriggersMeta ([string $table = NULL], string 1)
Returns metadata for all triggers in a table or database.
bool
Is in transaction?
IDibiResultDriver|NULL
query (string $sql)
Executes the SQL query.
void
rollback ([string $savepoint = NULL])
Rollback changes in a transaction.
boolean
seek (int $row)
Moves cursor position without fetching row.
string
unescape (string $value, string $type)
Decodes data from result set.
Methods Inherited From DibiObject
DibiObject::extensionMethod(), DibiObject::getClass(), DibiObject::getReflection(), DibiObject::__call(), DibiObject::__callStatic(), DibiObject::__get(), DibiObject::__isset(), DibiObject::__set(), DibiObject::__unset()
Constant Summary
int ERROR_EXCEPTION_THROWN -836

line 32


Constructor Details

line 50

__construct

public __construct ()

Method Details

line 318

applyLimit

public void applyLimit (string &$sql, int $limit, int $offset)

Injects LIMIT/OFFSET to the SQL query.

Input
string &$sql The SQL query that will be modified.
int $limit
int $offset
Output
void  

line 169

begin

public void begin ([string $savepoint = NULL])

Begins a transaction (if supported).

Input
string $savepoint optional savepoint name
Output
void  
Throws
throws DibiDriverException

line 186

commit

public void commit ([string $savepoint = NULL])

Commits statements in a transaction.

Input
string $savepoint optional savepoint name
Output
void  
Throws
throws DibiDriverException

line 64

connect

public void connect (&$config)

Connects to a database.

Input
&$config
Output
void  
Throws
throws DibiException

line 102

disconnect

public void disconnect ()

Disconnects from a database.

Output
void  

line 255

escape

public string escape (mixed $value, string $type)

Encodes data for use in a SQL statement.

Input
mixed $value value
string $type type (dibi::TEXT, dibi::BOOL, ...)
Output
string encoded value
Throws
throws InvalidArgumentException

line 287

escapeLike

public string escapeLike (string $value, int $pos)

Encodes string for use in a LIKE statement.

Input
string $value
int $pos
Output
string  

line 348

fetch

public array fetch (bool $assoc)

Fetches the row at current position and moves the internal cursor to the next position.

Input
bool $assoc TRUE for associative array, FALSE for numeric
Output
array array on success, nonarray if no next record

line 385

free

public void free ()

Frees the resources allocated for this result set.

Output
void  

line 144

getAffectedRows

public int|FALSE getAffectedRows ()

Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.

Output
int|FALSE number of rows or FALSE on error

line 449

getColumns

public array getColumns (string $table)

Returns metadata for all columns in a table.

Input
string $table
Output
array  

line 598

getConstraints

public array getConstraints (string $table)

Returns list of constraints in given table.

Input
string $table
Output
array  

line 542

getForeignKeys

public array getForeignKeys (string $table)

Returns metadata for all foreign keys in a table.

Input
string $table
Output
array  

line 794

getFunctions

public array getFunctions ()

Returns list of user defined functions (UDF).

Output
array  

line 773

getGenerators

public array getGenerators ()

Returns list of generators.

Output
array  

line 506

getIndexes

public array getIndexes (string $table)

Returns metadata for all indexes in a table (the constraints are included).

Input
string $table
Output
array  

line 574

getIndices

public array getIndices (string $table)

Returns list of indices in given table (the constraints are not listed).

Input
string $table
Output
array  

line 156

getInsertId

public int|FALSE getInsertId (string $sequence)

Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.

Input
string $sequence generator name
Output
int|FALSE int on success or FALSE on failure

line 753

getProcedures

public array getProcedures ()

Returns list of stored procedures.

Output
array  

line 699

getProceduresMeta

public array getProceduresMeta (string 0)

Returns metadata from stored procedures and their input and output parameters.

Input
string 0
Output
array  

line 237

getResource

public resource getResource ()

Returns the connection resource.

Output
resource  

line 408

getResultColumns

public array getResultColumns ()

Returns metadata for all columns in a result set.

Output
array  

line 397

getResultResource

public mysqli_result getResultResource ()

Returns the result set resource.

Output
mysqli_result  

line 336

getRowCount

public int getRowCount ()

Returns the number of rows in a result set.

Output
int  

line 423

getTables

public array getTables ()

Returns list of tables.

Output
array  

line 676

getTriggers

public array getTriggers ([string $table = NULL])

Returns list of triggers for given table.

(Only if user has permissions on ALTER TABLE, INSERT/UPDATE/DELETE record in table)

Input
string $table
Output
array  

line 626

getTriggersMeta

public array getTriggersMeta ([string $table = NULL], string 1)

Returns metadata for all triggers in a table or database.

(Only if user has permissions on ALTER TABLE, INSERT/UPDATE/DELETE record in table)

Input
string $table
string 1
Output
array  

line 226

inTransaction

public bool inTransaction ()

Is in transaction?

Output
bool  

line 115

query

public IDibiResultDriver|NULL query (string $sql)

Executes the SQL query.

Input
string $sql SQL statement.
Output
IDibiResultDriver|NULL  
Throws
throws DibiDriverException|DibiException

line 207

rollback

public void rollback ([string $savepoint = NULL])

Rollback changes in a transaction.

Input
string $savepoint optional savepoint name
Output
void  
Throws
throws DibiDriverException

line 374

seek

public boolean seek (int $row)

Moves cursor position without fetching row.

Input
int $row the 0-based cursor pos to seek to
Output
boolean TRUE on success, FALSE if unable to seek to specified record
Throws
throws DibiException

line 301

unescape

public string unescape (string $value, string $type)

Decodes data from result set.

Input
string $value value
string $type type (dibi::BINARY)
Output
string decoded value
Throws
throws InvalidArgumentException