risingwave_frontend/handler/
prepared_statement.rs

1// Copyright 2025 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use pgwire::pg_response::StatementType;
16use risingwave_sqlparser::ast::{DataType, Ident, Statement};
17
18use crate::handler::RwPgResponse;
19
20pub fn handle_prepare(
21    _name: Ident,
22    _data_types: Vec<DataType>,
23    _statement: Box<Statement>,
24) -> crate::error::Result<RwPgResponse> {
25    const MESSAGE: &str = "\
26        `PREPARE` is not supported yet.\n\
27        For compatibility, this statement will still succeed but no changes are actually made.";
28
29    Ok(RwPgResponse::builder(StatementType::PREPARE)
30        .notice(MESSAGE)
31        .into())
32}
33
34pub fn handle_deallocate(
35    _name: Option<Ident>,
36    _prepare: bool,
37) -> crate::error::Result<RwPgResponse> {
38    const MESSAGE: &str = "\
39        `DEALLOCATE` is not supported yet.\n\
40        For compatibility, this statement will still succeed but no changes are actually made.";
41
42    Ok(RwPgResponse::builder(StatementType::DEALLOCATE)
43        .notice(MESSAGE)
44        .into())
45}