Skip to main content

dbmcp_postgres/
types.rs

1//! PostgreSQL-specific MCP tool request types.
2//!
3//! These types include PostgreSQL-only parameters like `cascade`
4//! that are not available on other backends.
5
6use rmcp::schemars;
7use rmcp::schemars::JsonSchema;
8use serde::Deserialize;
9
10/// Request for the `dropTable` tool.
11#[derive(Debug, Default, Deserialize, JsonSchema)]
12#[serde(rename_all = "camelCase")]
13pub struct DropTableRequest {
14    /// Database containing the table. Defaults to the active database.
15    #[serde(default)]
16    pub database: Option<String>,
17    /// Name of the table to drop. Must contain only alphanumeric characters and underscores.
18    pub table: String,
19    /// If true, use CASCADE to also drop dependent foreign key constraints. Defaults to false.
20    #[serde(default)]
21    pub cascade: bool,
22}