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// Re-export the schema! proc macro
23pub use floz_macros::schema;
24
25// Core modules
26mod value;
27mod error;
28mod column;
29mod expr;
30mod query;
31mod db;
32mod paginate;
33mod hooks;
34
35// Public API
36pub use value::Value;
37pub use error::FlozError;
38pub use column::{Column, AnyColumn};
39pub use expr::{Expr, OrderExpr, OrderDirection};
40pub use db::{Db, Tx, Executor};
41pub use query::select::SelectQuery;
42pub use query::insert::{InsertQuery, InsertManyQuery};
43pub use query::update::UpdateQuery;
44pub use query::delete::DeleteQuery;
45pub use paginate::{Paginated, PaginateQuery};
46pub use hooks::FlozHooks;
47
48pub mod prelude;