PHP Class Doctrine\DBAL\Platforms\PostgreSqlPlatform

Since: 2.0
Author: Roman Borschel ([email protected])
Inheritance: extends Doctrine\DBAL\Platforms\AbstractPlatform
Show file Open project: doctrine/dbal Class Usage Examples

Public Methods

Method Description
convertBooleans ( $item ) {@inheritDoc}
convertBooleansToDatabaseValue ( $item ) {@inheritDoc}
convertFromBoolean ( $item ) {@inheritDoc}
getAdvancedForeignKeyOptionsSQL ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey ) {@inheritDoc}
getAlterSequenceSQL ( Doctrine\DBAL\Schema\Sequence $sequence ) {@inheritDoc}
getAlterTableSQL ( Doctrine\DBAL\Schema\TableDiff $diff ) {@inheritDoc}
getBigIntTypeDeclarationSQL ( array $field ) {@inheritDoc}
getBinaryDefaultLength ( )
getBinaryMaxLength ( )
getBlobTypeDeclarationSQL ( array $field ) {@inheritDoc}
getBooleanTypeDeclarationSQL ( array $field ) {@inheritDoc}
getClobTypeDeclarationSQL ( array $field ) {@inheritDoc}
getCloseActiveDatabaseConnectionsSQL ( string $database ) : string Returns the SQL statement for closing currently active connections on the given database.
getCommentOnColumnSQL ( $tableName, $columnName, $comment )
getCreateDatabaseSQL ( $name ) {@inheritDoc}
getCreateSchemaSQL ( $schemaName ) {@inheritDoc}
getCreateSequenceSQL ( Doctrine\DBAL\Schema\Sequence $sequence ) {@inheritDoc}
getCreateViewSQL ( $name, $sql ) {@inheritDoc}
getDateDiffExpression ( $date1, $date2 ) {@inheritDoc}
getDateTimeTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDateTimeTzFormatString ( ) {@inheritDoc}
getDateTimeTzTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDateTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDefaultSchemaName ( )
getDisallowDatabaseConnectionsSQL ( string $database ) : string Returns the SQL statement for disallowing new connections on the given database.
getDropForeignKeySQL ( $foreignKey, $table ) {@inheritDoc}
getDropSequenceSQL ( $sequence ) {@inheritDoc}
getDropViewSQL ( $name ) {@inheritDoc}
getEmptyIdentityInsertSQL ( $quotedTableName, $quotedIdentifierColumnName ) {@inheritDoc}
getGuidExpression ( ) {@inheritDoc}
getGuidTypeDeclarationSQL ( array $field ) {@inheritDoc}
getIdentitySequenceName ( $tableName, $columnName )
getIntegerTypeDeclarationSQL ( array $field ) {@inheritDoc}
getListDatabasesSQL ( ) {@inheritDoc}
getListNamespacesSQL ( ) {@inheritDoc}
getListSequencesSQL ( $database ) {@inheritDoc}
getListTableColumnsSQL ( $table, $database = null ) {@inheritDoc}
getListTableConstraintsSQL ( $table ) {@inheritDoc}
getListTableForeignKeysSQL ( $table, $database = null ) {@inheritDoc}
getListTableIndexesSQL ( $table, $currentDatabase = null ) {@inheritDoc}
getListTablesSQL ( ) {@inheritDoc}
getListViewsSQL ( $database ) {@inheritDoc}
getLocateExpression ( $str, $substr, $startPos = false ) {@inheritDoc}
getName ( ) {@inheritDoc}
getNowExpression ( ) {@inheritDoc}
getReadLockSQL ( ) {@inheritDoc}
getRegexpExpression ( ) {@inheritDoc}
getSQLResultCasing ( $column ) {@inheritDoc}
getSequenceNextValSQL ( $sequenceName ) {@inheritDoc}
getSetTransactionIsolationSQL ( $level ) {@inheritDoc}
getSmallIntTypeDeclarationSQL ( array $field ) {@inheritDoc}
getSubstringExpression ( $value, $from, $length = null ) {@inheritDoc}
getTimeTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getTruncateTableSQL ( $tableName, $cascade = false ) {@inheritDoc}
getVarcharMaxLength ( ) {@inheritDoc}
hasNativeGuidType ( ) {@inheritDoc}
prefersSequences ( ) {@inheritDoc}
quoteStringLiteral ( $str )
setUseBooleanTrueFalseStrings ( boolean $flag ) PostgreSQL has different behavior with some drivers with regard to how booleans have to be handled.
supportsCommentOnStatement ( ) {@inheritDoc}
supportsIdentityColumns ( ) {@inheritDoc}
supportsPartialIndexes ( )
supportsSchemas ( ) {@inheritDoc}
supportsSequences ( ) {@inheritDoc}
usesSequenceEmulatedIdentityColumns ( )

Protected Methods

