C# Class NMigrations.Sql.SqlServer.SqlServerProvider

Inheritance: GenericSqlProvider
显示文件 Open project: sklose/NMigrations

Public Methods

Method Description
GetQuerySeparator ( ) : string

Gets the SQL command that separates multiple SQL queries in one SQL script file of each other.

SqlServerProvider ( ) : System

Initializes a new instance of the SqlServerProvider class.

Protected Methods

Method Description
BuildAutoIncrement ( int seed, int step ) : string

Builds the SQL fragment that describes an auto-increment column.

BuildDataType ( SqlTypes type, int length, int scale, int precision ) : string

Builds the String that represents the specified type.

BuildRenameColumn ( Column column ) : IEnumerable

Builds the SQL commands that rename the specified column.

DropDefaultConstraint ( DefaultConstraint defaultConstraint ) : IEnumerable

Enumerates the SQL commands that are necessary to drop the specified defaultConstraint.

DropPrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : IEnumerable

Enumerates the SQL commands that are necessary to drop the specified primary key constraint (pk).

EscapeColumnName ( string columnName ) : string

Escapes the specified columnName.

EscapeConstraintName ( string constraintName ) : string

Escapes the specified constraintName.

EscapeTableName ( string tableName ) : string

Escapes the specified tableName

Method Details

BuildAutoIncrement() protected method

Builds the SQL fragment that describes an auto-increment column.
protected BuildAutoIncrement ( int seed, int step ) : string
seed int The initial value.
step int The increment step.
return string

BuildDataType() protected method

Builds the String that represents the specified type.
protected BuildDataType ( SqlTypes type, int length, int scale, int precision ) : string
type SqlTypes The type.
length int The length.
scale int The scale.
precision int The precision.
return string

BuildRenameColumn() protected method

Builds the SQL commands that rename the specified column.
protected BuildRenameColumn ( Column column ) : IEnumerable
column Column The column.
return IEnumerable

DropDefaultConstraint() protected method

Enumerates the SQL commands that are necessary to drop the specified defaultConstraint.
protected DropDefaultConstraint ( DefaultConstraint defaultConstraint ) : IEnumerable
defaultConstraint DefaultConstraint The default constraint.
return IEnumerable

DropPrimaryKeyConstraint() protected method

Enumerates the SQL commands that are necessary to drop the specified primary key constraint (pk).
protected DropPrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : IEnumerable
pk PrimaryKeyConstraint The primary key constraint.
return IEnumerable

EscapeColumnName() protected method

Escapes the specified columnName.
protected EscapeColumnName ( string columnName ) : string
columnName string Name of the column.
return string

EscapeConstraintName() protected method

Escapes the specified constraintName.
protected EscapeConstraintName ( string constraintName ) : string
constraintName string Name of the constraint.
return string

EscapeTableName() protected method

Escapes the specified tableName
protected EscapeTableName ( string tableName ) : string
tableName string Name of the table.
return string

GetQuerySeparator() public method

Gets the SQL command that separates multiple SQL queries in one SQL script file of each other.
public GetQuerySeparator ( ) : string
return string

SqlServerProvider() public method

Initializes a new instance of the SqlServerProvider class.
public SqlServerProvider ( ) : System
return System