kali
[!CAUTION] This is a work in progress and is not ready for even alpha use yet.
a query builder and orm-ish crate for rust, built on sqlx
todo
- updating entities
- optional relations
- support for joins and preloading collections/relations with them
- support for streaming collections
- support for caching relations
try_unwrap()andunwrap()load()andload_all()use cached data when available, otherwise loads and caches
- codegen cli
- generate entities from an existing database
- avoids the entities getting out of sync with the database
- allow mapping types
- option 1:
#[map_type(bool, optional_transformer)]which is read by the codegen before overwriting the file - option 2: toml config file that specifies custom mappings
- option 1:
example
// Finding an entity
let user = fetch_one.await?;
let profile = user.profile.load.await?;
// Finding an entity with a filter
let found_user = query
.where
.where
.order_by
.fetch_one
.await?;
// Deleting an entity by id
delete_one.await?;
// Escape hatch
let user: User = query_as
.bind
.fetch_one
.await?;