use of org.jooq.DropIndexOnStep in project jOOQ by jOOQ.
the class ParserImpl method parseDropIndex.
private static final DDLQuery parseDropIndex(ParserContext ctx) {
boolean ifExists = parseKeywordIf(ctx, "IF EXISTS");
Name indexName = parseIndexName(ctx);
boolean on = parseKeywordIf(ctx, "ON");
Table<?> onTable = on ? parseTableName(ctx) : null;
DropIndexOnStep s1;
DropIndexFinalStep s2;
s1 = ifExists ? ctx.dsl.dropIndexIfExists(indexName) : ctx.dsl.dropIndex(indexName);
s2 = on ? s1.on(onTable) : s1;
return s2;
}
use of org.jooq.DropIndexOnStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseDropIndex.
private final DDLQuery parseDropIndex() {
boolean ifExists = parseKeywordIf("IF EXISTS");
Name indexName = parseIndexName();
ifExists = ifExists || parseKeywordIf("IF EXISTS");
boolean on = parseKeywordIf("ON");
Table<?> onTable = on ? parseTableName() : null;
DropIndexOnStep s1;
DropIndexCascadeStep s2;
s1 = ifExists ? dsl.dropIndexIfExists(indexName) : dsl.dropIndex(indexName);
s2 = on ? s1.on(onTable) : s1;
return parseKeywordIf("CASCADE") ? s2.cascade() : parseKeywordIf("RESTRICT") ? s2.restrict() : s2;
}
Aggregations