MCPcopy Create free account
hub / github.com/crate/crate / DropSchemaPlan

Class DropSchemaPlan

server/src/main/java/io/crate/planner/DropSchemaPlan.java:33–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31import io.crate.sql.tree.DropSchema;
32
33public class DropSchemaPlan implements Plan {
34
35 private final AnalyzedDropSchema dropSchema;
36
37 public DropSchemaPlan(AnalyzedDropSchema dropSchema) {
38 this.dropSchema = dropSchema;
39 }
40
41 @Override
42 public StatementType type() {
43 return StatementType.DDL;
44 }
45
46 @Override
47 public void executeOrFail(DependencyCarrier dependencies,
48 PlannerContext plannerContext,
49 RowConsumer consumer,
50 Row params,
51 SubQueryResults subQueryResults) throws Exception {
52 DropSchema schema = dropSchema.dropSchema();
53 DropSchemaRequest request = new DropSchemaRequest(schema.names(), schema.ifExists(), schema.mode());
54 dependencies.client()
55 .execute(TransportDropSchema.ACTION, request)
56 .whenComplete(OneRowActionListener.oneIfAcknowledged(consumer));
57 }
58}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected