Search in sources :

Example 1 with DropSchemaFinalStep

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

the class ParserImpl method parseDropSchema.

private static final DDLQuery parseDropSchema(ParserContext ctx) {
    boolean ifExists = parseKeywordIf(ctx, "IF EXISTS");
    Schema schemaName = parseSchemaName(ctx);
    boolean cascade = parseKeywordIf(ctx, "CASCADE");
    boolean restrict = !cascade && parseKeywordIf(ctx, "RESTRICT");
    DropSchemaStep s1;
    DropSchemaFinalStep s2;
    s1 = ifExists ? ctx.dsl.dropSchemaIfExists(schemaName) : ctx.dsl.dropSchema(schemaName);
    s2 = cascade ? s1.cascade() : restrict ? s1.restrict() : s1;
    return s2;
}
Also used : DropSchemaStep(org.jooq.DropSchemaStep) DSL.currentSchema(org.jooq.impl.DSL.currentSchema) Schema(org.jooq.Schema) DropSchemaFinalStep(org.jooq.DropSchemaFinalStep)

Aggregations

DropSchemaFinalStep (org.jooq.DropSchemaFinalStep)1 DropSchemaStep (org.jooq.DropSchemaStep)1 Schema (org.jooq.Schema)1 DSL.currentSchema (org.jooq.impl.DSL.currentSchema)1