C# Class Simple.Migrator.Providers.TransformationProvider

Base class for every transformation providers. A 'tranformation' is an operation that modifies the database.
Inheritance: ITransformationProvider
Afficher le fichier Open project: juanplopes/simple

Protected Properties

Свойство Type Description
_connection IDbConnection
_connectionString string
_dialect Dialect

Méthodes publiques

Méthode Description
AddCheckConstraint ( string name, string table, string checkSql ) : void
AddColumn ( string table, Column column ) : void
AddColumn ( string table, string sqlColumn ) : void
AddColumn ( string table, string column, DbType type ) : void

AddColumn(string, string, Type, int, ColumnProperty, object)

AddColumn ( string table, string column, DbType type, ColumnProperty property ) : void

AddColumn(string, string, Type, int, ColumnProperty, object)

AddColumn ( string table, string column, DbType type, int size ) : void

AddColumn(string, string, Type, int, ColumnProperty, object)

AddColumn ( string table, string column, DbType type, int size, ColumnProperty property ) : void

AddColumn(string, string, Type, int, ColumnProperty, object)

AddColumn ( string table, string column, DbType type, int size, ColumnProperty property, object defaultValue ) : void

Add a new column to an existing table.

AddColumn ( string table, string column, DbType type, object defaultValue ) : void
AddForeignKey ( string name, string primaryTable, string primaryColumn, string refTable, string refColumn ) : void

Append a foreign key (relation) between two tables. tables.

AddForeignKey ( string name, string primaryTable, string primaryColumn, string refTable, string refColumn, Simple.Migrator.Framework.ForeignKeyConstraint constraint ) : void
AddIndex ( string name, string table ) : void
AddPrimaryKey ( string name, string table ) : void

Append a primary key to a table.

AddTable ( string name ) : void

Add a new table

AddTable ( string name, string engine ) : void

Add a new table

AddTable ( string table, string engine, string columns ) : void
AddUniqueConstraint ( string name, string table ) : void
BeginTransaction ( ) : void

Starts a transaction. Called by the migration mediator.

ChangeColumn ( string table, Column column ) : void
ChangeColumn ( string table, string sqlColumn ) : void
ColumnExists ( string table, string column ) : bool
Commit ( ) : void

Commit the current transaction. Called by the migrations mediator.

ConstraintExists ( string table, string name ) : bool

Determines if a constraint exists.

Delete ( string table ) : int
Delete ( string table, string columns, string values ) : int
Dispose ( ) : void
ExecuteNonQuery ( string sql ) : int
ExecuteQuery ( string sql ) : IDataReader

Execute an SQL query returning results.

ExecuteScalar ( string sql ) : object
GenerateForeignKey ( string primaryTable, string refTable ) : void
GenerateForeignKey ( string primaryTable, string refTable, Simple.Migrator.Framework.ForeignKeyConstraint constraint ) : void
GenerateForeignKey ( string primaryTable, string primaryColumn, string refTable, string refColumn ) : void

Guesses the name of the foreign key and add it

GenerateForeignKey ( string primaryTable, string primaryColumn, string refTable, string refColumn, Simple.Migrator.Framework.ForeignKeyConstraint constraint ) : void

Guesses the name of the foreign key and add it

GetColumnByName ( string table, string columnName ) : Column
GetColumns ( string table ) : Column[]
GetCommand ( ) : IDbCommand
GetPrimaryKeys ( IEnumerable columns ) : List
GetTables ( ) : string[]
Insert ( string table, string columns, string values ) : int
IsThisProvider ( string provider ) : bool
JoinColumnsAndValues ( string columns, string values ) : string
MigrationApplied ( long version ) : void

Marks a Migration version number as having been applied

MigrationUnApplied ( long version ) : void

Marks a Migration version number as having been rolled back from the database

PrimaryKeyExists ( string table, string name ) : bool
QuoteValues ( string values ) : string
QuoteValues ( string values ) : string[]
RemoveColumn ( string table, string column ) : void
RemoveConstraint ( string table, string name ) : void
RemoveForeignKey ( string table, string name ) : void
RemoveIndex ( string name, string table ) : void
RemoveTable ( string name ) : void
RenameColumn ( string tableName, string oldColumnName, string newColumnName ) : void
RenameTable ( string oldName, string newName ) : void
Rollback ( ) : void

