Class EntitySqlWriter
Inheritance
EntitySqlWriter
Assembly: LemonEdge.Database.Connector.dll
Syntax
public class EntitySqlWriter : EntitySqlWriterCore, IEntitySqlWriter, IEntitySqlWriterCore
Constructors
EntitySqlWriter(IDataAccessor, EntityDescriptor, IFactoryInjector, IReflectionHelper, ILogger)
Declaration
public EntitySqlWriter(IDataAccessor accessor, EntityDescriptor descriptor, IFactoryInjector factory, IReflectionHelper reflector, ILogger logger = null)
Parameters
Methods
AlterColumn(string, IDbConnection, bool)
Alters the specified column to the new type
You should delete all functions first that are schema bound before making table structural changes
Declaration
public Task AlterColumn(string columnName, IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
AlterColumnName(string, string, IDbConnection, bool)
Declaration
public Task AlterColumnName(string columnName, string oldName, IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
AlterColumnType(ColumnDescriptor, bool, bool, bool, IDbConnection, bool)
Declaration
public Task AlterColumnType(ColumnDescriptor prop, bool typeChanged, bool nullChanged, bool columnMaxLengthChanged, IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
AlterTableName(string, IDbConnection)
Declaration
public Task AlterTableName(string oldName, IDbConnection cn)
Parameters
Returns
Declaration
public Task ClearRelatedTableConstraints(ObseleteEntityDescriptor obselete, IDataAccessor accessor, IDbConnection cn)
Parameters
Returns
ClearTableConstraints(string, IDataAccessor, IDbConnection)
Declaration
public Task ClearTableConstraints(string tableName, IDataAccessor accessor, IDbConnection cn)
Parameters
Returns
CreateColumn(string, IDbConnection, bool)
Adds the specified column from the table for this entity.
You should delete all functions first that are schema bound before making table structural changes
Declaration
public Task CreateColumn(string columnName, IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
CreateFunction(BaseFunctionDescriptor, IDbConnection)
Declaration
public Task CreateFunction(BaseFunctionDescriptor function, IDbConnection cn)
Parameters
Returns
CreatePrimaryKey(IDbConnection, bool)
Declaration
public Task CreatePrimaryKey(IDbConnection cn, bool forHistoryTable)
Parameters
Returns
CreateProcedure(BaseProcedureDescriptor, IDbConnection)
Declaration
public Task CreateProcedure(BaseProcedureDescriptor function, IDbConnection cn)
Parameters
Returns
CreateTable(IDbConnection)
Declaration
public Task CreateTable(IDbConnection cn)
Parameters
Returns
DeleteColumn(string, IDbConnection, bool)
Removes the specified column from the table for this entity.
You should delete all functions first that are schema bound before making table structural changes
Declaration
public Task DeleteColumn(string columnName, IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
DoesColumnExist(string, IDbConnection, bool)
Declaration
public Task<bool> DoesColumnExist(string columnName, IDbConnection cn, bool forHistoryTable)
Parameters
Returns
DoesFunctionExist(BaseFunctionDescriptor, IDbConnection)
Declaration
public Task<bool> DoesFunctionExist(BaseFunctionDescriptor function, IDbConnection cn)
Parameters
Returns
DoesIndexExist(TableIndex, IDbConnection, bool)
Declaration
public Task<bool> DoesIndexExist(TableIndex index, IDbConnection cn, bool forHistoryTable)
Parameters
Returns
DoesOldTableExist(IDbConnection)
Declaration
public Task<string> DoesOldTableExist(IDbConnection cn)
Parameters
Returns
DoesProcedureExist(BaseProcedureDescriptor, IDbConnection)
Declaration
public Task<bool> DoesProcedureExist(BaseProcedureDescriptor function, IDbConnection cn)
Parameters
Returns
DoesTableExist(IDbConnection)
Declaration
public Task<bool> DoesTableExist(IDbConnection cn)
Parameters
Returns
DropAllIndexes(IDbConnection, bool)
Drop all indexes apart from primary and clustered - needs to be done through custom script (as those should be
alter indexes to run on azure)
Declaration
public Task DropAllIndexes(IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
DropFunction(BaseFunctionDescriptor, IDbConnection)
Declaration
public Task DropFunction(BaseFunctionDescriptor function, IDbConnection cn)
Parameters
Returns
DropFunction(IDataAccessor, BaseFunctionDescriptor, IDbConnection)
Declaration
public Task DropFunction(IDataAccessor accessor, BaseFunctionDescriptor function, IDbConnection cn)
Parameters
Returns
DropPrimaryKey(IDbConnection, bool)
Declaration
public Task DropPrimaryKey(IDbConnection cn, bool forHistoryTable)
Parameters
Returns
DropProcedure(BaseProcedureDescriptor, IDbConnection)
Declaration
public Task DropProcedure(BaseProcedureDescriptor function, IDbConnection cn)
Parameters
Returns
DropProcedure(IDataAccessor, BaseProcedureDescriptor, IDbConnection)
Declaration
public Task DropProcedure(IDataAccessor accessor, BaseProcedureDescriptor function, IDbConnection cn)
Parameters
Returns
EnsureIndexesExist(IDbConnection, bool)
Declaration
public Task EnsureIndexesExist(IDbConnection cn, bool forHistoryTable = false)
Parameters
Returns
GetCaseSensitiveColumnName(string, IDbConnection, bool)
Declaration
public Task<string> GetCaseSensitiveColumnName(string columnName, IDbConnection cn, bool forHistoryTable)
Parameters
Returns
GetColumnsInfo(IDbConnection, string)
Declaration
public Task<IEnumerable<ColumnProperties>> GetColumnsInfo(IDbConnection cn, string tableName = "")
Parameters
Returns
GetExtraColumnNames(IEnumerable<string>)
Declaration
public IEnumerable<string> GetExtraColumnNames(IEnumerable<string> existingColumnNames)
Parameters
Returns
GetIncorrectColumnTypes(IEnumerable<ColumnProperties>)
Declaration
public IEnumerable<ColumnProperties> GetIncorrectColumnTypes(IEnumerable<ColumnProperties> existingColumns)
Parameters
Returns
GetMissingColumnNames(IEnumerable<string>)
Declaration
public IEnumerable<(string MissingColName, string ExistingOldValue)> GetMissingColumnNames(IEnumerable<string> existingColumnNames)
Parameters
Returns
RenameColumn(string, string, IDbConnection)
Declaration
public Task RenameColumn(string oldColumnName, string newColumnName, IDbConnection cn)
Parameters
Returns
Implements
Extension Methods