serde_sql
serde_sql streams serde::Serialize
structs directly into SQLite statements without allocating intermediate field structures.
You provide a String buffer and value; the crate appends the literal value list (v1, v2, …) so
you can embed it in any SQL template. When bootstrapping tables, the crate can also infer a basic
CREATE TABLE definition from an example record.
Features
- Zero-copy output: serialise straight into an existing
String. - Handles
Option, numbers, booleans, and strings with proper escaping. - Nested structures (maps/arrays) are emitted as JSON text literals.
Quick start
[]
= "0.1"
= { = "1", = ["derive"] }
= "1"
use Serialize;
use ;
Example
Testing
Documentation
- API docs can be generated locally via
cargo doc --open. - Additional usage notes live under
docs/usage.md.