fv-streams-sql 0.9.0

The SQL front door for FusionVault Streams: a streaming SQL statement parses to a small typed logical plan and lowers to the same topology the TOML frontend produces — one runtime, two front doors. No DataFusion planner, no fork; expressions compile through the value dialect as the steps already do.
Documentation
//! The SQL front door's tests: each statement shape lowers to the steps a TOML file would write.

use super::*;
use serde_json::json;

mod aggregate;
mod cte;
mod join;
mod select;

#[test]
fn the_unsupported_shapes_are_rejected_with_streaming_aware_errors() {
    // a bare SELECT with no sink
    assert!(compile("SELECT * FROM b").unwrap_err().contains("INSERT INTO"));
    // GROUP BY without a window / EMIT
    assert!(compile("INSERT INTO o SELECT count(*) AS n FROM b GROUP BY x")
        .unwrap_err()
        .contains("window"));
    // a comma join (only `JOIN … ON …` is supported)
    assert!(compile("INSERT INTO o SELECT * FROM a, b").is_err());
    // a set operation
    assert!(compile("INSERT INTO o SELECT * FROM a UNION SELECT * FROM b")
        .unwrap_err()
        .contains("UNION"));
    // an unbounded ORDER BY → points at ROW_NUMBER top-N
    assert!(compile("INSERT INTO o SELECT * FROM b ORDER BY price")
        .unwrap_err()
        .contains("ROW_NUMBER"));
}

#[test]
fn compile_wraps_the_stages_in_a_topology() {
    let topo = compile("INSERT INTO out SELECT * FROM bids").unwrap();
    assert_eq!(topo.stages.len(), 1);
    assert_eq!(topo.stages[0].output, "out");
}

// ── Multi-stage (5c-v): a CTE materialises as its own stage, referenced by name downstream — the
// SQL equivalent of the TOML `[[transforms]]` DAG. ──