DataBaseQueries
in
Interface to manage the SQL statements needed by the database
Table of Contents
Methods
- sql2Int() : string
- Statement needed to convert a column to integer
- sqlAddConstraint() : string
- SQL statement to add a constraint to a given table
- sqlAlterAddColumn() : string
- SQL statement to add a given table column
- sqlAlterColumnDefault() : string
- SQL statement to alter a given table column's default value
- sqlAlterColumnNull() : string
- SQL statement to alter a given table column's null constraint
- sqlAlterModifyColumn() : string
- SQL statement to alter a given table column's definition
- sqlColumns() : string
- SQL statement to get the columns in a table
- sqlConstraints() : string
- SQL statement to get the table constraints
- sqlConstraintsExtended() : string
- SQL statement to get the table extended constraints
- sqlCreateTable() : string
- SQL statement to create a table
- sqlDropConstraint() : string
- SQL statement to delete a given table column's constraint
- sqlDropTable() : string
- SQL statement to drop a given table
- sqlIndexes() : string
- SQL statement to get a given table's indexes
- sqlLastValue() : string
- SQL statement to get the last value of a sequence or ID
- sqlRenameColumn() : string
- SQL statement to rename a column.
- sqlTableConstraints() : string
- Generates the SQL to establish the given restrictions.
Methods
sql2Int()
Statement needed to convert a column to integer
public
sql2Int(string $colName) : string
Parameters
- $colName : string
Return values
stringsqlAddConstraint()
SQL statement to add a constraint to a given table
public
sqlAddConstraint(string $tableName, string $constraintName, string $sql) : string
Parameters
- $tableName : string
- $constraintName : string
- $sql : string
Return values
stringsqlAlterAddColumn()
SQL statement to add a given table column
public
sqlAlterAddColumn(string $tableName, array<string|int, mixed> $colData) : string
Parameters
- $tableName : string
- $colData : array<string|int, mixed>
Return values
stringsqlAlterColumnDefault()
SQL statement to alter a given table column's default value
public
sqlAlterColumnDefault(string $tableName, array<string|int, mixed> $colData) : string
Parameters
- $tableName : string
- $colData : array<string|int, mixed>
Return values
stringsqlAlterColumnNull()
SQL statement to alter a given table column's null constraint
public
sqlAlterColumnNull(string $tableName, array<string|int, mixed> $colData) : string
Parameters
- $tableName : string
- $colData : array<string|int, mixed>
Return values
stringsqlAlterModifyColumn()
SQL statement to alter a given table column's definition
public
sqlAlterModifyColumn(string $tableName, array<string|int, mixed> $colData) : string
Parameters
- $tableName : string
- $colData : array<string|int, mixed>
Return values
stringsqlColumns()
SQL statement to get the columns in a table
public
sqlColumns(string $tableName) : string
Parameters
- $tableName : string
Return values
stringsqlConstraints()
SQL statement to get the table constraints
public
sqlConstraints(string $tableName) : string
Parameters
- $tableName : string
Return values
stringsqlConstraintsExtended()
SQL statement to get the table extended constraints
public
sqlConstraintsExtended(string $tableName) : string
Parameters
- $tableName : string
Return values
stringsqlCreateTable()
SQL statement to create a table
public
sqlCreateTable(string $tableName, array<string|int, mixed> $columns, array<string|int, mixed> $constraints, array<string|int, mixed> $indexes) : string
Parameters
- $tableName : string
- $columns : array<string|int, mixed>
- $constraints : array<string|int, mixed>
- $indexes : array<string|int, mixed>
Return values
stringsqlDropConstraint()
SQL statement to delete a given table column's constraint
public
sqlDropConstraint(string $tableName, array<string|int, mixed> $colData) : string
Parameters
- $tableName : string
- $colData : array<string|int, mixed>
Return values
stringsqlDropTable()
SQL statement to drop a given table
public
sqlDropTable(string $tableName) : string
Parameters
- $tableName : string
Return values
stringsqlIndexes()
SQL statement to get a given table's indexes
public
sqlIndexes(string $tableName) : string
Parameters
- $tableName : string
Return values
stringsqlLastValue()
SQL statement to get the last value of a sequence or ID
public
sqlLastValue() : string
Return values
stringsqlRenameColumn()
SQL statement to rename a column.
public
sqlRenameColumn(string $tableName, string $old_column, string $new_column) : string
Parameters
- $tableName : string
- $old_column : string
- $new_column : string
Return values
stringsqlTableConstraints()
Generates the SQL to establish the given restrictions.
public
sqlTableConstraints(array<string|int, mixed> $xmlCons) : string
Parameters
- $xmlCons : array<string|int, mixed>