eZPublish  3.8
eZPgsqlSchema Class Reference

Handles schemas for PostgreSQL. More...

+ Inheritance diagram for eZPgsqlSchema:
+ Collaboration diagram for eZPgsqlSchema:

Public Member Functions

 convertFromStandardType ($type, &$length)
 
 convertToStandardType ($type, &$length)
 
 escapeSQLString ($value)
 
 eZPgsqlSchema ($db)
 
 generateSchemaFile ($schema, $params=array())
 
 generateTableInsertSQLList ($tableName, $tableDef, $dataEntries, $params, $withClosure=true)
 
 generateTableSchema ($table, $table_def, $params)
 
 generateTableSQLList ($table, $table_def, $params, $separateTypes)
 
 isTypeLengthSupported ($pgType)
 
 parseDefault ($default, &$autoinc)
 
 parseType ($type_info, &$length_info)
 
 reservedKeywordList ()
 
 schema ($params=array())
 
 schemaName ()
 
 schemaType ()
 
- Public Member Functions inherited from eZDBSchemaInterface
 appendSQLComments ($def, &$sql)
 
 data ($schema=false, $tableNameList=false, $params=array())
 
 eZDBSchemaInterface ($params)
 
 insertSchema ($params=array())
 
 validate ()
 
 writeArraySchemaFile ($filename, $params=array())
 
 writeSerializedSchemaFile ($filename, $params=array())
 
 writeSQLSchemaFile ($filename, $params=array())
 
 writeUpgradeFile ($differences, $filename, $params=array())
 

Private Member Functions

 fetchTableFields ($table, $params)
 
 fetchTableIndexes ($table, $params)
 
 generateAddFieldSql ($table_name, $field_name, $def, $params)
 
 generateAddIndexSql ($table_name, $index_name, $def, $params, $withClosure)
 
 generateAlterFieldSql ($table_name, $field_name, $def, $params)
 
 generateDefaultDef ($table_name, $field_name, $def, $params)
 
 generateDropIndexSql ($table_name, $index_name, $def, $withClosure)
 
 generateDropTable ($table)
 
 generateFieldDef ($table_name, $field_name, $def, $add_default_not_null=true, $params)
 
 generateNullDef ($table_name, $field_name, $def, $params)
 
 generateTableArrays ($table, $table_def, $params, $withClosure)
 
 primaryKeyIndexName ($tableName, $indexName, $fields)
 

Additional Inherited Members

- Public Attributes inherited from eZDBSchemaInterface
 $Data
 
 $DBInstance
 eZDB instance More...
 
 $Schema
 
- Protected Member Functions inherited from eZDBSchemaInterface
 fetchTableData ($tableInfo, $offset=false, $limit=false)
 
 generateAddFieldSql ($table_name, $field_name, $def)
 
 generateAlterFieldSql ($table_name, $field_name, $def)
 
 generateDataValueTextSQL ($fieldDef, $value)
 
 generateTableInsert ($tableName, $tableDef, $dataEntries, $params)
 
 generateTableInsertSQLList ($tableName, $tableDef, $dataEntries, $params, $withClosure=true)
 
 isMultiInsertSupported ()
 
 transformData (&$data, $toLocal)
 
 transformSchema (&$schema, $toLocal)
 

Detailed Description

Handles schemas for PostgreSQL.

Member Function Documentation

eZPgsqlSchema::convertFromStandardType (   $type,
$length 
)

Referenced by generateFieldDef().

eZPgsqlSchema::convertToStandardType (   $type,
$length 
)
eZPgsqlSchema::escapeSQLString (   $value)
virtual

Implements eZDBSchemaInterface.

eZPgsqlSchema::eZPgsqlSchema (   $db)

Constructor

Parameters
dbinstance
eZPgsqlSchema::fetchTableFields (   $table,
  $params 
)
private
eZPgsqlSchema::fetchTableIndexes (   $table,
  $params 
)
private
eZPgsqlSchema::generateAddFieldSql (   $table_name,
  $field_name,
  $def,
  $params 
)
private
eZPgsqlSchema::generateAddIndexSql (   $table_name,
  $index_name,
  $def,
  $params,
  $withClosure 
)
private
Parameters
$table_nameThe table name
$index_nameThe index name
$defThe index structure, see eZDBSchemaInterface for more details
$paramsAn associative array with optional parameters which controls the output of SQLs
$withClosureIf true then the SQLs will contain semi-colons to close them.

Referenced by generateTableArrays().

eZPgsqlSchema::generateAlterFieldSql (   $table_name,
  $field_name,
  $def,
  $params 
)
private
eZPgsqlSchema::generateDefaultDef (   $table_name,
  $field_name,
  $def,
  $params 
)
private
eZPgsqlSchema::generateDropIndexSql (   $table_name,
  $index_name,
  $def,
  $withClosure 
)
private
eZPgsqlSchema::generateDropTable (   $table)
private
eZPgsqlSchema::generateFieldDef (   $table_name,
  $field_name,
  $def,
  $add_default_not_null = true,
  $params 
)
private
eZPgsqlSchema::generateNullDef (   $table_name,
  $field_name,
  $def,
  $params 
)
private
eZPgsqlSchema::generateSchemaFile (   $schema,
  $params = array() 
)
eZPgsqlSchema::generateTableArrays (   $table,
  $table_def,
  $params,
  $withClosure 
)
private
Parameters
$tableThe table name
$table_defThe table structure, see eZDBSchemaInterface for more details
$paramsAn associative array with optional parameters which controls the output of SQLs
$withClosureIf true then the SQLs will contain semi-colons to close them.
eZPgsqlSchema::generateTableInsertSQLList (   $tableName,
  $tableDef,
  $dataEntries,
  $params,
  $withClosure = true 
)

This calls eZDBSchemaInterface::generateTableInsertSQLList() and adds a setval SQL if the table has auto increments.

eZPgsqlSchema::generateTableSchema (   $table,
  $table_def,
  $params 
)
virtual

Implements eZDBSchemaInterface.

eZPgsqlSchema::generateTableSQLList (   $table,
  $table_def,
  $params,
  $separateTypes 
)
virtual

Implements eZDBSchemaInterface.

eZPgsqlSchema::isTypeLengthSupported (   $pgType)

Referenced by generateFieldDef().

eZPgsqlSchema::parseDefault (   $default,
$autoinc 
)
eZPgsqlSchema::parseType (   $type_info,
$length_info 
)
eZPgsqlSchema::primaryKeyIndexName (   $tableName,
  $indexName,
  $fields 
)
private

The name will consist of the table name and _pkey, since it is only allowed to have one primary key pre table that shouldn't be a problem.

Returns
A string representing the name of the primary key index.
eZPgsqlSchema::reservedKeywordList ( )
Returns
An array with keywords that are reserved by PostgreSQL.
eZPgsqlSchema::schema (   $params = array())
virtual

Implements eZDBSchemaInterface.

eZPgsqlSchema::schemaName ( )
virtual

Implements eZDBSchemaInterface.

eZPgsqlSchema::schemaType ( )
virtual

Implements eZDBSchemaInterface.


The documentation for this class was generated from the following file: