use of org.jooq.CommentOnIsStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseCommentOn.
private final DDLQuery parseCommentOn() {
parseKeyword("COMMENT ON");
CommentOnIsStep s1;
if (parseKeywordIf("COLUMN")) {
s1 = dsl.commentOnColumn(parseFieldName());
} else if (parseKeywordIf("TABLE")) {
Table<?> table = parseTableName();
if (parseIf('(')) {
s1 = dsl.commentOnColumn(table.getQualifiedName().append(parseIdentifier()));
parseKeyword("IS");
DDLQuery s2 = s1.is(parseStringLiteral());
parse(')');
return s2;
} else
s1 = dsl.commentOnTable(table);
} else if (parseKeywordIf("VIEW")) {
s1 = dsl.commentOnView(parseTableName());
} else // https://docs.oracle.com/database/121/SQLRF/statements_4010.htm
if (parseAndGetKeywordIf("ACCESS METHOD", "AUDIT POLICY", "COLLATION", "CONVERSION", "DATABASE", "DOMAIN", "EDITION", "EXTENSION", "EVENT TRIGGER", "FOREIGN DATA WRAPPER", "FOREIGN TABLE", "INDEX", "INDEXTYPE", "LANGUAGE", "LARGE OBJECT", "MATERIALIZED VIEW", "MINING MODEL", "OPERATOR", "PROCEDURAL LANGUAGE", "PUBLICATION", "ROLE", "SCHEMA", "SEQUENCE", "SERVER", "STATISTICS", "SUBSCRIPTION", "TABLESPACE", "TEXT SEARCH CONFIGURATION", "TEXT SEARCH DICTIONARY", "TEXT SEARCH PARSER", "TEXT SEARCH TEMPLATE", "TYPE", "VIEW") != null) {
parseIdentifier();
parseKeyword("IS");
parseStringLiteral();
return IGNORE;
} else // https://www.postgresql.org/docs/10/static/sql-comment.html
if (parseKeywordIf("CONSTRAINT")) {
parseIdentifier();
parseKeyword("ON");
parseKeywordIf("DOMAIN");
parseName();
parseKeyword("IS");
parseStringLiteral();
return IGNORE;
} else if (parseAndGetKeywordIf("POLICY", "RULE", "TRIGGER") != null) {
parseIdentifier();
parseKeyword("ON");
parseIdentifier();
parseKeyword("IS");
parseStringLiteral();
return IGNORE;
} else if (parseKeywordIf("TRANSFORM FOR")) {
parseIdentifier();
parseKeyword("LANGUAGE");
parseIdentifier();
parseKeyword("IS");
parseStringLiteral();
return IGNORE;
} else
throw unsupportedClause();
parseKeyword("IS");
return s1.is(parseStringLiteral());
}
Aggregations