FacturaScripts

PostgresqlQueries
in package
implements DataBaseQueries

Class that gathers all the needed SQL sentences by the database engine

Table of Contents

Interfaces

DataBaseQueries
Interface to manage the SQL statements needed by the database

Methods

sql2Int()  : string
Returns the needed SQL to convert a column to integer
sqlAddConstraint()  : string
Returns the SQL needed to add a constraint to a table
sqlAddIndex()  : string
Returns the SQL needed to add an index to a table
sqlAlterAddColumn()  : string
Returns the SQL needed to add a column to a table
sqlAlterColumnDefault()  : string
Returns the needed SQL to alter a column default constraint
sqlAlterColumnNull()  : string
SQL statement to alter a null constraint in a table column
sqlAlterModifyColumn()  : string
Returns the SQL needed to alter a column in a table
sqlColumns()  : string
Returns the SQL needed to get the list of columns in a table
sqlConstraints()  : string
Returns the SQL needed to get the list of constraints in a table
sqlConstraintsExtended()  : string
Returns the SQL needed to get the list of advanced constraints in a table
sqlCreateTable()  : string
Returns the SQL needed to create a table with the given structure
sqlDropConstraint()  : string
Returns the SQL needed to remove a constraint from a table
sqlDropIndex()  : string
sqlDropTable()  : string
SQL statement to drop a given table
sqlIndexes()  : string
Returns the SQL needed to get the list of indexes in a table
sqlLastValue()  : string
Returns the SQL to get last ID assigned when performing an INSERT in the database
sqlRenameColumn()  : string
SQL statement to rename a column.
sqlTableConstraints()  : string
Generates the needed SQL to establish the given constraints
sqlTableIndexes()  : string
Generates the needed SQL to create the indexes in a table

Methods

sql2Int()

Returns the needed SQL to convert a column to integer

public sql2Int(string $colName) : string
Parameters
$colName : string
Return values
string

sqlAddConstraint()

Returns the SQL needed to add a constraint to a table

public sqlAddConstraint(string $tableName, string $constraintName, string $sql) : string
Parameters
$tableName : string
$constraintName : string
$sql : string
Return values
string

sqlAddIndex()

Returns the SQL needed to add an index to a table

public sqlAddIndex(string $tableName, string $indexName, string $columns) : string
Parameters
$tableName : string
$indexName : string
$columns : string
Return values
string

sqlAlterAddColumn()

Returns the SQL needed to add a column to a table

public sqlAlterAddColumn(string $tableName, array<string|int, mixed> $colData) : string
Parameters
$tableName : string
$colData : array<string|int, mixed>
Return values
string

sqlAlterColumnDefault()

Returns the needed SQL to alter a column default constraint

public sqlAlterColumnDefault(string $tableName, array<string|int, mixed> $colData) : string
Parameters
$tableName : string
$colData : array<string|int, mixed>
Return values
string

sqlAlterColumnNull()

SQL statement to alter a null constraint in a table column

public sqlAlterColumnNull(string $tableName, array<string|int, mixed> $colData) : string
Parameters
$tableName : string
$colData : array<string|int, mixed>
Return values
string

sqlAlterModifyColumn()

Returns the SQL needed to alter a column in a table

public sqlAlterModifyColumn(string $tableName, array<string|int, mixed> $colData) : string
Parameters
$tableName : string
$colData : array<string|int, mixed>
Return values
string

sqlColumns()

Returns the SQL needed to get the list of columns in a table

public sqlColumns(string $tableName) : string
Parameters
$tableName : string
Return values
string

sqlConstraints()

Returns the SQL needed to get the list of constraints in a table

public sqlConstraints(string $tableName) : string
Parameters
$tableName : string
Return values
string

sqlConstraintsExtended()

Returns the SQL needed to get the list of advanced constraints in a table

public sqlConstraintsExtended(string $tableName) : string
Parameters
$tableName : string
Return values
string

sqlCreateTable()

Returns the SQL needed to create a table with the given structure

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
string

sqlDropConstraint()

Returns the SQL needed to remove a constraint from a table

public sqlDropConstraint(string $tableName, array<string|int, mixed> $colData) : string
Parameters
$tableName : string
$colData : array<string|int, mixed>
Return values
string

sqlDropIndex()

public sqlDropIndex(string $tableName, array<string|int, mixed> $colData) : string
Parameters
$tableName : string
$colData : array<string|int, mixed>
Return values
string

sqlDropTable()

SQL statement to drop a given table

public sqlDropTable(string $tableName) : string
Parameters
$tableName : string
Return values
string

sqlIndexes()

Returns the SQL needed to get the list of indexes in a table

public sqlIndexes(string $tableName) : string
Parameters
$tableName : string
Return values
string

sqlLastValue()

Returns the SQL to get last ID assigned when performing an INSERT in the database

public sqlLastValue() : string
Return values
string

sqlRenameColumn()

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
string

sqlTableConstraints()

Generates the needed SQL to establish the given constraints

public sqlTableConstraints(array<string|int, mixed> $xmlCons) : string
Parameters
$xmlCons : array<string|int, mixed>
Return values
string

sqlTableIndexes()

Generates the needed SQL to create the indexes in a table

private sqlTableIndexes(string $tableName, array<string|int, mixed> $xmlIndexes) : string
Parameters
$tableName : string
$xmlIndexes : array<string|int, mixed>
Return values
string

        
On this page

Search results