Skip to main content

floz_orm/
lib.rs

1//! # floz
2//!
3//! A lightweight, typesafe Rust ORM that unifies DAO (Active Record) and
4//! DSL (Query Builder) APIs from a single `schema!` definition.
5//!
6//! ```ignore
7//! use floz::prelude::*;
8//!
9//! floz::schema! {
10//!     model User("users") {
11//!         id:   integer("id").auto_increment().primary(),
12//!         name: varchar("name", 100),
13//!         age:  short("age"),
14//!     }
15//! }
16//! ```
17
18// Allow the proc macro codegen to reference `floz::` paths regardless of
19// how consumers alias this crate (e.g. `floz-orm` vs `floz`).
20extern crate self as floz;
21
22
23
24// Re-export the #[model] attribute macro
25pub use floz_macros::model;
26
27// Core modules
28pub mod types;
29mod value;
30mod error;
31mod column;
32mod expr;
33mod query;
34mod db;
35mod paginate;
36mod hooks;
37
38// Public API
39pub use value::Value;
40pub use error::FlozError;
41pub use column::{Column, AnyColumn};
42pub use expr::{Expr, OrderExpr, OrderDirection};
43pub use db::{Db, Tx, Executor, FlozRowBound};
44pub use query::select::SelectQuery;
45pub use query::insert::{InsertQuery, InsertManyQuery};
46pub use query::update::UpdateQuery;
47pub use query::delete::DeleteQuery;
48pub use paginate::{Paginated, PaginateQuery};
49pub use hooks::FlozHooks;
50
51// Re-export sqlx — the floz crate accesses SQL primitives through floz_orm,
52// keeping sqlx as a single-owner dependency.
53pub use sqlx;
54
55pub mod prelude;
56pub mod migration;