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());