exemplar 0.5.0

A boilerplate eliminator for rusqlite.
Documentation

Exemplar is a boilerplate eliminator for rusqlite.

Getting Started

A taste of what you can do:

# use std::path::{PathBuf, Path};
# use exemplar::Model;
#[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>,
}
# fn bind_path(value: &Path) -> exemplar::BindResult { panic!() }
# fn extr_path(value: &rusqlite::types::ValueRef) -> exemplar::ExtrResult<PathBuf> { panic!() }

Exemplar is based around the [Model] trait, which has its own derive macro.

  • See the aformentioned macro's documentation to get started.
  • For handling enums in models, check out the [sql_enum] macro.

Cargo Features

  • (Default) sql_enum - enables the [sql_enum] macro. Depends on num_enum.