Expand description
Exemplar is a boilerplate eliminator for rusqlite.
Getting Started
A taste of what you can do:
#[derive(Model)]
#[table("users")]
#[check("schema.sql")]
struct User {
username: String,
#[bind(bind_path)]
#[extr(extr_path)]
home_dir: PathBuf,
#[column("pwd")]
password: Vec<u8>,
}Exemplar is based around the Model trait, which has its own derive macro.
Macros
- Generate an “anonymous” record
structthat implementsfrom_row. - Generate an SQL-compatible field-less
enum.
Structs
- Metadata about a
Modelimplementor.
Enums
- Possible conflict resolution strategies when using
Model::insert_or. Cow-like type for query parameters.
Traits
- An interface for types that model database tables.
Type Aliases
- Type alias for the outcome of converting a value to an SQL-friendly representation.
- Type alias for the outcome of extracting a value from a
Row. - Type alias for a boxed slice of named query parameters.
Derive Macros
- Derive macro for the
Modeltrait.