Search in sources :

Example 1 with AlterSchemaStep

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

the class ParserImpl method parseAlterSchema.

private static final DDLQuery parseAlterSchema(ParserContext ctx) {
    boolean ifExists = parseKeywordIf(ctx, "IF EXISTS");
    Schema schemaName = parseSchemaName(ctx);
    parseKeyword(ctx, "RENAME TO");
    Schema newName = parseSchemaName(ctx);
    AlterSchemaStep s1 = ifExists ? ctx.dsl.alterSchemaIfExists(schemaName) : ctx.dsl.alterSchema(schemaName);
    AlterSchemaFinalStep s2 = s1.renameTo(newName);
    return s2;
}
Also used : AlterSchemaFinalStep(org.jooq.AlterSchemaFinalStep) DSL.currentSchema(org.jooq.impl.DSL.currentSchema) Schema(org.jooq.Schema) AlterSchemaStep(org.jooq.AlterSchemaStep)

Aggregations

AlterSchemaFinalStep (org.jooq.AlterSchemaFinalStep)1 AlterSchemaStep (org.jooq.AlterSchemaStep)1 Schema (org.jooq.Schema)1 DSL.currentSchema (org.jooq.impl.DSL.currentSchema)1