public override void Execute() { bool viewExists = new IfExistsTask(IndexName) { ConnectionManager = this.ConnectionManager, DisableLogging = true }.Exists(); if (viewExists) { new SqlTask(this, Sql).ExecuteNonQuery(); } }
public override void Execute() { IsExisting = new IfExistsTask(ViewName) { ConnectionManager = this.ConnectionManager, DisableLogging = true }.Exists(); if (ConnectionType == ConnectionManagerType.SQLLite && IsExisting) { new DropViewTask(ViewName) { ConnectionManager = this.ConnectionManager, DisableLogging = true } }
public static void ThrowExceptionIfNotExists(IConnectionManager connectionManager, string objectName) { bool tableExists = new IfExistsTask(objectName) { ConnectionManager = connectionManager, DisableLogging = true }.Exists(); if (!tableExists) { throw new ETLBoxException($"An object {objectName} does not exists in the database!"); } }
public override void Execute() { if (ConnectionType == ConnectionManagerType.SQLLite) { throw new ETLBoxNotSupportedException("This task is not supported with SQLite!"); } IsExisting = new IfExistsTask(ProcedureName) { ConnectionManager = this.ConnectionManager, DisableLogging = true }.Exists(); new SqlTask(this, Sql).ExecuteNonQuery(); }
public override void Execute() { bool tableExists = new IfExistsTask(TableName) { ConnectionManager = this.ConnectionManager, DisableLogging = true }.Exists(); if (tableExists && ThrowErrorIfTableExists) { throw new ETLBoxException($"Table {TableName} already exists!"); } if (!tableExists) { new SqlTask(this, Sql).ExecuteNonQuery(); } }