C# 클래스 NMigrations.Sql.GenericSqlProvider

A general SQL generator implementation that implements the aspects that are common to all SQL dialects. Differences in SQL dialects are applied by subclassing GenericSqlProvider and overriding the specific methods.
상속: ISqlProvider
파일 보기 프로젝트 열기: sklose/NMigrations

공개 메소드들

메소드 설명
GenerateSqlCommands ( Database database ) : IEnumerable

Generates the SQL commands for the specified database.

GetDefaultConstraintName ( string tableName, string columnName ) : string

Builds the name for a default constraint.

GetForeignKeyConstraintName ( string tableName, string columnNames, string relatedTableName, string relatedColumnNames ) : string

Builds the name for a foreign key constraint.

GetIndexName ( string tableName, string columnNames ) : string

Builds the name for an index.

GetPrimaryKeyConstraintName ( string tableName, string columnNames ) : string

Builds the name for a primary key constraint.

GetQuerySeparator ( ) : string

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

GetUniqueConstraintName ( string tableName, string columnNames ) : string

Builds the name for a unique constraint.

보호된 메소드들

메소드 설명
AddDefaultConstraint ( DefaultConstraint defaultConstraint ) : IEnumerable

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

AddForeignKeyConstraint ( ForeignKeyConstraint fk ) : IEnumerable

Enumerates the SQL commands that are necessary to create the specified foreign key constraint (fk).

AddPrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : IEnumerable

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

AddUniqueConstraint ( UniqueConstraint uniqueConstraint ) : IEnumerable

Enumerates the SQL commands that are necessary to create the specified uniqueConstraint.

AlterTable ( Table table ) : IEnumerable

Enumerates the SQL commands that are necessary to alter the specified table.

BuildAddColumn ( Column column ) : IEnumerable

Builds the SQL commands that adds the specified Column to its table.

BuildAlterColumnProperties ( Column column ) : IEnumerable

Builds the SQL commands that change the specified column's data type.

BuildAutoIncrement ( int seed, int step ) : string

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

BuildCreateTableColumn ( Column column ) : string

Builds the SQL fragment that describes a column in a CREATE TABLE statement.

BuildCreateTableConstraints ( Table table ) : IEnumerable

Builds the SQL fragments that follow after the column list in the CREATE TABLE statement (like constraints or indices).

BuildCreateTableForeignKeyConstraint ( ForeignKeyConstraint fk ) : string

Builds the SQL fragment that describes a foreign key constraint within a CREATE TABLE statement.

BuildCreateTablePrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : string

Builds the SQL fragment that describes a primary key constraint within a CREATE TABLE statement.

BuildCreateTableUniqueConstraint ( UniqueConstraint uniqueConstraint ) : string

Builds the SQL fragment that describes a unqiue constraint within a CREATE TABLE statement.

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

Builds the String that represents the specified type.

BuildDropColumn ( Column column ) : IEnumerable

Builds the SQL commands that drops the specified column from its table.

BuildDropDefault ( Column column ) : IEnumerable

Builds the SQL commands that drops the default value for the specified column.

BuildRenameColumn ( Column column ) : IEnumerable

Builds the SQL commands that renames the specified column.

CreateIndex ( System.Data.Common.Index index ) : IEnumerable

Enumerates the SQL commands that are necessary to create the specified index.

CreateTable ( Table table ) : IEnumerable

Enumerates the SQL commands that are necessary to create the specified table.

DropConstraint ( Constraint constraint ) : IEnumerable

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

DropDefaultConstraint ( DefaultConstraint defaultConstraint ) : IEnumerable

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

DropForeignKeyConstraint ( ForeignKeyConstraint fk ) : IEnumerable

Enumerates the SQL commands that are necessary to drop the specified foreign key constraint (fk).

DropIndex ( System.Data.Common.Index index ) : IEnumerable

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

DropPrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : IEnumerable

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

DropTable ( Table table ) : IEnumerable

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

DropUniqueConstraint ( UniqueConstraint uniqueConstraint ) : IEnumerable

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

EscapeColumnName ( string columnName ) : string

Escapes the specified columnName.

EscapeColumnNames ( string columnNames ) : string[]

Applies the EscapeColumnName method to an array of column names.

EscapeConstraintName ( string constraintName ) : string

Escapes the specified constraintName.

EscapeString ( string value ) : string

Escapes the specified string value that it can be surrounded by StringQuotes and used in a SQL query.

EscapeTableName ( string tableName ) : string

Escapes the specified tableName

ExecuteSqlStatement ( SqlStatement sql ) : IEnumerable

Enumerates the SQL commands that are necessary to execute the specified sql statement.

FormatValue ( object value ) : string

