use of com.alibaba.druid.sql.dialect.postgresql.visitor.PGOutputVisitor in project druid by alibaba.
the class PostgresqlResourceTest method mergValidate.
void mergValidate(String sql, String expect) {
PGSQLStatementParser parser = new PGSQLStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement statemen = statementList.get(0);
Assert.assertEquals(1, statementList.size());
StringBuilder out = new StringBuilder();
PGOutputVisitor visitor = new PGOutputVisitor(out);
statemen.accept(visitor);
System.out.println(out.toString());
Assert.assertEquals(expect, out.toString());
}
use of com.alibaba.druid.sql.dialect.postgresql.visitor.PGOutputVisitor in project druid by alibaba.
the class PGTest method output.
protected String output(List<SQLStatement> stmtList) {
StringBuilder out = new StringBuilder();
PGOutputVisitor visitor = new PGOutputVisitor(out);
for (SQLStatement stmt : stmtList) {
stmt.accept(visitor);
}
return out.toString();
}
Aggregations