\Pluf_DB_Schema_PostgreSQL

Generator of the schemas corresponding to a given model.

This class is for PostgreSQL, you can create a class on the same model for another database engine.

Summary

Methods
Properties
Constants
__construct()
getSqlCreate()
getSqlIndexes()
getShortenedIdentifierName()
getSqlCreateConstraints()
getSqlDelete()
getSqlDeleteConstraints()
$mappings
$defaults
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$con
N/A

Properties

$mappings

$mappings : 

Mapping of the fields.

Type

$defaults

$defaults : 

Type

$con

$con : 

Type

Methods

__construct()

__construct(  $con) 

Parameters

$con

getSqlCreate()

getSqlCreate(  $model) : array

Get the SQL to generate the tables of the given model.

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.

getSqlIndexes()

getSqlIndexes(  $model) : array

Get the SQL to generate the indexes of the given model.

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.

getShortenedIdentifierName()

getShortenedIdentifierName(  $name) : string

All identifiers in Postgres must not exceed 64 characters in length.

Parameters

$name

Returns

string

getSqlCreateConstraints()

getSqlCreateConstraints(  $model) : array

Get the SQL to create the constraints for the given model

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.

getSqlDelete()

getSqlDelete(  $model) : string

Get the SQL to drop the tables corresponding to the model.

Parameters

$model

Returns

string —

SQL string ready to execute.

getSqlDeleteConstraints()

getSqlDeleteConstraints(  $model) : array

Get the SQL to drop the constraints for the given model

Parameters

$model

Returns

array —

Array of SQL strings ready to execute.