PHP Class Doctrine\DBAL\Platforms\SQLServerPlatform

Since: 2.0
Author: Roman Borschel ([email protected])
Author: Jonathan H. Wage ([email protected])
Author: Benjamin Eberlei ([email protected])
Author: Steve Müller ([email protected])
Inheritance: extends Doctrine\DBAL\Platforms\AbstractPlatform
Afficher le fichier Open project: doctrine/dbal Class Usage Examples

Méthodes publiques

Méthode Description
appendLockHint ( $fromClause, $lockMode ) {@inheritDoc}
convertBooleans ( $item ) {@inheritDoc}
createSavePoint ( $savepoint ) {@inheritDoc}
getAddExtendedPropertySQL ( string $name, string | null $value = null, string | null $level0Type = null, string | null $level0Name = null, string | null $level1Type = null, string | null $level1Name = null, string | null $level2Type = null, string | null $level2Name = null ) : string Returns the SQL statement for adding an extended property to a database object.
getAlterTableSQL ( Doctrine\DBAL\Schema\TableDiff $diff ) {@inheritDoc}
getBigIntTypeDeclarationSQL ( array $field ) {@inheritDoc}
getBinaryMaxLength ( )
getBlobTypeDeclarationSQL ( array $field ) {@inheritDoc}
getBooleanTypeDeclarationSQL ( array $field ) {@inheritDoc}
getClobTypeDeclarationSQL ( array $field ) {@inheritDoc}
getColumnDeclarationSQL ( $name, array $field )
getConcatExpression ( ) {@inheritDoc}
getCreateDatabaseSQL ( $name ) {@inheritDoc}
getCreateIndexSQL ( Doctrine\DBAL\Schema\Index $index, $table ) {@inheritDoc}
getCreatePrimaryKeySQL ( Doctrine\DBAL\Schema\Index $index, $table ) {@inheritDoc}
getCreateSchemaSQL ( $schemaName ) {@inheritDoc}
getCreateTemporaryTableSnippetSQL ( ) {@inheritDoc}
getCreateViewSQL ( $name, $sql ) {@inheritDoc}
getDateDiffExpression ( $date1, $date2 ) {@inheritDoc}
getDateFormatString ( ) {@inheritDoc}
getDateTimeFormatString ( ) {@inheritDoc}
getDateTimeTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDateTimeTzFormatString ( ) {@inheritDoc}
getDateTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDefaultConstraintDeclarationSQL ( string $table, array $column ) : string Returns the SQL snippet for declaring a default constraint.
getDefaultSchemaName ( )
getDefaultValueDeclarationSQL ( $field ) {@inheritDoc}
getDropDatabaseSQL ( $name ) {@inheritDoc}
getDropExtendedPropertySQL ( string $name, string | null $level0Type = null, string | null $level0Name = null, string | null $level1Type = null, string | null $level1Name = null, string | null $level2Type = null, string | null $level2Name = null ) : string Returns the SQL statement for dropping an extended property from a database object.
getDropForeignKeySQL ( $foreignKey, $table ) {@inheritDoc}
getDropIndexSQL ( $index, $table = null ) {@inheritDoc}
getDropViewSQL ( $name ) {@inheritDoc}
getEmptyIdentityInsertSQL ( $quotedTableName, $quotedIdentifierColumnName ) {@inheritDoc}
getForUpdateSQL ( ) {@inheritDoc}
getForeignKeyReferentialActionSQL ( $action )
getGuidExpression ( ) {@inheritDoc}
getGuidTypeDeclarationSQL ( array $field ) {@inheritDoc}
getIntegerTypeDeclarationSQL ( array $field ) {@inheritDoc}
getLengthExpression ( $column ) {@inheritDoc}
getListDatabasesSQL ( ) {@inheritDoc}
getListNamespacesSQL ( ) {@inheritDoc}
getListTableColumnsSQL ( $table, $database = null ) {@inheritDoc}
getListTableForeignKeysSQL ( $table, $database = null ) {@inheritDoc}
getListTableIndexesSQL ( $table, $currentDatabase = null ) {@inheritDoc}
getListTablesSQL ( ) {@inheritDoc}
getListViewsSQL ( $database ) {@inheritDoc}
getLocateExpression ( $str, $substr, $startPos = false ) {@inheritDoc}
getModExpression ( $expression1, $expression2 ) {@inheritDoc}
getName ( ) {@inheritDoc}
getSetTransactionIsolationSQL ( $level ) {@inheritDoc}
getSmallIntTypeDeclarationSQL ( array $field ) {@inheritDoc}
getSubstringExpression ( $value, $from, $length = null ) {@inheritDoc}
getTemporaryTableName ( $tableName ) {@inheritDoc}
getTimeFormatString ( ) {@inheritDoc}
getTimeTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getTrimExpression ( $str, $pos = self::TRIM_UNSPECIFIED, $char = false ) {@inheritDoc}
getTruncateTableSQL ( $tableName, $cascade = false ) {@inheritDoc}
getUniqueConstraintDeclarationSQL ( $name, Doctrine\DBAL\Schema\Index $index ) {@inheritDoc}
getUpdateExtendedPropertySQL ( string $name, string | null $value = null, string | null $level0Type = null, string | null $level0Name = null, string | null $level1Type = null, string | null $level1Name = null, string | null $level2Type = null, string | null $level2Name = null ) : string Returns the SQL statement for updating an extended property of a database object.
hasNativeGuidType ( ) {@inheritDoc}
prefersIdentityColumns ( ) {@inheritDoc}
quoteSingleIdentifier ( $str ) {@inheritDoc}
releaseSavePoint ( $savepoint ) {@inheritDoc}
rollbackSavePoint ( $savepoint ) {@inheritDoc}
supportsColumnCollation ( ) {@inheritDoc}
supportsCreateDropDatabase ( ) {@inheritDoc}
supportsIdentityColumns ( ) {@inheritDoc}
supportsLimitOffset ( ) {@inheritDoc}
supportsReleaseSavepoints ( ) {@inheritDoc}
supportsSchemas ( )

Méthodes protégées

Méthode Description
_getCommonIntegerTypeDeclarationSQL ( array $columnDef ) {@inheritDoc}
_getCreateTableSQL ( $tableName, array $columns, array $options = [] ) {@inheritDoc}
doModifyLimitQuery ( $query, $limit, $offset = null ) {@inheritDoc}
getAlterColumnCommentSQL ( string $tableName, string $columnName, string $comment ) : string Returns the SQL statement for altering a column comment.
getBinaryTypeDeclarationSQLSnippet ( $length, $fixed )
getCreateColumnCommentSQL ( string $tableName, string $columnName, string $comment ) : string Returns the SQL statement for creating a column comment.
getCreateIndexSQLFlags ( Doctrine\DBAL\Schema\Index $index ) {@inheritDoc}
getDateArithmeticIntervalExpression ( $date, $operator, $interval, $unit )
getDropColumnCommentSQL ( string $tableName, string $columnName ) : string Returns the SQL statement for dropping a column comment.
getRenameIndexSQL ( $oldIndexName, Doctrine\DBAL\Schema\Index $index, $tableName )
getReservedKeywordsClass ( ) {@inheritDoc}
getVarcharTypeDeclarationSQLSnippet ( $length, $fixed ) {@inheritDoc}
initializeDoctrineTypeMappings ( ) {@inheritDoc}

Private Methods

