Search in sources :

Example 1 with AlterIndexStep

use of org.jooq.AlterIndexStep in project jOOQ by jOOQ.

the class ParserImpl method parseAlterIndex.

private static final DDLQuery parseAlterIndex(ParserContext ctx) {
    boolean ifExists = parseKeywordIf(ctx, "IF EXISTS");
    Name indexName = parseIndexName(ctx);
    parseKeyword(ctx, "RENAME TO");
    Name newName = parseIndexName(ctx);
    AlterIndexStep s1 = ifExists ? ctx.dsl.alterIndexIfExists(indexName) : ctx.dsl.alterIndex(indexName);
    AlterIndexFinalStep s2 = s1.renameTo(newName);
    return s2;
}
Also used : AlterIndexFinalStep(org.jooq.AlterIndexFinalStep) AlterIndexStep(org.jooq.AlterIndexStep) Name(org.jooq.Name)

Example 2 with AlterIndexStep

use of org.jooq.AlterIndexStep in project jOOQ by jOOQ.

the class DefaultParseContext method parseAlterIndex.

private final DDLQuery parseAlterIndex() {
    boolean ifExists = parseKeywordIf("IF EXISTS");
    Name indexName = parseIndexName();
    parseKeyword("RENAME");
    parseKeyword("AS", "TO");
    Name newName = parseIndexName();
    AlterIndexStep s1 = ifExists ? dsl.alterIndexIfExists(indexName) : dsl.alterIndex(indexName);
    return s1.renameTo(newName);
}
Also used : AlterIndexStep(org.jooq.AlterIndexStep) Name(org.jooq.Name) DSL.systemName(org.jooq.impl.DSL.systemName)

Aggregations

AlterIndexStep (org.jooq.AlterIndexStep)2 Name (org.jooq.Name)2 AlterIndexFinalStep (org.jooq.AlterIndexFinalStep)1 DSL.systemName (org.jooq.impl.DSL.systemName)1