SqlFirebird
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
SqlFirebird constructor.
Returns the name of the table in quotes.
Returns the name of the field in quotes.
Returns an array with the name of all the tables in the database.
Returns if table exists in the database.
TODO: Undocummented.
Returns an array with all the columns of a table
SQL statement that returns the fields in the table
Modifies the structure returned by the query generated with getColumnsSql to the normalized format that returns getColumns
Obtains information about the indices of the table in a normalized array and independent of the database engine
Obtain an array with the basic information about the indexes of the table, which will be supplemented with the restrictions later.
uniqueConstraints: TC_ARTICULOS_CODIGO_U: columns: - CODIGOARTICULO indexes: FK_ARTICULO_PORCENTAJEIMPUESTO: columns: - IDPORCENTAJEIMPUESTO
'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)
Returns the views from the database.
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.
in
SqlHelper
at line 87
string
quoteFieldName(string $fieldName)
Returns the name of the field in quotes.
at line 44
string
quoteLiteral(string|null $fieldName)
Returns the name of the field in quotes.
at line 54
array
getTables()
Returns an array with the name of all the tables in the database.
at line 294
string
getSqlTableExists(string $tableName)
Returns if table exists in the database.
at line 282
string
getSQLField(string $fieldName, array $data)
TODO: Undocummented.
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 }
at line 86
string
getColumnsSql(string $tableName, bool $usePrefix)
SQL statement that returns the fields in the table
at line 114
array
normalizeFields(array $row)
Modifies the structure returned by the query generated with getColumnsSql to the normalized format that returns getColumns
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
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.
at line 159
array
normalizeIndexes(array $fields)
uniqueConstraints: TC_ARTICULOS_CODIGO_U: columns: - CODIGOARTICULO indexes: FK_ARTICULO_PORCENTAJEIMPUESTO: columns: - IDPORCENTAJEIMPUESTO
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);
at line 219
string
getViewsSql()
Returns the views from the database.
at line 255
string
getConstraintsSql(string $tableName, bool $usePrefix = true)
TODO: Undocumented and pending complete.