emixdb

Crates.ioemixdb
lib.rsemixdb
version0.6.0
created_at2026-01-11 14:03:16.05521+00
updated_at2026-01-11 14:03:16.05521+00
descriptionDTOs, pagination, and merge traits shared across EssentialMix database crates.
homepage
repositoryhttps://github.com/asm2025/essentialmix-rs
max_upload_size
id2035859
size19,414
asm (asm2025)

documentation

README

emixdb

emixdb provides DTOs and traits that are shared between the Diesel and SeaORM adapters in EssentialMix. Use it to keep pagination, result metadata, and model merge semantics consistent across database backends.

Building Blocks

  • Pagination: Captures page number and page size with sensible defaults.
  • ResultSet<T>: Couples result data with totals and pagination metadata.
  • ModelWithRelated<M, R>: Wraps a primary model and its related entities.
  • models::TMerge: Trait for applying update DTOs onto existing models.

Quick Example

use emixdb::dto::{Pagination, ResultSet};

fn first_page<T>() -> Pagination {
    Pagination::default() // page 1, page_size 10
}

fn empty<T>() -> ResultSet<T> {
    ResultSet {
        data: Vec::new(),
        total: 0,
        pagination: Some(first_page()),
    }
}

Implement TMerge on your update DTOs to reuse the repository logic across the Diesel and SeaORM crates.

Commit count: 272

cargo fmt