1 unstable release
Uses new Rust 2024
| 0.6.0 | Jan 11, 2026 |
|---|
#8 in #access-layer
30KB
189 lines
emixdiesel
emixdiesel offers repository traits, DTO helpers, and opinionated filters for
building async Diesel-based data access layers that stay compatible with the
rest of EssentialMix.
Feature Flags
sqlite/postgres/mysql: Enable the respective Diesel backends.sqlite-bundled,postgres-bundled,mysql-bundled: Pull in vendored client libraries so you can build without system dependencies.full: Turn on every backend (non-bundled).full-bundled: Turn on every backend with vendored client libraries.
[dependencies]
emixdiesel = { path = "../../crates/db/diesel", features = ["postgres"] }
Quick Example
use emixdiesel::prelude::*;
use emixdiesel::{ClosureFilter, TFilterQuery};
use crate::schema::posts::dsl::*;
// Start from any boxed Diesel query (useful inside repositories).
let query = posts.into_boxed();
// Wrap your filtering logic so it composes with the repository traits.
let only_published = ClosureFilter::new(|q| q.filter(published.eq(true)));
let filtered = only_published.apply(query);
Dependencies
~7–37MB
~559K SLoC