Méthode Description
_appendUniqueConstraintDefinition ( string $sql, Doctrine\DBAL\Schema\Index $index ) : string Extend unique key constraint with required filters
alterColumnRequiresDropDefaultConstraint ( Doctrine\DBAL\Schema\ColumnDiff $columnDiff ) : boolean Checks whether a column alteration requires dropping its default constraint first.
generateDefaultConstraintName ( string $table, string $column ) : string Returns a unique default constraint name for a table and column.
generateIdentifierName ( string $identifier ) : string Returns a hash value for a given identifier.
getAlterTableAddDefaultConstraintClause ( string $tableName, Doctrine\DBAL\Schema\Column $column ) : string Returns the SQL clause for adding a default constraint in an ALTER TABLE statement.
getAlterTableDropDefaultConstraintClause ( string $tableName, string $columnName ) : string Returns the SQL clause for dropping an existing default constraint in an ALTER TABLE statement.
getTableWhereClause ( string $table, string $schemaColumn, string $tableColumn ) : string Returns the where clause to filter schema and table name in a query.
isOrderByInTopNSubquery ( string $query, integer $currentPosition ) : boolean Check an ORDER BY clause to see if it is in a TOP N query or subquery.
scrubInnerOrderBy ( $query ) : string Remove ORDER BY clauses in subqueries - they're not supported by SQL Server.

Method Details

_getCommonIntegerTypeDeclarationSQL() protected méthode

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

_getCreateTableSQL() protected méthode

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

appendLockHint() public méthode

{@inheritDoc}
public appendLockHint ( $fromClause, $lockMode )

convertBooleans() public méthode

{@inheritDoc}
public convertBooleans ( $item )

createSavePoint() public méthode

{@inheritDoc}
public createSavePoint ( $savepoint )

doModifyLimitQuery() protected méthode

{@inheritDoc}
protected doModifyLimitQuery ( $query, $limit, $offset = null )

getAddExtendedPropertySQL() public méthode

Returns the SQL statement for adding an extended property to a database object.
public getAddExtendedPropertySQL ( string $name, string | null $value = null, string | null $level0Type = null, string | null $level0Name = null, string | null $level1Type = null, string | null $level1Name = null, string | null $level2Type = null, string | null $level2Name = null ) : string
$name string The name of the property to add.
$value string | null The value of the property to add.
$level0Type string | null The type of the object at level 0 the property belongs to.
$level0Name string | null The name of the object at level 0 the property belongs to.
$level1Type string | null The type of the object at level 1 the property belongs to.
$level1Name string | null The name of the object at level 1 the property belongs to.
$level2Type string | null The type of the object at level 2 the property belongs to.
$level2Name string | null The name of the object at level 2 the property belongs to.
Résultat string

getAlterColumnCommentSQL() protected méthode

SQL Server does not support native column comments, therefore the extended properties functionality is used as a workaround to store them. The property name used to store column comments is "MS_Description" which provides compatibility with SQL Server Management Studio, as column comments are stored in the same property there when specifying a column's "Description" attribute.
protected getAlterColumnCommentSQL ( string $tableName, string $columnName, string $comment ) : string
$tableName string The quoted table name to which the column belongs.
$columnName string The quoted column name to alter the comment for.
$comment string The column's comment.
Résultat string

getAlterTableSQL() public méthode

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

getBigIntTypeDeclarationSQL() public méthode

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

getBinaryMaxLength() public méthode

public getBinaryMaxLength ( )

getBinaryTypeDeclarationSQLSnippet() protected méthode

protected getBinaryTypeDeclarationSQLSnippet ( $length, $fixed )

getBlobTypeDeclarationSQL() public méthode

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

getBooleanTypeDeclarationSQL() public méthode

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

getClobTypeDeclarationSQL() public méthode

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

getColumnDeclarationSQL() public méthode

Modifies column declaration order as it differs in Microsoft SQL Server.
public getColumnDeclarationSQL ( $name, array $field )
$field array

getConcatExpression() public méthode

{@inheritDoc}
public getConcatExpression ( )

getCreateColumnCommentSQL() protected méthode

SQL Server does not support native column comments, therefore the extended properties functionality is used as a workaround to store them. The property name used to store column comments is "MS_Description" which provides compatibility with SQL Server Management Studio, as column comments are stored in the same property there when specifying a column's "Description" attribute.
protected getCreateColumnCommentSQL ( string $tableName, string $columnName, string $comment ) : string
$tableName string The quoted table name to which the column belongs.
$columnName string The quoted column name to create the comment for.
$comment string The column's comment.
Résultat string

