All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liquibase.ext.teradata.sqlgenerator.GetViewDefinitionGeneratorTeradata Maven / Gradle / Ivy

There is a newer version: 4.31.0
Show newest version
/**
 * Copyright 2010 Open Pricer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package liquibase.ext.teradata.sqlgenerator;

import liquibase.database.Database;
import liquibase.ext.teradata.database.TeradataDatabase;
import liquibase.sql.Sql;
import liquibase.sql.UnparsedSql;
import liquibase.sqlgenerator.SqlGeneratorChain;
import liquibase.sqlgenerator.core.GetViewDefinitionGenerator;
import liquibase.statement.core.AddColumnStatement;
import liquibase.statement.core.GetViewDefinitionStatement;

/**
 * use show view to get view information for Teradatadatabse
 *
 */
public class GetViewDefinitionGeneratorTeradata extends GetViewDefinitionGenerator {

    @Override
    public int getPriority() {
        return PRIORITY_DATABASE;
    }

    @Override
    public boolean supports(GetViewDefinitionStatement statement, Database database) {
        return database instanceof TeradataDatabase;
    }

	@Override
	public Sql[] generateSql(GetViewDefinitionStatement statement,
			Database database, SqlGeneratorChain sqlGeneratorChain) {
		return new Sql[] {
				new UnparsedSql("show view " + statement.getViewName() )
		};

	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy