Skip to content
crates · rust

Row-to-struct derive forembeddb

The #[derive(FromEmbedRow)] procedural macro for embeddb — maps DuckDB analytics rows into your structs by column name, with Option and type-checked conversions.

Companion to embeddb

Re-exported through embeddb's default derive feature, so #[derive(FromEmbedRow)] works from a single dependency.

  • By name — fields map to columns by identifier, not position.
  • Typed — conversions go through FromEmbedValue with clear errors.
embeddb-derivePackage
2021Edition
0.1.0Version
MITLicense

What it gives you

Features

FromEmbedRow derive

Generates a FromEmbedRow impl mapping analytics rows into structs by column name.

Typed conversions

Fields convert through FromEmbedValue — i64, f64, String, bool, i128, Vec, Option.

Clear errors

Missing column or type mismatch on a non-Option field errors, naming the column.

Questions

Frequently asked

What is the embeddb-derive crate?

embeddb-derive is the procedural macro crate for embeddb. It provides

How does it relate to embeddb?

It is a companion crate to embeddb. The embeddb crate re-exports the derive under its default-on derive feature, so consumers write

What field types does the derive support?

Fields convert through the FromEmbedValue trait — i64, f64, String, bool, i128, Vec<u8>, and Option<T> (None for a null or absent column). A missing column or type mismatch on a non-Option field returns an error naming the column.