Skip to main content

Crate tusker_query_derive

Crate tusker_query_derive 

Source
Expand description

§tusker-query-derive

tusker-query-derive provides the derive macros behind tusker-query.

It exports:

  • #[derive(Query)] for binding a named Rust struct to a SQL file in db/queries/
  • #[derive(FromRow)] for decoding a tokio_postgres::Row into a named Rust struct
  • optional compile-time validation when matching .json sidecar metadata exists next to the SQL file

This crate is usually consumed through tusker-query rather than as a direct dependency.

§License

Licensed under either of

at your option.

Derive Macros§

FromRow
Derives tusker_query::FromRow for a named struct.
Query
Derives tusker_query::Query for a named struct.