getCreateDatabaseSQL() public méthode

{@inheritDoc}
public getCreateDatabaseSQL ( $name )

getCreateIndexSQL() public méthode

{@inheritDoc}
public getCreateIndexSQL ( Doctrine\DBAL\Schema\Index $index, $table )
$index Doctrine\DBAL\Schema\Index

getCreateIndexSQLFlags() protected méthode

{@inheritDoc}
protected getCreateIndexSQLFlags ( Doctrine\DBAL\Schema\Index $index )
$index Doctrine\DBAL\Schema\Index

getCreatePrimaryKeySQL() public méthode

{@inheritDoc}
public getCreatePrimaryKeySQL ( Doctrine\DBAL\Schema\Index $index, $table )
$index Doctrine\DBAL\Schema\Index

getCreateSchemaSQL() public méthode

{@inheritDoc}
public getCreateSchemaSQL ( $schemaName )

getCreateTemporaryTableSnippetSQL() public méthode

{@inheritDoc}

getCreateViewSQL() public méthode

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

getDateArithmeticIntervalExpression() protected méthode

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

getDateDiffExpression() public méthode

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

getDateFormatString() public méthode

{@inheritDoc}
public getDateFormatString ( )

getDateTimeFormatString() public méthode

{@inheritDoc}

getDateTimeTypeDeclarationSQL() public méthode

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

getDateTimeTzFormatString() public méthode

{@inheritDoc}

getDateTypeDeclarationSQL() public méthode

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

getDefaultConstraintDeclarationSQL() public méthode

Returns the SQL snippet for declaring a default constraint.
public getDefaultConstraintDeclarationSQL ( string $table, array $column ) : string
$table string Name of the table to return the default constraint declaration for.
$column array Column definition.
Résultat string

getDefaultSchemaName() public méthode

getDefaultValueDeclarationSQL() public méthode

{@inheritDoc}
public getDefaultValueDeclarationSQL ( $field )

getDropColumnCommentSQL() protected méthode

SQL Server does not support native column comments, therefore the extended properties functionality is used as a workaround to store them. The property name used to store column comments is "MS_Description" which provides compatibility with SQL Server Management Studio, as column comments are stored in the same property there when specifying a column's "Description" attribute.
protected getDropColumnCommentSQL ( string $tableName, string $columnName ) : string
$tableName string The quoted table name to which the column belongs.
$columnName string The quoted column name to drop the comment for.
Résultat string

getDropDatabaseSQL() public méthode

{@inheritDoc}
public getDropDatabaseSQL ( $name )

getDropExtendedPropertySQL() public méthode

Returns the SQL statement for dropping an extended property from a database object.
public getDropExtendedPropertySQL ( string $name, string | null $level0Type = null, string | null $level0Name = null, string | null $level1Type = null, string | null $level1Name = null, string | null $level2Type = null, string | null $level2Name = null ) : string
$name string The name of the property to drop.
$level0Type string | null The type of the object at level 0 the property belongs to.
$level0Name string | null The name of the object at level 0 the property belongs to.
$level1Type string | null The type of the object at level 1 the property belongs to.
$level1Name string | null The name of the object at level 1 the property belongs to.
$level2Type string | null The type of the object at level 2 the property belongs to.
$level2Name string | null The name of the object at level 2 the property belongs to.
Résultat string

getDropForeignKeySQL() public méthode

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

getDropIndexSQL() public méthode

{@inheritDoc}
public getDropIndexSQL ( $index, $table = null )

getDropViewSQL() public méthode

{@inheritDoc}
public getDropViewSQL ( $name )

getEmptyIdentityInsertSQL() public méthode

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

getForUpdateSQL() public méthode

{@inheritDoc}
public getForUpdateSQL ( )

getForeignKeyReferentialActionSQL() public méthode

getGuidExpression() public méthode

{@inheritDoc}
public getGuidExpression ( )

getGuidTypeDeclarationSQL() public méthode

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

