query-forge 0.5.0

Run SQL queries on XLSX/XML/CSV/JSON/JSONL/Markdown/HTML/Parquet inputs and export results as text, CSV, JSONL, Markdown, XML, HTML, XLSX, or Parquet
Documentation
use clap::ValueEnum;

#[derive(Clone, Debug, ValueEnum)]
pub(crate) enum OutputFormat {
    Text,
    Csv,
    Json,
    Jsonl,
    Markdown,
    Html,
    Xlsx,
    Xml,
    Parquet,
}

#[derive(Clone, Debug, ValueEnum)]
pub(crate) enum InspectionFormat {
    Text,
    Json,
    Markdown,
}

#[derive(Clone, Debug, ValueEnum)]
pub(crate) enum MetadataFormat {
    /// Human-readable text output (default).
    Text,
    /// Machine-readable JSON output.
    Json,
}

#[derive(Clone, Debug, ValueEnum)]
pub(crate) enum HeaderCase {
    Snake,
}

/// JSON extraction mode for `--json-mode`.
#[derive(Clone, Debug, ValueEnum)]
pub(crate) enum JsonMode {
    /// Each element of a top-level JSON array becomes a row (default).
    Array,
    /// Each key-value pair of the JSON object becomes a row with "key" and "value" columns.
    Object,
    /// Recursively flatten nested JSON into dotted key paths (e.g. address.city).
    Flatten,
}

/// XML extraction mode for `--xml-mode`.
#[derive(Clone, Debug, ValueEnum)]
pub(crate) enum XmlMode {
    /// Detect and extract tabular rows from the XML structure (default).
    Rows,
    /// Collect every leaf text element as a row with "tag" and "value" columns.
    Descendants,
    /// Extract element attributes as columns; each element with attributes becomes a row.
    Attributes,
}