Method Description
_getCommonIntegerTypeDeclarationSQL ( array $columnDef ) {@inheritDoc}
_getCreateTableSQL ( $tableName, array $columns, array $options = [] ) {@inheritDoc}
getBinaryTypeDeclarationSQLSnippet ( $length, $fixed )
getDateArithmeticIntervalExpression ( $date, $operator, $interval, $unit )
getRenameIndexSQL ( $oldIndexName, Doctrine\DBAL\Schema\Index $index, $tableName )
getReservedKeywordsClass ( ) {@inheritDoc}
getVarcharTypeDeclarationSQLSnippet ( $length, $fixed ) {@inheritDoc}
initializeDoctrineTypeMappings ( ) {@inheritDoc}

Private Methods

Method Description
convertSingleBooleanValue ( mixed $value, callable $callback ) : mixed Converts a single boolean value.
doConvertBooleans ( mixed $item, callable $callback ) : mixed Converts one or multiple boolean values.
getSequenceCacheSQL ( Doctrine\DBAL\Schema\Sequence $sequence ) : string Cache definition for sequences
getTableWhereClause ( string $table, string $classAlias = 'c', string $namespaceAlias = 'n' ) : string
isUnchangedBinaryColumn ( Doctrine\DBAL\Schema\ColumnDiff $columnDiff ) : boolean Checks whether a given column diff is a logically unchanged binary type column.

Method Details

_getCommonIntegerTypeDeclarationSQL() protected method

{@inheritDoc}
protected _getCommonIntegerTypeDeclarationSQL ( array $columnDef )
$columnDef array

_getCreateTableSQL() protected method

{@inheritDoc}
protected _getCreateTableSQL ( $tableName, array $columns, array $options = [] )
$columns array
$options array

convertBooleans() public method

Postgres wants boolean values converted to the strings 'true'/'false'.
public convertBooleans ( $item )

convertBooleansToDatabaseValue() public method

{@inheritDoc}

convertFromBoolean() public method

{@inheritDoc}
public convertFromBoolean ( $item )

getAdvancedForeignKeyOptionsSQL() public method

{@inheritDoc}
public getAdvancedForeignKeyOptionsSQL ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey )
$foreignKey Doctrine\DBAL\Schema\ForeignKeyConstraint

getAlterSequenceSQL() public method

{@inheritDoc}
public getAlterSequenceSQL ( Doctrine\DBAL\Schema\Sequence $sequence )
$sequence Doctrine\DBAL\Schema\Sequence

getAlterTableSQL() public method

{@inheritDoc}
public getAlterTableSQL ( Doctrine\DBAL\Schema\TableDiff $diff )
$diff Doctrine\DBAL\Schema\TableDiff

getBigIntTypeDeclarationSQL() public method

{@inheritDoc}
public getBigIntTypeDeclarationSQL ( array $field )
$field array

getBinaryDefaultLength() public method

getBinaryMaxLength() public method

public getBinaryMaxLength ( )

getBinaryTypeDeclarationSQLSnippet() protected method

protected getBinaryTypeDeclarationSQLSnippet ( $length, $fixed )

getBlobTypeDeclarationSQL() public method

{@inheritDoc}
public getBlobTypeDeclarationSQL ( array $field )
$field array

getBooleanTypeDeclarationSQL() public method

{@inheritDoc}
public getBooleanTypeDeclarationSQL ( array $field )
$field array

getClobTypeDeclarationSQL() public method

{@inheritDoc}
public getClobTypeDeclarationSQL ( array $field )
$field array

getCloseActiveDatabaseConnectionsSQL() public method

This is useful to force DROP DATABASE operations which could fail because of active connections.
public getCloseActiveDatabaseConnectionsSQL ( string $database ) : string
$database string The name of the database to close currently active connections for.
return string

getCommentOnColumnSQL() public method

public getCommentOnColumnSQL ( $tableName, $columnName, $comment )

getCreateDatabaseSQL() public method

{@inheritDoc}
public getCreateDatabaseSQL ( $name )

getCreateSchemaSQL() public method

{@inheritDoc}
public getCreateSchemaSQL ( $schemaName )

getCreateSequenceSQL() public method

{@inheritDoc}
public getCreateSequenceSQL ( Doctrine\DBAL\Schema\Sequence $sequence )
$sequence Doctrine\DBAL\Schema\Sequence

getCreateViewSQL() public method

{@inheritDoc}
public getCreateViewSQL ( $name, $sql )

getDateArithmeticIntervalExpression() protected method

protected getDateArithmeticIntervalExpression ( $date, $operator, $interval, $unit )

getDateDiffExpression() public method

{@inheritDoc}
public getDateDiffExpression ( $date1, $date2 )

getDateTimeTypeDeclarationSQL() public method

{@inheritDoc}
public getDateTimeTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getDateTimeTzFormatString() public method

{@inheritDoc}

getDateTimeTzTypeDeclarationSQL() public method

{@inheritDoc}
public getDateTimeTzTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getDateTypeDeclarationSQL() public method

