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
20#[expect(clippy::unused_async)]
21pub async fn handle_prepare(
22    _name: Ident,
23    _data_types: Vec<DataType>,
24    _statement: Box<Statement>,
25) -> crate::error::Result<RwPgResponse> {
26    const MESSAGE: &str = "\
27        `PREPARE` is not supported yet.\n\
28        For compatibility, this statement will still succeed but no changes are actually made.";
29
30    Ok(RwPgResponse::builder(StatementType::PREPARE)
31        .notice(MESSAGE)
32        .into())
33}
34
35#[expect(clippy::unused_async)]
36pub async fn handle_deallocate(
37    _name: Option<Ident>,
38    _prepare: bool,
39) -> crate::error::Result<RwPgResponse> {
40    const MESSAGE: &str = "\
41        `DEALLOCATE` is not supported yet.\n\
42        For compatibility, this statement will still succeed but no changes are actually made.";
43
44    Ok(RwPgResponse::builder(StatementType::DEALLOCATE)
45        .notice(MESSAGE)
46        .into())
47}