Search in sources :

Example 1 with DropTableFinalStep

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

the class ParserImpl method parseDropTable.

private static final DDLQuery parseDropTable(ParserContext ctx) {
    boolean ifExists = parseKeywordIf(ctx, "IF EXISTS");
    Table<?> tableName = parseTableName(ctx);
    boolean cascade = parseKeywordIf(ctx, "CASCADE");
    boolean restrict = !cascade && parseKeywordIf(ctx, "RESTRICT");
    DropTableStep s1;
    DropTableFinalStep s2;
    s1 = ifExists ? ctx.dsl.dropTableIfExists(tableName) : ctx.dsl.dropTable(tableName);
    s2 = cascade ? s1.cascade() : restrict ? s1.restrict() : s1;
    return s2;
}
Also used : DropTableFinalStep(org.jooq.DropTableFinalStep) DropTableStep(org.jooq.DropTableStep)

Aggregations

DropTableFinalStep (org.jooq.DropTableFinalStep)1 DropTableStep (org.jooq.DropTableStep)1