Skip to main content

persistant_relational/
lib.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! PersistAnt's relational kind: a **deliberately small** trait, no driver.
3//!
4//! `docs/DESIGN-KINDS.md` §3 rule 4 and D1 (C+): the trait runs a statement with parameters,
5//! begins a transaction, and reports the dialect and server version. It is not a query builder or
6//! a row mapper; a program that wants its own SQL checked at compile time (Humboldt's
7//! `sqlx::query!`) uses the concrete driver handle the driver crate hands out, not this trait. The
8//! trait exists so the key-value adapter, the capability matrix and migrations have one thing to
9//! call.
10//!
11//! Growth toward statement construction would turn this into Option B (§4.2) and carry its leaks;
12//! resist it.
13
14mod backend;
15#[cfg(feature = "sql")]
16mod bound;
17#[cfg(feature = "catalog")]
18pub mod catalog;
19pub mod choose;
20pub mod conformance;
21pub mod contract;
22mod error;
23mod migrate;
24pub mod migrate_conformance;
25#[cfg(feature = "sql")]
26pub mod row;
27mod secret;
28pub mod speed;
29#[cfg(feature = "sql")]
30mod sql_ext;
31mod sweep;
32mod value;
33
34pub use backend::{Isolation, RelationalBackend, RelationalTx};
35pub use error::RelError;
36pub use migrate::{MigrateError, MigrateReport, Migrates, Migration};
37pub use secret::{ConnectionSecret, Redacted};
38pub use sweep::{SweepError, SweepReport, sweep};
39pub use value::{Dialect, Row, Value};
40
41#[cfg(feature = "sql")]
42pub use bound::{Bound, InTx, Runner};
43#[cfg(feature = "sql")]
44pub use row::{Field, FieldKind, FromRow, FromValue, ToValue, TypedSql};
45#[cfg(feature = "sql")]
46pub use sql_ext::{
47    RelationalRowsExt, RelationalSqlExt, RelationalTxRowsExt, RelationalTxSqlExt, Sql, prepare,
48};
49/// `Query`, `Rendered`, `Target` and `Binding`: what `persistant::sql!` expands to (UniSQL's
50/// `unisql-embed`, re-exported so a consumer depends on neither).
51#[cfg(feature = "sql")]
52pub use unisql_embed as embed;