MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / plan_drop_database

Function plan_drop_database

src/sql/src/plan/statement/ddl.rs:5382–5400  ·  view source on GitHub ↗
(
    scx: &StatementContext,
    if_exists: bool,
    name: &UnresolvedDatabaseName,
    cascade: bool,
)

Source from the content-addressed store, hash-verified

5380}
5381
5382fn plan_drop_database(
5383 scx: &StatementContext,
5384 if_exists: bool,
5385 name: &UnresolvedDatabaseName,
5386 cascade: bool,
5387) -> Result<Option<DatabaseId>, PlanError> {
5388 Ok(match resolve_database(scx, name, if_exists)? {
5389 Some(database) => {
5390 if !cascade && database.has_schemas() {
5391 sql_bail!(
5392 "database '{}' cannot be dropped with RESTRICT while it contains schemas",
5393 name,
5394 );
5395 }
5396 Some(database.id())
5397 }
5398 None => None,
5399 })
5400}
5401
5402pub fn describe_drop_objects(
5403 _: &StatementContext,

Callers 1

plan_drop_objectsFunction · 0.85

Calls 3

resolve_databaseFunction · 0.85
has_schemasMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected