Search Results for

    Show / Hide Table of Contents

    Class EntitySqlWriter

    Inheritance
    object
    EntitySqlWriterCore
    EntitySqlWriter
    Implements
    IEntitySqlWriter
    IEntitySqlWriterCore
    Inherited Members
    EntitySqlWriterCore.Functions
    EntitySqlWriterCore.Procedures
    EntitySqlWriterCore.Descriptor
    EntitySqlWriterCore.Factory
    EntitySqlWriterCore.Reflector
    EntitySqlWriterCore.Log
    EntitySqlWriterCore.GetFunctionsInCreateOrder()
    EntitySqlWriterCore.GetProceduresInCreateOrder()
    EntitySqlWriterCore.GetTableName()
    EntitySqlWriterCore.GetHistoryTableName()
    EntitySqlWriterCore.EntitiesWithLastUpdatedIndexes
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Connections.Database.Migrations.Core.SQLWriters
    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
    Type Name Description
    IDataAccessor accessor
    EntityDescriptor descriptor
    IFactoryInjector factory
    IReflectionHelper reflector
    ILogger logger

    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
    Type Name Description
    string columnName
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    AlterColumnName(string, string, IDbConnection, bool)

    Declaration
    public Task AlterColumnName(string columnName, string oldName, IDbConnection cn, bool forHistoryTable = false)
    Parameters
    Type Name Description
    string columnName
    string oldName
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    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
    Type Name Description
    ColumnDescriptor prop
    bool typeChanged
    bool nullChanged
    bool columnMaxLengthChanged
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    AlterTableName(string, IDbConnection)

    Declaration
    public Task AlterTableName(string oldName, IDbConnection cn)
    Parameters
    Type Name Description
    string oldName
    IDbConnection cn
    Returns
    Type Description
    Task

    ClearRelatedTableConstraints(ObseleteEntityDescriptor, IDataAccessor, IDbConnection)

    Declaration
    public Task ClearRelatedTableConstraints(ObseleteEntityDescriptor obselete, IDataAccessor accessor, IDbConnection cn)
    Parameters
    Type Name Description
    ObseleteEntityDescriptor obselete
    IDataAccessor accessor
    IDbConnection cn
    Returns
    Type Description
    Task

    ClearTableConstraints(string, IDataAccessor, IDbConnection)

    Declaration
    public Task ClearTableConstraints(string tableName, IDataAccessor accessor, IDbConnection cn)
    Parameters
    Type Name Description
    string tableName
    IDataAccessor accessor
    IDbConnection cn
    Returns
    Type Description
    Task

    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
    Type Name Description
    string columnName
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    CreateFunction(BaseFunctionDescriptor, IDbConnection)

    Declaration
    public Task CreateFunction(BaseFunctionDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    BaseFunctionDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task

    CreatePrimaryKey(IDbConnection, bool)

    Declaration
    public Task CreatePrimaryKey(IDbConnection cn, bool forHistoryTable)
    Parameters
    Type Name Description
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    CreateProcedure(BaseProcedureDescriptor, IDbConnection)

    Declaration
    public Task CreateProcedure(BaseProcedureDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    BaseProcedureDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task

    CreateTable(IDbConnection)

    Declaration
    public Task CreateTable(IDbConnection cn)
    Parameters
    Type Name Description
    IDbConnection cn
    Returns
    Type Description
    Task

    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
    Type Name Description
    string columnName
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    DoesColumnExist(string, IDbConnection, bool)

    Declaration
    public Task<bool> DoesColumnExist(string columnName, IDbConnection cn, bool forHistoryTable)
    Parameters
    Type Name Description
    string columnName
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task<bool>

    DoesFunctionExist(BaseFunctionDescriptor, IDbConnection)

    Declaration
    public Task<bool> DoesFunctionExist(BaseFunctionDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    BaseFunctionDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task<bool>

    DoesIndexExist(TableIndex, IDbConnection, bool)

    Declaration
    public Task<bool> DoesIndexExist(TableIndex index, IDbConnection cn, bool forHistoryTable)
    Parameters
    Type Name Description
    TableIndex index
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task<bool>

    DoesOldTableExist(IDbConnection)

    Declaration
    public Task<string> DoesOldTableExist(IDbConnection cn)
    Parameters
    Type Name Description
    IDbConnection cn
    Returns
    Type Description
    Task<string>

    DoesProcedureExist(BaseProcedureDescriptor, IDbConnection)

    Declaration
    public Task<bool> DoesProcedureExist(BaseProcedureDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    BaseProcedureDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task<bool>

    DoesTableExist(IDbConnection)

    Declaration
    public Task<bool> DoesTableExist(IDbConnection cn)
    Parameters
    Type Name Description
    IDbConnection cn
    Returns
    Type Description
    Task<bool>

    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
    Type Name Description
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    DropFunction(BaseFunctionDescriptor, IDbConnection)

    Declaration
    public Task DropFunction(BaseFunctionDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    BaseFunctionDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task

    DropFunction(IDataAccessor, BaseFunctionDescriptor, IDbConnection)

    Declaration
    public Task DropFunction(IDataAccessor accessor, BaseFunctionDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    IDataAccessor accessor
    BaseFunctionDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task

    DropPrimaryKey(IDbConnection, bool)

    Declaration
    public Task DropPrimaryKey(IDbConnection cn, bool forHistoryTable)
    Parameters
    Type Name Description
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    DropProcedure(BaseProcedureDescriptor, IDbConnection)

    Declaration
    public Task DropProcedure(BaseProcedureDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    BaseProcedureDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task

    DropProcedure(IDataAccessor, BaseProcedureDescriptor, IDbConnection)

    Declaration
    public Task DropProcedure(IDataAccessor accessor, BaseProcedureDescriptor function, IDbConnection cn)
    Parameters
    Type Name Description
    IDataAccessor accessor
    BaseProcedureDescriptor function
    IDbConnection cn
    Returns
    Type Description
    Task

    EnsureIndexesExist(IDbConnection, bool)

    Declaration
    public Task EnsureIndexesExist(IDbConnection cn, bool forHistoryTable = false)
    Parameters
    Type Name Description
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task

    GetCaseSensitiveColumnName(string, IDbConnection, bool)

    Declaration
    public Task<string> GetCaseSensitiveColumnName(string columnName, IDbConnection cn, bool forHistoryTable)
    Parameters
    Type Name Description
    string columnName
    IDbConnection cn
    bool forHistoryTable
    Returns
    Type Description
    Task<string>

    GetColumnsInfo(IDbConnection, string)

    Declaration
    public Task<IEnumerable<ColumnProperties>> GetColumnsInfo(IDbConnection cn, string tableName = "")
    Parameters
    Type Name Description
    IDbConnection cn
    string tableName
    Returns
    Type Description
    Task<IEnumerable<ColumnProperties>>

    GetExtraColumnNames(IEnumerable<string>)

    Declaration
    public IEnumerable<string> GetExtraColumnNames(IEnumerable<string> existingColumnNames)
    Parameters
    Type Name Description
    IEnumerable<string> existingColumnNames
    Returns
    Type Description
    IEnumerable<string>

    GetIncorrectColumnTypes(IEnumerable<ColumnProperties>)

    Declaration
    public IEnumerable<ColumnProperties> GetIncorrectColumnTypes(IEnumerable<ColumnProperties> existingColumns)
    Parameters
    Type Name Description
    IEnumerable<ColumnProperties> existingColumns
    Returns
    Type Description
    IEnumerable<ColumnProperties>

    GetMissingColumnNames(IEnumerable<string>)

    Declaration
    public IEnumerable<(string MissingColName, string ExistingOldValue)> GetMissingColumnNames(IEnumerable<string> existingColumnNames)
    Parameters
    Type Name Description
    IEnumerable<string> existingColumnNames
    Returns
    Type Description
    IEnumerable<(string FileFormatName, string FileExtension)>

    RenameColumn(string, string, IDbConnection)

    Declaration
    public Task RenameColumn(string oldColumnName, string newColumnName, IDbConnection cn)
    Parameters
    Type Name Description
    string oldColumnName
    string newColumnName
    IDbConnection cn
    Returns
    Type Description
    Task

    Implements

    IEntitySqlWriter
    IEntitySqlWriterCore

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.