示例#1
0
        public static void ThrowExceptionIfNotExists(IConnectionManager connectionManager, string tableName)
        {
            bool tableExists = new IfTableOrViewExistsTask(tableName)
            {
                ConnectionManager = connectionManager,
                DisableLogging    = true
            }.Exists();

            if (!tableExists)
            {
                throw new ETLBoxException($"An table {tableName} does not exists in the database!");
            }
        }
示例#2
0
 public void Execute()
 {
     IsExisting = new IfTableOrViewExistsTask(ViewName)
     {
         ConnectionManager = this.ConnectionManager, DisableLogging = true
     }.Exists();
     if ((ConnectionType == ConnectionManagerType.SQLite || ConnectionType == ConnectionManagerType.Postgres) && IsExisting)
     {
         new DropViewTask(ViewName)
         {
             ConnectionManager = this.ConnectionManager, DisableLogging = true
         }
     }
示例#3
0
        public void Execute()
        {
            bool tableExists = new IfTableOrViewExistsTask(TableName)
            {
                ConnectionManager = this.ConnectionManager, DisableLogging = true
            }.Exists();

            if (tableExists && ThrowErrorIfTableExists)
            {
                throw new ETLBoxException($"Table {TableName} already exists!");
            }
            if (!tableExists)
            {
                new SqlTask(this, Sql).ExecuteNonQuery();
            }
        }