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

com.liquibase.ext.sqlgenerator.MongoshGenerator Maven / Gradle / Ivy

The newest version!
package com.liquibase.ext.sqlgenerator;

import com.liquibase.ext.statement.MongoshStatement;
import liquibase.database.Database;
import liquibase.exception.ValidationErrors;
import liquibase.sql.Sql;
import liquibase.sql.UnparsedSql;
import liquibase.sqlgenerator.SqlGeneratorChain;
import liquibase.sqlgenerator.core.AbstractSqlGenerator;

public class MongoshGenerator extends AbstractSqlGenerator {


    @Override
    public ValidationErrors validate(MongoshStatement mongoshStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
        ValidationErrors validationErrors = new ValidationErrors();
        validationErrors.checkRequiredField("mongo", mongoshStatement.getNoSql());
        return validationErrors;
    }

    @Override
    public Sql[] generateSql(MongoshStatement mongoshStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
        return new Sql[] {
                new UnparsedSql(mongoshStatement.getNoSql(), mongoshStatement.getEndDelimiter())
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy