Features
- Works with raw SQL, not against it. Exemplar is not an ORM.
- Thin, zero-cost API.
- Most of Exemplar revolves around the
Modeltrait, which gets inlined and monomorphized away before runtime. The resulting code is roughly what you'd write by hand when using purerusqlite. - Designed to be drop-in; reuses
rusqlite's existing types where possible, including itsResulttype alias. - Supports any type that
Deref's torusqlite::Connection, such as transactions or pooled connections.
- Most of Exemplar revolves around the
- Optional test derivation for guarding against drift between your database schema and Rust model types.
- Macros for working with SQL-compatible
enums and "anonymous" record types that map to ad-hoc queries.
If you just need to CRUD some Rust data with sqlite and don't want a whole ORM or enterprise-grade DBMS, then Exemplar is for you!
Cargo Features
- (Default)
sql_enum- enables thesql_enummacro. Depends onnum_enum.
Won't Support
- Schema generation and management. It's very difficult to represent concepts like foreign keys and migrations without falling into ORM territory.
- If this is a "must" for you, check out
dieselorsqlx/seaorm.
- If this is a "must" for you, check out
- Database interfaces besides
rusqlite.- (I may extend support to
sqliteif there is demand, but it's likely to be less performant as it lacks statement caching.)
- (I may extend support to
Acknowledgements
rusqlite, for providing the foundation on which this library is built.- David Tolnay, for his various proc macro
incantationscrates.