class SqlFirebird extends SqlHelper

Personalization of SQL queries to use Firebird.

Properties

protected string $tableQuote Character used as quotes to enclose the name of the table from SqlHelper
protected string $fieldQuote Character used as quotes to enclose the name of a field from SqlHelper
protected string $literalQuote Character used as quotes to enclose the literal fields from SqlHelper
protected array $fieldTypes It contains an associative array in which each index is a type of virtual field, and its content is each of the types it represents. from SqlHelper

Methods

__construct()

SqlFirebird constructor.

string
quoteTableName(string $tableName, bool $usePrefix = true)

Returns the name of the table in quotes.

string
quoteFieldName(string $fieldName)

Returns the name of the field in quotes.

from SqlHelper
string
quoteLiteral(string|null $fieldName)

Returns the name of the field in quotes.

array
getTables()

Returns an array with the name of all the tables in the database.

string
getSqlTableExists(string $tableName)

Returns if table exists in the database.

string
getSQLField(string $fieldName, array $data)

TODO: Undocummented.

array
getColumns(string $tableName, bool $usePrefix = true)

Returns an array with all the columns of a table

from SqlHelper
string
getColumnsSql(string $tableName, bool $usePrefix)

SQL statement that returns the fields in the table

array
normalizeFields(array $row)

Modifies the structure returned by the query generated with getColumnsSql to the normalized format that returns getColumns

array
getIndexes(string $tableName, bool $usePrefix = true)

Obtains information about the indices of the table in a normalized array and independent of the database engine

from SqlHelper
string
getIndexesSql(string $tableName, bool $usePrefix = true)

Obtain an array with the basic information about the indexes of the table, which will be supplemented with the restrictions later.

array
normalizeIndexes(array $fields)

uniqueConstraints: TC_ARTICULOS_CODIGO_U: columns: - CODIGOARTICULO indexes: FK_ARTICULO_PORCENTAJEIMPUESTO: columns: - IDPORCENTAJEIMPUESTO

array
normalizeConstraints(array $fields)

'TABLE_NAME' => string 'clientes' (length=8) 'COLUMN_NAME' => string 'codgrupo' (length=8) 'CONSTRAINT_NAME' => string 'ca_clientes_grupos' (length=18) 'REFERENCED_TABLE_NAME' => string 'gruposclientes' (length=14) 'REFERENCED_COLUMN_NAME' => string 'codgrupo' (length=8)

string
getViewsSql()

Returns the views from the database.

string
getConstraintsSql(string $tableName, bool $usePrefix = true)

TODO: Undocumented and pending complete.

Details

at line 21
__construct()

SqlFirebird constructor.

at line 73
string quoteTableName(string $tableName, bool $usePrefix = true)

Returns the name of the table in quotes.

Parameters

string $tableName
bool $usePrefix

Return Value

string

in SqlHelper at line 87
string quoteFieldName(string $fieldName)

Returns the name of the field in quotes.

Parameters

string $fieldName

Return Value

string

at line 44
string quoteLiteral(string|null $fieldName)

Returns the name of the field in quotes.

Parameters

string|null $fieldName

Return Value

string

at line 54
array getTables()

Returns an array with the name of all the tables in the database.

Return Value

array

at line 294
string getSqlTableExists(string $tableName)

Returns if table exists in the database.

Parameters

string $tableName

Return Value

string

at line 282
string getSQLField(string $fieldName, array $data)

TODO: Undocummented.

Parameters

string $fieldName
array $data

Return Value

string

in SqlHelper at line 153
array getColumns(string $tableName, bool $usePrefix = true)

Returns an array with all the columns of a table

TODO: Review the types. The variants will depend on type + length.

'name_of_the_field' => { (Required type and length or bytes) 'type' => (string/integer/float/decimal/boolean/date/datetime/text/blob) 'length' => It is the number of characters that the field needs (optional if bytes exists) 'bytes' => Number of bytes occupied by the data (optional if length exists) (Optional) 'default' => Default value 'nullable' => True if it can be null 'primary' => True if it is the primary key 'autoincrement' => True if it is an autoincremental number 'zerofilled' => True if it completes zeros on the left }

Parameters

string $tableName
bool $usePrefix

Return Value

array

at line 86
string getColumnsSql(string $tableName, bool $usePrefix)

SQL statement that returns the fields in the table

Parameters

string $tableName
bool $usePrefix

Return Value

string

at line 114
array normalizeFields(array $row)

Modifies the structure returned by the query generated with getColumnsSql to the normalized format that returns getColumns

Parameters

array $row

Return Value

array

in SqlHelper at line 196
array getIndexes(string $tableName, bool $usePrefix = true)

Obtains information about the indices of the table in a normalized array and independent of the database engine

Parameters

string $tableName
bool $usePrefix

Return Value

array

at line 183
string getIndexesSql(string $tableName, bool $usePrefix = true)

Obtain an array with the basic information about the indexes of the table, which will be supplemented with the restrictions later.

Parameters

string $tableName
bool $usePrefix

Return Value

string

at line 159
array normalizeIndexes(array $fields)

uniqueConstraints: TC_ARTICULOS_CODIGO_U: columns: - CODIGOARTICULO indexes: FK_ARTICULO_PORCENTAJEIMPUESTO: columns: - IDPORCENTAJEIMPUESTO

Parameters

array $fields

Return Value

array

at line 201
array normalizeConstraints(array $fields)

'TABLE_NAME' => string 'clientes' (length=8) 'COLUMN_NAME' => string 'codgrupo' (length=8) 'CONSTRAINT_NAME' => string 'ca_clientes_grupos' (length=18) 'REFERENCED_TABLE_NAME' => string 'gruposclientes' (length=14) 'REFERENCED_COLUMN_NAME' => string 'codgrupo' (length=8)

ALTER TABLE Orders ADD CONSTRAINT FK_PersonOrder FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);

Parameters

array $fields

Return Value

array

at line 219
string getViewsSql()

Returns the views from the database.

Return Value

string

at line 255
string getConstraintsSql(string $tableName, bool $usePrefix = true)

TODO: Undocumented and pending complete.

Parameters

string $tableName
bool $usePrefix

Return Value

string