MCPcopy Index your code
hub / github.com/jOOQ/jOOQ / DropDatabaseImpl

Class DropDatabaseImpl

jOOQ/src/main/java/org/jooq/impl/DropDatabaseImpl.java:71–191  ·  view source on GitHub ↗

The DROP DATABASE statement.

Source from the content-addressed store, hash-verified

69 * The <code>DROP DATABASE</code> statement.
70 */
71@SuppressWarnings({ "unused" })
72final class DropDatabaseImpl
73extends
74 AbstractDDLQuery
75implements
76 QOM.DropDatabase,
77 DropDatabaseFinalStep
78{
79
80 final Catalog database;
81 final boolean ifExists;
82
83 DropDatabaseImpl(
84 Configuration configuration,
85 Catalog database,
86 boolean ifExists
87 ) {
88 super(configuration);
89
90 this.database = database;
91 this.ifExists = ifExists;
92 }
93
94 // -------------------------------------------------------------------------
95 // XXX: QueryPart API
96 // -------------------------------------------------------------------------
97
98
99
100 private static final Set<SQLDialect> NO_SUPPORT_IF_EXISTS = SQLDialect.supportedUntil(DERBY, FIREBIRD);
101
102 private final boolean supportsIfExists(Context<?> ctx) {
103 return !NO_SUPPORT_IF_EXISTS.contains(ctx.dialect());
104 }
105
106 @Override
107 public final void accept(Context<?> ctx) {
108 if (ifExists && !supportsIfExists(ctx))
109 tryCatch(ctx, DDLStatementType.DROP_DATABASE, c -> accept0(c));
110 else
111 accept0(ctx);
112 }
113
114 private void accept0(Context<?> ctx) {
115 ctx.visit(K_DROP).sql(' ');
116
117 switch (ctx.family()) {
118
119
120
121
122
123
124 default:
125 ctx.visit(K_DATABASE);
126 break;
127 }
128

Callers

nothing calls this directly

Calls 1

supportedUntilMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…