ferriorm_runtime/lib.rs
1//! Runtime library shipped with the user's application.
2//!
3//! This crate provides everything the generated ferriorm client needs at runtime:
4//!
5//! - [`client::DatabaseClient`] -- connection pool wrapper (PostgreSQL + SQLite)
6//! - [`filter`] -- type-safe filter structs (`StringFilter`, `IntFilter`, ...)
7//! - [`query::SqlBuilder`] -- parameterized SQL builder supporting `$1` and `?` styles
8//! - [`order`] -- `SortOrder` and `OrderByClause` trait
9//! - [`transaction`] -- transaction execution helpers
10//! - [`error::FerriormError`] -- unified error type
11//!
12//! A [`prelude`] module re-exports the most commonly used items.
13//!
14//! # Related crates
15//!
16//! - `ferriorm_core` -- domain types (this crate does not depend on `ferriorm-core`
17//! at runtime; the generated code bridges the two).
18//! - `ferriorm_codegen` -- generates code that depends on this crate.
19
20pub mod client;
21pub mod error;
22pub mod filter;
23pub mod order;
24pub mod query;
25pub mod transaction;
26
27pub mod prelude {
28 pub use crate::SetValue;
29 pub use crate::client::DatabaseClient;
30 pub use crate::client::PoolConfig;
31 pub use crate::error::FerriormError;
32 pub use crate::filter::*;
33 pub use crate::order::SortOrder;
34 pub use crate::query::SqlBuilder;
35 pub use chrono;
36 pub use sqlx;
37 pub use uuid;
38}
39
40/// Wrapper for update operations: distinguishes "not set" from "set to value".
41#[derive(Debug, Clone)]
42pub enum SetValue<T> {
43 Set(T),
44}