use of org.jooq.AlterDatabaseStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseAlterDatabase.
private final DDLQuery parseAlterDatabase() {
boolean ifExists = parseKeywordIf("IF EXISTS");
Catalog catalogName = parseCatalogName();
AlterDatabaseStep s1 = ifExists ? dsl.alterDatabaseIfExists(catalogName) : dsl.alterDatabase(catalogName);
if (parseKeywordIf("RENAME")) {
parseKeyword("AS", "TO");
return s1.renameTo(parseCatalogName());
} else if (parseKeywordIf("OWNER TO") && parseUser() != null)
return IGNORE;
else if (parseAlterDatabaseFlags(true))
return IGNORE;
else
throw expected("OWNER TO", "RENAME TO");
}
Aggregations