Class SqlServerProcessor
Inheritance
Inherited Members
Namespace: FluentMigrator.Runner.Processors.SqlServer
Assembly: FluentMigrator.Runner.SqlServer.dll
Syntax
public class SqlServerProcessor : GenericProcessorBase, IMigrationProcessor, IQuerySchema, IDisposable
Constructors
SqlServerProcessor(IEnumerable<string>, IMigrationGenerator, IQuoter, ILogger, IOptionsSnapshot<ProcessorOptions>, IConnectionStringAccessor, IServiceProvider)
Declaration
protected SqlServerProcessor(IEnumerable<string> databaseTypes, IMigrationGenerator generator, IQuoter quoter, ILogger logger, IOptionsSnapshot<ProcessorOptions> options, IConnectionStringAccessor connectionStringAccessor, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | databaseTypes | |
IMigrationGenerator | generator | |
IQuoter | quoter | |
ILogger | logger | |
IOptionsSnapshot<ProcessorOptions> | options | |
IConnectionStringAccessor | connectionStringAccessor | |
IServiceProvider | serviceProvider |
SqlServerProcessor(IEnumerable<string>, DbProviderFactory, IMigrationGenerator, IQuoter, ILogger, IOptionsSnapshot<ProcessorOptions>, IConnectionStringAccessor, IServiceProvider)
Declaration
protected SqlServerProcessor(IEnumerable<string> databaseTypes, DbProviderFactory factory, IMigrationGenerator generator, IQuoter quoter, ILogger logger, IOptionsSnapshot<ProcessorOptions> options, IConnectionStringAccessor connectionStringAccessor, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | databaseTypes | |
DbProviderFactory | factory | |
IMigrationGenerator | generator | |
IQuoter | quoter | |
ILogger | logger | |
IOptionsSnapshot<ProcessorOptions> | options | |
IConnectionStringAccessor | connectionStringAccessor | |
IServiceProvider | serviceProvider |
SqlServerProcessor(IEnumerable<string>, IDbConnection, GenericGenerator, IAnnouncer, IMigrationProcessorOptions, IDbFactory)
Declaration
[Obsolete]
public SqlServerProcessor(IEnumerable<string> databaseTypes, IDbConnection connection, GenericGenerator generator, IAnnouncer announcer, IMigrationProcessorOptions options, IDbFactory factory)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | databaseTypes | |
IDbConnection | connection | |
GenericGenerator | generator | |
IAnnouncer | announcer | |
IMigrationProcessorOptions | options | |
IDbFactory | factory |
Properties
DatabaseType
Gets the database type
Declaration
public override string DatabaseType { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
DatabaseTypeAliases
Gets the database type aliases
Declaration
public override IList<string> DatabaseTypeAliases { get; }
Property Value
Type | Description |
---|---|
IList<string> |
Overrides
Quoter
Declaration
public IQuoter Quoter { get; }
Property Value
Type | Description |
---|---|
IQuoter |
Methods
BeginTransaction()
Begins a transaction
Declaration
public override void BeginTransaction()
Overrides
ColumnExists(string, string, string)
Tests if a column exists
Declaration
public override bool ColumnExists(string schemaName, string tableName, string columnName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
string | tableName | The table name |
string | columnName | The column name |
Returns
Type | Description |
---|---|
bool |
|
Overrides
CommitTransaction()
Commits a transaction
Declaration
public override void CommitTransaction()
Overrides
ConstraintExists(string, string, string)
Tests if a constraint exists
Declaration
public override bool ConstraintExists(string schemaName, string tableName, string constraintName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
string | tableName | The table name |
string | constraintName | The constraint name |
Returns
Type | Description |
---|---|
bool |
|
Overrides
DefaultValueExists(string, string, string, object)
Tests if a default value for a column exists
Declaration
public override bool DefaultValueExists(string schemaName, string tableName, string columnName, object defaultValue)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
string | tableName | The table name |
string | columnName | The column name |
object | defaultValue | The default value |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Execute(string, params object[])
Execute an SQL statement
Declaration
public override void Execute(string template, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | template | The SQL statement |
object[] | args | The arguments to replace in the SQL statement |
Overrides
Exists(string, params object[])
Returns true
if data could be found for the given SQL query
Declaration
public override bool Exists(string template, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | template | The SQL query |
object[] | args | The arguments of the SQL query |
Returns
Type | Description |
---|---|
bool |
|
Overrides
IndexExists(string, string, string)
Tests if an index exists
Declaration
public override bool IndexExists(string schemaName, string tableName, string indexName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
string | tableName | The table name |
string | indexName | The index name |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Process(PerformDBOperationExpression)
Executes a DB operation
Declaration
public override void Process(PerformDBOperationExpression expression)
Parameters
Type | Name | Description |
---|---|---|
PerformDBOperationExpression | expression | The expression to execute |
Overrides
Process(string)
Declaration
protected override void Process(string sql)
Parameters
Type | Name | Description |
---|---|---|
string | sql |
Overrides
Read(string, params object[])
Executes and returns the result of an SQL query
Declaration
public override DataSet Read(string template, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | template | The SQL query |
object[] | args | The arguments of the SQL query |
Returns
Type | Description |
---|---|
DataSet | The data from the specified SQL query |
Overrides
ReadTableData(string, string)
Reads all data from all rows from a table
Declaration
public override DataSet ReadTableData(string schemaName, string tableName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name of the table |
string | tableName | The table name |
Returns
Type | Description |
---|---|
DataSet | The data from the specified table |
Overrides
RollbackTransaction()
Rollback of a transaction
Declaration
public override void RollbackTransaction()
Overrides
SchemaExists(string)
Tests if the schema exists
Declaration
public override bool SchemaExists(string schemaName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
Returns
Type | Description |
---|---|
bool |
|
Overrides
SequenceExists(string, string)
Tests if a sequence exists
Declaration
public override bool SequenceExists(string schemaName, string sequenceName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
string | sequenceName | The sequence name |
Returns
Type | Description |
---|---|
bool |
|
Overrides
TableExists(string, string)
Tests if the table exists
Declaration
public override bool TableExists(string schemaName, string tableName)
Parameters
Type | Name | Description |
---|---|---|
string | schemaName | The schema name |
string | tableName | The table name |
Returns
Type | Description |
---|---|
bool |
|