Expand description
§Sentinel ORM
Compile-time guarded ORM for PostgreSQL.
[dependencies]
sntl = "0.1"use sntl::prelude::*;Re-exports§
pub use core::error::Error;pub use core::error::Result;pub use core::observability;pub use driver;
Modules§
- core
- Core — Model trait, QueryBuilder, types, and connection abstraction. Sentinel Core — Model trait, QueryBuilder, types, and connection abstraction.
- migrate
- Migration tools — schema diff and migration generation. Sentinel Migrate — Schema diff and migration generation. Phase 1: Stub module, implementation in later phase.
- prelude
- Prelude — common imports for quick setup.
- types
- PostgreSQL extension types re-exported from the driver.
Macros§
- query
- Compile-time-validated
query!()family.sntl::query!("SQL", params…)— compile-time-validated query that returns an anonymous record (a private struct with one field per output column). - query_
as - Compile-time-validated
query!()family.sntl::query_as!(Target, "SQL", params…)— likequery!but loads each row into the user-suppliedTarget: FromRow. - query_
as_ unchecked - Compile-time-validated
query!()family.sntl::query_as_unchecked!(Target, "SQL", params…). - query_
file - Compile-time-validated
query!()family.sntl::query_file!("queries/foo.sql", params…)— load SQL from disk. - query_
file_ as - Compile-time-validated
query!()family.sntl::query_file_as!(Target, "queries/foo.sql", params…). - query_
pipeline - Compile-time-validated
query!()family.sntl::query_pipeline!(conn, name1: "SQL"; name2: "SQL" using Target, p1, p2; …). - query_
scalar - Compile-time-validated
query!()family.sntl::query_scalar!("SQL", params…)— single-column projection. - query_
unchecked - Compile-time-validated
query!()family.sntl::query_unchecked!("SQL", params…)— escape hatch that skips the.sentinel/cache and runs through the driver’s untypedquerypath.
Structs§
- Config
- Connection configuration for sentinel-driver.
- Oid
- Well-known PostgreSQL type OIDs.
- Pool
- A connection pool for PostgreSQL.
- Pooled
Connection - A connection checked out from the pool.
Traits§
- FromSql
- Decode a Rust value from PostgreSQL binary format.
- ToSql
- Encode a Rust value into PostgreSQL binary format.
Attribute Macros§
- sentinel
- Attribute macro —
#[sentinel(relations)]. Declare relations on a model.
Derive Macros§
- FromRow
- Derive macros —
#[derive(Model)],#[derive(Partial)],#[derive(FromRow)]. DeriveFromRowfor ad-hoc structs returned bysntl::query_as!. - FromSql
- Derive
FromSqlfor a newtype wrapper. - Model
- Derive the
Modeltrait for a struct. - Partial
- Derive a partial select type.
- ToSql
- Derive
ToSqlfor a newtype wrapper.