datacraft_query/sql_types.rs
1//! Data types of the SQL window (step 13.3, item H37; split from the
2//! engine in step 31.2 so the snapshot vocabulary stays C-free).
3//!
4//! These types are part of the state and the wire in every build; only the
5//! engine that *produces* a [`SqlResult`] sits behind this crate's
6//! `sql-engine` feature (`rusqlite` is optional, step 76.4).
7
8use serde::{Deserialize, Serialize};
9
10use datacraft_types::{FieldValue, TableDef};
11
12/// Columns plus positional rows of one SQL result.
13#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
14pub struct SqlResult {
15 /// Result column names in select order.
16 pub columns: Vec<String>,
17 /// Rows, positional to `columns`.
18 pub rows: Vec<Vec<FieldValue>>,
19}
20
21/// One materialized source: the table definition and all of its rows.
22pub type Source = (TableDef, Vec<Vec<FieldValue>>);