Skip to main content

velesdb_core/velesql/ast/
introspection.rs

1//! Introspection statement types for VelesQL.
2//!
3//! This module defines SHOW, DESCRIBE, and EXPLAIN statement AST nodes.
4
5use serde::{Deserialize, Serialize};
6
7/// Introspection statements for database/collection metadata queries.
8#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9#[non_exhaustive]
10pub enum IntrospectionStatement {
11    /// `SHOW COLLECTIONS` -- lists all collection names and types.
12    ShowCollections,
13    /// `DESCRIBE [COLLECTION] <name>` -- returns collection metadata.
14    DescribeCollection(DescribeCollectionStatement),
15    /// `EXPLAIN <query>` -- returns the query execution plan without executing.
16    Explain(Box<super::Query>),
17}
18
19/// `DESCRIBE COLLECTION <name>` statement.
20#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
21pub struct DescribeCollectionStatement {
22    /// Collection name to describe.
23    pub name: String,
24}