{@inheritDoc}
public getDateTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getDefaultSchemaName() public method

getDisallowDatabaseConnectionsSQL() public method

This is useful to force DROP DATABASE operations which could fail because of active connections.
public getDisallowDatabaseConnectionsSQL ( string $database ) : string
$database string The name of the database to disallow new connections for.
return string

getDropForeignKeySQL() public method

{@inheritDoc}
public getDropForeignKeySQL ( $foreignKey, $table )

getDropSequenceSQL() public method

{@inheritDoc}
public getDropSequenceSQL ( $sequence )

getDropViewSQL() public method

{@inheritDoc}
public getDropViewSQL ( $name )

getEmptyIdentityInsertSQL() public method

{@inheritDoc}
public getEmptyIdentityInsertSQL ( $quotedTableName, $quotedIdentifierColumnName )

getGuidExpression() public method

{@inheritDoc}
public getGuidExpression ( )

getGuidTypeDeclarationSQL() public method

{@inheritDoc}
public getGuidTypeDeclarationSQL ( array $field )
$field array

getIdentitySequenceName() public method

public getIdentitySequenceName ( $tableName, $columnName )

getIntegerTypeDeclarationSQL() public method

{@inheritDoc}
public getIntegerTypeDeclarationSQL ( array $field )
$field array

getListDatabasesSQL() public method

{@inheritDoc}
public getListDatabasesSQL ( )

getListNamespacesSQL() public method

{@inheritDoc}

getListSequencesSQL() public method

{@inheritDoc}
public getListSequencesSQL ( $database )

getListTableColumnsSQL() public method

{@inheritDoc}
public getListTableColumnsSQL ( $table, $database = null )

getListTableConstraintsSQL() public method

{@inheritDoc}
public getListTableConstraintsSQL ( $table )

getListTableForeignKeysSQL() public method

{@inheritDoc}
public getListTableForeignKeysSQL ( $table, $database = null )

getListTableIndexesSQL() public method

{@inheritDoc}
public getListTableIndexesSQL ( $table, $currentDatabase = null )

getListTablesSQL() public method

{@inheritDoc}
public getListTablesSQL ( )

getListViewsSQL() public method

{@inheritDoc}
public getListViewsSQL ( $database )

getLocateExpression() public method

{@inheritDoc}
public getLocateExpression ( $str, $substr, $startPos = false )

getName() public method

{@inheritDoc}
public getName ( )

getNowExpression() public method

{@inheritDoc}
public getNowExpression ( )

getReadLockSQL() public method

{@inheritDoc}
public getReadLockSQL ( )

getRegexpExpression() public method

{@inheritDoc}
public getRegexpExpression ( )

getRenameIndexSQL() protected method

protected getRenameIndexSQL ( $oldIndexName, Doctrine\DBAL\Schema\Index $index, $tableName )
$index Doctrine\DBAL\Schema\Index

getReservedKeywordsClass() protected method

{@inheritDoc}
protected getReservedKeywordsClass ( )

getSQLResultCasing() public method

PostgreSQL returns all column names in SQL result sets in lowercase.
public getSQLResultCasing ( $column )

getSequenceNextValSQL() public method

{@inheritDoc}
public getSequenceNextValSQL ( $sequenceName )

getSetTransactionIsolationSQL() public method

{@inheritDoc}
public getSetTransactionIsolationSQL ( $level )

getSmallIntTypeDeclarationSQL() public method

{@inheritDoc}
public getSmallIntTypeDeclarationSQL ( array $field )
$field array

getSubstringExpression() public method

{@inheritDoc}
public getSubstringExpression ( $value, $from, $length = null )

getTimeTypeDeclarationSQL() public method

{@inheritDoc}
public getTimeTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getTruncateTableSQL() public method

{@inheritDoc}
public getTruncateTableSQL ( $tableName, $cascade = false )

getVarcharMaxLength() public method

{@inheritDoc}
public getVarcharMaxLength ( )

getVarcharTypeDeclarationSQLSnippet() protected method

{@inheritDoc}
protected getVarcharTypeDeclarationSQLSnippet ( $length, $fixed )

hasNativeGuidType() public method

{@inheritDoc}
public hasNativeGuidType ( )

initializeDoctrineTypeMappings() protected method

{@inheritDoc}

prefersSequences() public method

{@inheritDoc}
public prefersSequences ( )

quoteStringLiteral() public method

public quoteStringLiteral ( $str )

setUseBooleanTrueFalseStrings() public method

Enables use of 'true'/'false' or otherwise 1 and 0 instead.

supportsCommentOnStatement() public method

{@inheritDoc}

supportsIdentityColumns() public method

{@inheritDoc}

supportsPartialIndexes() public method

supportsSchemas() public method

{@inheritDoc}
public supportsSchemas ( )

supportsSequences() public method

{@inheritDoc}
public supportsSequences ( )

usesSequenceEmulatedIdentityColumns() public method