velesdb_core/velesql/ast/admin.rs
1//! Admin statement types for VelesQL.
2//!
3//! This module defines FLUSH and other administrative statement AST nodes.
4
5use serde::{Deserialize, Serialize};
6
7/// Admin statements for database maintenance operations.
8#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9#[non_exhaustive]
10pub enum AdminStatement {
11 /// `FLUSH [FULL] [collection]` -- persist collection data to disk.
12 Flush(FlushStatement),
13}
14
15/// `FLUSH [FULL] [collection]` statement.
16///
17/// - `full = false`: WAL-only fast flush (default).
18/// - `full = true`: Full flush including index serialization.
19/// - `collection = None`: Flush all collections.
20/// - `collection = Some(name)`: Flush a specific collection.
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22pub struct FlushStatement {
23 /// Whether to perform a full flush (includes index serialization).
24 pub full: bool,
25 /// Optional collection name; `None` means flush all.
26 pub collection: Option<String>,
27}