use of com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource in project druid by alibaba.
the class PGSelectParser method parseTableSourceRest.
protected SQLTableSource parseTableSourceRest(SQLTableSource tableSource) {
if (lexer.token() == Token.AS && tableSource instanceof SQLExprTableSource) {
lexer.nextToken();
String alias = null;
if (lexer.token() == Token.IDENTIFIER) {
alias = lexer.stringVal();
lexer.nextToken();
}
if (lexer.token() == Token.LPAREN) {
SQLExprTableSource exprTableSource = (SQLExprTableSource) tableSource;
PGFunctionTableSource functionTableSource = new PGFunctionTableSource(exprTableSource.getExpr());
if (alias != null) {
functionTableSource.setAlias(alias);
}
lexer.nextToken();
parserParameters(functionTableSource.getParameters());
accept(Token.RPAREN);
return super.parseTableSourceRest(functionTableSource);
}
}
return super.parseTableSourceRest(tableSource);
}
use of com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource in project druid by alibaba.
the class PGASTVisitorAdapterTest method test_adapter.
public void test_adapter() throws Exception {
PGASTVisitorAdapter adapter = new PGASTVisitorAdapter();
new WindowClause().accept(adapter);
new FetchClause().accept(adapter);
new ForClause().accept(adapter);
new PGWithQuery().accept(adapter);
new PGWithClause().accept(adapter);
new PGDeleteStatement().accept(adapter);
new PGFunctionTableSource().accept(adapter);
}
Aggregations