Formats the specified value according the described data type that it can be used in a SQL statement.

Insert ( Insert insert ) : IEnumerable

Generates the SQL statements that inserts the row described by the specified insert object into the database.

Update ( Update update ) : IEnumerable

Generates the SQL statements that updates rows described by the specified update object.

메소드 상세

AddDefaultConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to create the specified defaultConstraint.
protected AddDefaultConstraint ( DefaultConstraint defaultConstraint ) : IEnumerable
defaultConstraint DefaultConstraint The default constraint.
리턴 IEnumerable

AddForeignKeyConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to create the specified foreign key constraint (fk).
protected AddForeignKeyConstraint ( ForeignKeyConstraint fk ) : IEnumerable
fk ForeignKeyConstraint The foreign key constraint.
리턴 IEnumerable

AddPrimaryKeyConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to create the specified primary key constraint (pk).
protected AddPrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : IEnumerable
pk PrimaryKeyConstraint The primary key constraint.
리턴 IEnumerable

AddUniqueConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to create the specified uniqueConstraint.
protected AddUniqueConstraint ( UniqueConstraint uniqueConstraint ) : IEnumerable
uniqueConstraint UniqueConstraint The unique constraint.
리턴 IEnumerable

AlterTable() 보호된 메소드

Enumerates the SQL commands that are necessary to alter the specified table.
protected AlterTable ( Table table ) : IEnumerable
table Table The table to alter.
리턴 IEnumerable

BuildAddColumn() 보호된 메소드

Builds the SQL commands that adds the specified Column to its table.
protected BuildAddColumn ( Column column ) : IEnumerable
column Column The column.
리턴 IEnumerable

BuildAlterColumnProperties() 보호된 메소드

Builds the SQL commands that change the specified column's data type.
protected BuildAlterColumnProperties ( Column column ) : IEnumerable
column Column The column.
리턴 IEnumerable

BuildAutoIncrement() 보호된 추상적인 메소드

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

BuildCreateTableColumn() 보호된 메소드

Builds the SQL fragment that describes a column in a CREATE TABLE statement.
protected BuildCreateTableColumn ( Column column ) : string
column Column The column.
리턴 string

BuildCreateTableConstraints() 보호된 메소드

Builds the SQL fragments that follow after the column list in the CREATE TABLE statement (like constraints or indices).
protected BuildCreateTableConstraints ( Table table ) : IEnumerable
table Table The table.
리턴 IEnumerable

BuildCreateTableForeignKeyConstraint() 보호된 메소드

Builds the SQL fragment that describes a foreign key constraint within a CREATE TABLE statement.
protected BuildCreateTableForeignKeyConstraint ( ForeignKeyConstraint fk ) : string
fk ForeignKeyConstraint The foreign key constraint.
리턴 string

BuildCreateTablePrimaryKeyConstraint() 보호된 메소드

Builds the SQL fragment that describes a primary key constraint within a CREATE TABLE statement.
protected BuildCreateTablePrimaryKeyConstraint ( PrimaryKeyConstraint pk ) : string
pk PrimaryKeyConstraint The primary key constraint.
리턴 string

BuildCreateTableUniqueConstraint() 보호된 메소드

Builds the SQL fragment that describes a unqiue constraint within a CREATE TABLE statement.
protected BuildCreateTableUniqueConstraint ( UniqueConstraint uniqueConstraint ) : string
uniqueConstraint UniqueConstraint The unique constraint.
리턴 string

BuildDataType() 보호된 추상적인 메소드

Builds the String that represents the specified type.
protected abstract 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.
리턴 string

BuildDropColumn() 보호된 메소드

Builds the SQL commands that drops the specified column from its table.
protected BuildDropColumn ( Column column ) : IEnumerable
column Column The column.
리턴 IEnumerable

BuildDropDefault() 보호된 메소드

Builds the SQL commands that drops the default value for the specified column.
protected BuildDropDefault ( Column column ) : IEnumerable
column Column The column.
리턴 IEnumerable

BuildRenameColumn() 보호된 메소드

Builds the SQL commands that renames the specified column.
protected BuildRenameColumn ( Column column ) : IEnumerable
column Column The column.
리턴 IEnumerable

CreateIndex() 보호된 메소드

Enumerates the SQL commands that are necessary to create the specified index.
protected CreateIndex ( System.Data.Common.Index index ) : IEnumerable
index System.Data.Common.Index The index to create.
리턴 IEnumerable

CreateTable() 보호된 메소드

Enumerates the SQL commands that are necessary to create the specified table.
protected CreateTable ( Table table ) : IEnumerable
table Table The table to create.
리턴 IEnumerable

DropConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to drop the specified constraint.
protected DropConstraint ( Constraint constraint ) : IEnumerable
constraint Constraint The constraint to drop.
리턴 IEnumerable

DropDefaultConstraint() 보호된 메소드

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

DropForeignKeyConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to drop the specified foreign key constraint (fk).
protected DropForeignKeyConstraint ( ForeignKeyConstraint fk ) : IEnumerable
fk ForeignKeyConstraint The foreign key constraint.
리턴 IEnumerable

DropIndex() 보호된 메소드

Enumerates the SQL commands that are necessary to drop the specified index.
protected DropIndex ( System.Data.Common.Index index ) : IEnumerable
index System.Data.Common.Index The index to drop.
리턴 IEnumerable

DropPrimaryKeyConstraint() 보호된 메소드

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.
리턴 IEnumerable

DropTable() 보호된 메소드

Enumerates the SQL commands that are necessary to drop the specified table.
protected DropTable ( Table table ) : IEnumerable
table Table The table to drop.
리턴 IEnumerable

DropUniqueConstraint() 보호된 메소드

Enumerates the SQL commands that are necessary to drop the specified uniqueConstraint.
protected DropUniqueConstraint ( UniqueConstraint uniqueConstraint ) : IEnumerable
uniqueConstraint UniqueConstraint The unique constraint.
리턴 IEnumerable

EscapeColumnName() 보호된 추상적인 메소드

Escapes the specified columnName.
protected abstract EscapeColumnName ( string columnName ) : string
columnName string Name of the column.
리턴 string

EscapeColumnNames() 보호된 메소드

Applies the EscapeColumnName method to an array of column names.
protected EscapeColumnNames ( string columnNames ) : string[]
columnNames string The column names.
리턴 string[]

EscapeConstraintName() 보호된 추상적인 메소드

Escapes the specified constraintName.
protected abstract EscapeConstraintName ( string constraintName ) : string
constraintName string Name of the constraint.
리턴 string

EscapeString() 보호된 메소드

Escapes the specified string value that it can be surrounded by StringQuotes and used in a SQL query.
protected EscapeString ( string value ) : string
value string The string value to escape.
리턴 string

EscapeTableName() 보호된 추상적인 메소드

Escapes the specified tableName
protected abstract EscapeTableName ( string tableName ) : string
tableName string Name of the table.
리턴 string

ExecuteSqlStatement() 보호된 메소드

Enumerates the SQL commands that are necessary to execute the specified sql statement.
protected ExecuteSqlStatement ( SqlStatement sql ) : IEnumerable
sql SqlStatement The SQL statement.
리턴 IEnumerable

FormatValue() 보호된 메소드

Formats the specified value according the described data type that it can be used in a SQL statement.
protected FormatValue ( object value ) : string
value object The value.
리턴 string

GenerateSqlCommands() 공개 메소드

Generates the SQL commands for the specified database.
public GenerateSqlCommands ( Database database ) : IEnumerable
database Database The database.
리턴 IEnumerable

GetDefaultConstraintName() 공개 메소드

Builds the name for a default constraint.
public GetDefaultConstraintName ( string tableName, string columnName ) : string
tableName string Name of the table.
columnName string The column name.
리턴 string

GetForeignKeyConstraintName() 공개 메소드

Builds the name for a foreign key constraint.
public GetForeignKeyConstraintName ( string tableName, string columnNames, string relatedTableName, string relatedColumnNames ) : string
tableName string Name of the table.
columnNames string The column names.
relatedTableName string Name of the related table.
relatedColumnNames string The related column names.
리턴 string

GetIndexName() 공개 메소드

Builds the name for an index.
public GetIndexName ( string tableName, string columnNames ) : string
tableName string Name of the table.
columnNames string The column names.
리턴 string

GetPrimaryKeyConstraintName() 공개 메소드

Builds the name for a primary key constraint.
public GetPrimaryKeyConstraintName ( string tableName, string columnNames ) : string
tableName string Name of the table.
columnNames string The column names.
리턴 string

GetQuerySeparator() 공개 추상적인 메소드

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

GetUniqueConstraintName() 공개 메소드

Builds the name for a unique constraint.
public GetUniqueConstraintName ( string tableName, string columnNames ) : string
tableName string Name of the table.
columnNames string The column names.
리턴 string

Insert() 보호된 메소드

Generates the SQL statements that inserts the row described by the specified insert object into the database.
protected Insert ( Insert insert ) : IEnumerable
insert Insert The insert containing the row to insert.
리턴 IEnumerable

Update() 보호된 메소드

Generates the SQL statements that updates rows described by the specified update object.
protected Update ( Update update ) : IEnumerable
update Update The update command.
리턴 IEnumerable