sentinel
Compile-time guarded ORM for PostgreSQL — your data's guardian from compile to production.
N+1 queries, over-fetching, unsafe relation access — caught at compile time, not production.
Quick Start
[]
= "0.1"
use *;
async
Features
- Compile-time guards — N+1, over-fetching, and unsafe relation access caught before runtime
- Type-state relations —
User<Bare>vsUser<WithPosts>, compile error on unloaded access - Partial types —
#[derive(Partial)]generates narrow select types, no over-fetching - Reducer pattern —
#[reducer]for transactions with auto-commit/rollback - Deadlock prevention — auto-reorder locks by ID
- 4-layer query system — from simple CRUD to raw SQL, always type-safe, always parameterized
- Zero unsafe in core — security by construction
- Built on sentinel-driver — SCRAM-SHA-256, pipeline mode, binary format, rustls
Architecture
crates/
├── sntl # Umbrella crate — cargo add sntl, ready to go
├── sntl-core # Model trait, QueryBuilder, types, connection
├── sntl-macros # derive(Model), derive(Partial), #[reducer]
├── sntl-migrate # Schema diff, migration generation
└── sntl-cli # CLI binary (sentinel command)
Development
MSRV
Rust 1.85 (declared via rust-version in Cargo.toml).
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.