mz_sql/plan/statement/raise.rs
1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Queries that send notices/errors to the client
11//!
12//! This module houses the handlers for the `RAISE` suite of statements, like
13//! `RAISE WARNING` and `RAISE INFO`.
14
15use crate::ast::RaiseStatement;
16use crate::plan::statement::{StatementContext, StatementDesc};
17use crate::plan::{Plan, PlanError, RaisePlan};
18
19pub fn describe_raise(_: &StatementContext, _: RaiseStatement) -> Result<StatementDesc, PlanError> {
20 Ok(StatementDesc::new(None))
21}
22
23pub fn plan_raise(scx: &StatementContext, r: RaiseStatement) -> Result<Plan, PlanError> {
24 scx.require_feature_flag(&crate::session::vars::ENABLE_RAISE_STATEMENT)?;
25 Ok(Plan::Raise(RaisePlan {
26 severity: r.severity,
27 }))
28}