Rollback the current migration. Called by the migration mediator.

SchemaInfoName ( string schemainfoname ) : void
Select ( string what, string from ) : IDataReader
Select ( string what, string from, string where ) : IDataReader
Select ( string what, string from, string where, string orderBy ) : IDataReader
SelectScalar ( string what, string from ) : object
SelectScalar ( string what, string from, string where ) : object
SelectScalar ( string what, string from, string where, string orderBy ) : object
TableExists ( string table ) : bool
Update ( string table, string columns, string values ) : int
Update ( string table, string columns, string values, string where ) : int
this ( string provider ) : ITransformationProvider

Méthodes protégées

Méthode Description
CreateSchemaInfoTable ( ) : void
EnsureHasConnection ( ) : void
JoinColumns ( IEnumerable columns ) : string
JoinColumnsAndIndexes ( IEnumerable columns ) : string
JoinIndexes ( IEnumerable columns ) : string
TransformationProvider ( Dialect dialect, string invariantProvider, string connectionString ) : System

Private Methods

Méthode Description
BuildCommand ( string sql ) : IDbCommand

Method Details

AddCheckConstraint() public méthode

public AddCheckConstraint ( string name, string table, string checkSql ) : void
name string
table string
checkSql string
Résultat void

AddColumn() public méthode

public AddColumn ( string table, Column column ) : void
table string
column Column
Résultat void

AddColumn() public méthode

public AddColumn ( string table, string sqlColumn ) : void
table string
sqlColumn string
Résultat void

AddColumn() public méthode

AddColumn(string, string, Type, int, ColumnProperty, object)
public AddColumn ( string table, string column, DbType type ) : void
table string
column string
type DbType
Résultat void

AddColumn() public méthode

AddColumn(string, string, Type, int, ColumnProperty, object)
public AddColumn ( string table, string column, DbType type, ColumnProperty property ) : void
table string
column string
type DbType
property ColumnProperty
Résultat void

AddColumn() public méthode

AddColumn(string, string, Type, int, ColumnProperty, object)
public AddColumn ( string table, string column, DbType type, int size ) : void
table string
column string
type DbType
size int
Résultat void

AddColumn() public méthode

AddColumn(string, string, Type, int, ColumnProperty, object)
public AddColumn ( string table, string column, DbType type, int size, ColumnProperty property ) : void
table string
column string
type DbType
size int
property ColumnProperty
Résultat void

AddColumn() public méthode

Add a new column to an existing table.
public AddColumn ( string table, string column, DbType type, int size, ColumnProperty property, object defaultValue ) : void
table string Table to which to add the column
column string Column name
type DbType Date type of the column
size int Max length of the column
property ColumnProperty Properties of the column, see ColumnProperty,
defaultValue object Default value
Résultat void

AddColumn() public méthode

public AddColumn ( string table, string column, DbType type, object defaultValue ) : void
table string
column string
type DbType
defaultValue object
Résultat void

AddForeignKey() public méthode

Append a foreign key (relation) between two tables. tables.
public AddForeignKey ( string name, string primaryTable, string primaryColumn, string refTable, string refColumn ) : void
name string Constraint name
primaryTable string Table name containing the primary key
primaryColumn string Primary key column name
refTable string Foreign table name
refColumn string Foreign column name
Résultat void

AddForeignKey() public méthode

public AddForeignKey ( string name, string primaryTable, string primaryColumn, string refTable, string refColumn, Simple.Migrator.Framework.ForeignKeyConstraint constraint ) : void
name string
primaryTable string
primaryColumn string
refTable string
refColumn string
constraint Simple.Migrator.Framework.ForeignKeyConstraint
Résultat void

AddIndex() public méthode

public AddIndex ( string name, string table ) : void
name string
table string
Résultat void

AddPrimaryKey() public méthode

Append a primary key to a table.
public AddPrimaryKey ( string name, string table ) : void
name string Constraint name
table string Table name
Résultat void

