Expand description
§laminate-sql — Database connectors for laminate
Provides the DataSource trait and implementations for PostgreSQL,
SQLite, and MySQL. Queries return rows as FlexValue for shaping,
coercion, and schema inference.
§Features
postgres— PostgreSQL via sqlxsqlite— SQLite via sqlxmysql— MySQL via sqlxall-databases— All of the above
§Quick Start
ⓘ
use laminate_sql::{DataSource, PostgresSource};
let source = PostgresSource::connect("postgres://user:pass@localhost/mydb").await?;
let rows = source.query("SELECT * FROM customers LIMIT 100").await?;
// Use with laminate schema inference
let raw_rows: Vec<serde_json::Value> = rows.iter().map(|r| r.into_raw()).collect();
let schema = laminate::InferredSchema::from_values(&raw_rows);
let report = schema.audit(&raw_rows);
println!("{}", report.summary());Enums§
- Data
Source Error - Errors from data source operations.
Traits§
- Data
Source - A data source that produces rows as FlexValue.
Functions§
- read_
json_ array - Read a JSON array as FlexValue rows.
- read_
jsonl - Read JSON Lines (newline-delimited JSON) as FlexValue rows.