getIntegerTypeDeclarationSQL() public méthode

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

getLengthExpression() public méthode

{@inheritDoc}
public getLengthExpression ( $column )

getListDatabasesSQL() public méthode

{@inheritDoc}
public getListDatabasesSQL ( )

getListNamespacesSQL() public méthode

{@inheritDoc}

getListTableColumnsSQL() public méthode

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

getListTableForeignKeysSQL() public méthode

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

getListTableIndexesSQL() public méthode

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

getListTablesSQL() public méthode

{@inheritDoc}
public getListTablesSQL ( )

getListViewsSQL() public méthode

{@inheritDoc}
public getListViewsSQL ( $database )

getLocateExpression() public méthode

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

getModExpression() public méthode

{@inheritDoc}
public getModExpression ( $expression1, $expression2 )

getName() public méthode

{@inheritDoc}
public getName ( )

getRenameIndexSQL() protected méthode

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

getReservedKeywordsClass() protected méthode

{@inheritDoc}
protected getReservedKeywordsClass ( )

getSetTransactionIsolationSQL() public méthode

{@inheritDoc}
public getSetTransactionIsolationSQL ( $level )

getSmallIntTypeDeclarationSQL() public méthode

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

getSubstringExpression() public méthode

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

getTemporaryTableName() public méthode

{@inheritDoc}
public getTemporaryTableName ( $tableName )

getTimeFormatString() public méthode

{@inheritDoc}
public getTimeFormatString ( )

getTimeTypeDeclarationSQL() public méthode

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

getTrimExpression() public méthode

{@inheritDoc}
public getTrimExpression ( $str, $pos = self::TRIM_UNSPECIFIED, $char = false )

getTruncateTableSQL() public méthode

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

getUniqueConstraintDeclarationSQL() public méthode

{@inheritDoc}
public getUniqueConstraintDeclarationSQL ( $name, Doctrine\DBAL\Schema\Index $index )
$index Doctrine\DBAL\Schema\Index

getUpdateExtendedPropertySQL() public méthode

Returns the SQL statement for updating an extended property of a database object.
public getUpdateExtendedPropertySQL ( string $name, string | null $value = null, string | null $level0Type = null, string | null $level0Name = null, string | null $level1Type = null, string | null $level1Name = null, string | null $level2Type = null, string | null $level2Name = null ) : string
$name string The name of the property to update.
$value string | null The value of the property to update.
$level0Type string | null The type of the object at level 0 the property belongs to.
$level0Name string | null The name of the object at level 0 the property belongs to.
$level1Type string | null The type of the object at level 1 the property belongs to.
$level1Name string | null The name of the object at level 1 the property belongs to.
$level2Type string | null The type of the object at level 2 the property belongs to.
$level2Name string | null The name of the object at level 2 the property belongs to.
Résultat string

getVarcharTypeDeclarationSQLSnippet() protected méthode

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

hasNativeGuidType() public méthode

{@inheritDoc}
public hasNativeGuidType ( )

initializeDoctrineTypeMappings() protected méthode

{@inheritDoc}

prefersIdentityColumns() public méthode

Microsoft SQL Server prefers "autoincrement" identity columns since sequences can only be emulated with a table.

quoteSingleIdentifier() public méthode

{@inheritDoc}
public quoteSingleIdentifier ( $str )

releaseSavePoint() public méthode

{@inheritDoc}
public releaseSavePoint ( $savepoint )

rollbackSavePoint() public méthode

{@inheritDoc}
public rollbackSavePoint ( $savepoint )

supportsColumnCollation() public méthode

{@inheritDoc}

supportsCreateDropDatabase() public méthode

{@inheritDoc}

supportsIdentityColumns() public méthode

Microsoft SQL Server supports this through AUTO_INCREMENT columns.

supportsLimitOffset() public méthode

{@inheritDoc}
public supportsLimitOffset ( )

supportsReleaseSavepoints() public méthode

{@inheritDoc}

supportsSchemas() public méthode

public supportsSchemas ( )