AddTable() public méthode

Add a new table
public AddTable ( string name ) : void
name string Table name
Résultat void

AddTable() public méthode

Add a new table
public AddTable ( string name, string engine ) : void
name string Table name
engine string the database storage engine to use
Résultat void

AddTable() public méthode

public AddTable ( string table, string engine, string columns ) : void
table string
engine string
columns string
Résultat void

AddUniqueConstraint() public méthode

public AddUniqueConstraint ( string name, string table ) : void
name string
table string
Résultat void

BeginTransaction() public méthode

Starts a transaction. Called by the migration mediator.
public BeginTransaction ( ) : void
Résultat void

ChangeColumn() public méthode

public ChangeColumn ( string table, Column column ) : void
table string
column Column
Résultat void

ChangeColumn() public méthode

public ChangeColumn ( string table, string sqlColumn ) : void
table string
sqlColumn string
Résultat void

ColumnExists() public méthode

public ColumnExists ( string table, string column ) : bool
table string
column string
Résultat bool

Commit() public méthode

Commit the current transaction. Called by the migrations mediator.
public Commit ( ) : void
Résultat void

ConstraintExists() public abstract méthode

Determines if a constraint exists.
public abstract ConstraintExists ( string table, string name ) : bool
table string Table owning the constraint
name string Constraint name
Résultat bool

CreateSchemaInfoTable() protected méthode

protected CreateSchemaInfoTable ( ) : void
Résultat void

Delete() public méthode

public Delete ( string table ) : int
table string
Résultat int

Delete() public méthode

public Delete ( string table, string columns, string values ) : int
table string
columns string
values string
Résultat int

Dispose() public méthode

public Dispose ( ) : void
Résultat void

EnsureHasConnection() protected méthode

protected EnsureHasConnection ( ) : void
Résultat void

ExecuteNonQuery() public méthode

public ExecuteNonQuery ( string sql ) : int
sql string
Résultat int

ExecuteQuery() public méthode

Execute an SQL query returning results.
public ExecuteQuery ( string sql ) : IDataReader
sql string The SQL command.
Résultat IDataReader

ExecuteScalar() public méthode

public ExecuteScalar ( string sql ) : object
sql string
Résultat object

GenerateForeignKey() public méthode

public GenerateForeignKey ( string primaryTable, string refTable ) : void
primaryTable string
refTable string
Résultat void

GenerateForeignKey() public méthode

public GenerateForeignKey ( string primaryTable, string refTable, Simple.Migrator.Framework.ForeignKeyConstraint constraint ) : void
primaryTable string
refTable string
constraint Simple.Migrator.Framework.ForeignKeyConstraint
Résultat void

GenerateForeignKey() public méthode

Guesses the name of the foreign key and add it
public GenerateForeignKey ( string primaryTable, string primaryColumn, string refTable, string refColumn ) : void
primaryTable string
primaryColumn string
refTable string
refColumn string
Résultat void

GenerateForeignKey() public méthode

Guesses the name of the foreign key and add it
public GenerateForeignKey ( string primaryTable, string primaryColumn, string refTable, string refColumn, Simple.Migrator.Framework.ForeignKeyConstraint constraint ) : void
primaryTable string
primaryColumn string
refTable string
refColumn string
constraint Simple.Migrator.Framework.ForeignKeyConstraint
Résultat void

GetColumnByName() public méthode

public GetColumnByName ( string table, string columnName ) : Column
table string
columnName string
Résultat Column

GetColumns() public méthode

public GetColumns ( string table ) : Column[]
table string
Résultat Column[]

GetCommand() public méthode

public GetCommand ( ) : IDbCommand
Résultat IDbCommand

GetPrimaryKeys() public méthode

public GetPrimaryKeys ( IEnumerable columns ) : List
columns IEnumerable
Résultat List

GetTables() public méthode

public GetTables ( ) : string[]
Résultat string[]

Insert() public méthode

public Insert ( string table, string columns, string values ) : int
table string
columns string
values string
Résultat int

IsThisProvider() public méthode

public IsThisProvider ( string provider ) : bool
provider string
Résultat bool

JoinColumns() protected méthode

protected JoinColumns ( IEnumerable columns ) : string
columns IEnumerable
Résultat string

JoinColumnsAndIndexes() protected méthode

protected JoinColumnsAndIndexes ( IEnumerable columns ) : string
columns IEnumerable
Résultat string

JoinColumnsAndValues() public méthode

public JoinColumnsAndValues ( string columns, string values ) : string
columns string
values string
Résultat string

JoinIndexes() protected méthode

protected JoinIndexes ( IEnumerable columns ) : string
columns IEnumerable
Résultat string

MigrationApplied() public méthode

Marks a Migration version number as having been applied
public MigrationApplied ( long version ) : void
version long The version number of the migration that was applied
Résultat void

MigrationUnApplied() public méthode

Marks a Migration version number as having been rolled back from the database
public MigrationUnApplied ( long version ) : void
version long The version number of the migration that was removed
Résultat void

PrimaryKeyExists() public méthode

public PrimaryKeyExists ( string table, string name ) : bool
table string
name string
Résultat bool

QuoteValues() public méthode

public QuoteValues ( string values ) : string
values string
Résultat string

QuoteValues() public méthode

public QuoteValues ( string values ) : string[]
values string
Résultat string[]

RemoveColumn() public méthode

public RemoveColumn ( string table, string column ) : void
table string
column string
Résultat void

RemoveConstraint() public méthode

public RemoveConstraint ( string table, string name ) : void
table string
name string
Résultat void

RemoveForeignKey() public méthode

public RemoveForeignKey ( string table, string name ) : void
table string
name string
Résultat void

RemoveIndex() public méthode

public RemoveIndex ( string name, string table ) : void
name string
table string
Résultat void

RemoveTable() public méthode

public RemoveTable ( string name ) : void
name string
Résultat void

RenameColumn() public méthode

public RenameColumn ( string tableName, string oldColumnName, string newColumnName ) : void
tableName string
oldColumnName string
newColumnName string
Résultat void

RenameTable() public méthode

public RenameTable ( string oldName, string newName ) : void
oldName string
newName string
Résultat void

Rollback() public méthode

Rollback the current migration. Called by the migration mediator.
public Rollback ( ) : void
Résultat void

SchemaInfoName() public méthode

public SchemaInfoName ( string schemainfoname ) : void
schemainfoname string
Résultat void

Select() public méthode

public Select ( string what, string from ) : IDataReader
what string
from string
Résultat IDataReader

Select() public méthode

public Select ( string what, string from, string where ) : IDataReader
what string
from string
where string
Résultat IDataReader

Select() public méthode

public Select ( string what, string from, string where, string orderBy ) : IDataReader
what string
from string
where string
orderBy string
Résultat IDataReader

SelectScalar() public méthode

public SelectScalar ( string what, string from ) : object
what string
from string
Résultat object

SelectScalar() public méthode

public SelectScalar ( string what, string from, string where ) : object
what string
from string
where string
Résultat object

SelectScalar() public méthode

public SelectScalar ( string what, string from, string where, string orderBy ) : object
what string
from string
where string
orderBy string
Résultat object

TableExists() public méthode

public TableExists ( string table ) : bool
table string
Résultat bool

TransformationProvider() protected méthode

protected TransformationProvider ( Dialect dialect, string invariantProvider, string connectionString ) : System
dialect Dialect
invariantProvider string
connectionString string
Résultat System

Update() public méthode

public Update ( string table, string columns, string values ) : int
table string
columns string
values string
Résultat int

Update() public méthode

public Update ( string table, string columns, string values, string where ) : int
table string
columns string
values string
where string
Résultat int

this() public méthode

public this ( string provider ) : ITransformationProvider
provider string
Résultat ITransformationProvider

Property Details

_connection protected_oe property

protected IDbConnection _connection
Résultat IDbConnection

_connectionString protected_oe property

protected string _connectionString
Résultat string

_dialect protected_oe property

protected Dialect,Simple.Migrator.Providers _dialect
Résultat Dialect