コード例 #1
0
        public override void Execute()
        {
            bool viewExists = new IfExistsTask(IndexName)
            {
                ConnectionManager = this.ConnectionManager, DisableLogging = true
            }.Exists();

            if (viewExists)
            {
                new SqlTask(this, Sql).ExecuteNonQuery();
            }
        }
コード例 #2
0
ファイル: CreateViewTask.cs プロジェクト: Everwealth/ETLBox
 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
         }
     }
コード例 #3
0
ファイル: IfExistsTask.cs プロジェクト: Everwealth/ETLBox
        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!");
            }
        }
コード例 #4
0
        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();
        }
コード例 #5
0
ファイル: CreateTableTask.cs プロジェクト: Everwealth/ETLBox
        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();
            }
        }