Skip to main content

Crate toasty_sql

Crate toasty_sql 

Source
Expand description

SQL serialization for Toasty.

This crate converts Toasty’s statement AST into SQL strings for SQLite, PostgreSQL, and MySQL. It also generates DDL statements for schema migrations.

Re-exports§

pub use serializer::Serializer;
pub use stmt::Statement;
pub use migration::*;

Modules§

migration
Schema migration statement generation.
serializer
SQL serialization and parameter handling.
stmt
SQL statement types for both DML and DDL operations.
value_json
JSON encoding for stmt::Values stored in document-backed columns. JSON encoding for stmt::Values stored in document-backed columns (MySQL JSON, SQLite TEXT via the JSON1 extension, and eventually PostgreSQL jsonb for #[document]-marked fields). The conversion is intentionally a plain pair of functions rather than a Serialize / Deserialize impl on stmt::Value: the encoding is opinionated (UUIDs / decimals / timestamps as JSON strings) and matches the per-column TEXT encoding the same scalar would have at the SQL level. Backends with typed document storage (BSON, DynamoDB) need different representations.