1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// SPDX-License-Identifier: MIT OR Apache-2.0
//! PersistAnt: a thin persistence layer over Apache OpenDAL, for blobs and records by key.
//!
pub use ;
pub use ;
// The other kinds of persistence, behind features that are off by default. Additive: nothing here
// changes `Store`, `Config`, `Need` or any other item above. Names avoid `core` and `opendal`
// because those are already names in scope here.
/// The capability vocabulary, the matrix file and its gate lookup (`persistant-core`).
pub use persistant_core as capability;
/// The blob trait, its reference backend and its contract tests (`persistant-blob`).
pub use persistant_blob as blob;
/// The key-value trait, `KvOnBlob`, `KvOnRelational`, leases and their contract tests
/// (`persistant-kv`).
pub use persistant_kv as kv;
/// The small relational trait, values and typed errors (`persistant-relational`).
pub use persistant_relational as relational;
/// The OpenDAL blob driver and `ProcessLock` (`persistant-opendal`).
pub use persistant_opendal as opendal_driver;
/// The PostgreSQL driver over sqlx (`persistant-sqlx`). Needs Rust 1.94.
pub use persistant_sqlx as sqlx_driver;
/// The crate version, as declared in `Cargo.toml`.
pub const VERSION: &str = env!;
/// Compile-time SQL (feature `sql-macros`): `sql!` checks a literal statement and translates it for
/// every target named, at build time. The syntax, the placeholders and every target's translation are
/// build errors, not run-time ones; no database is consulted and no schema is read yet (the
/// catalog-based checks are a later stage, `docs/COMPILE-TIME-SQL.md`).
///
/// ```
/// use persistant::{Sql, sql};
/// const FIND: Sql = sql!(
/// source = postgres, targets = [postgres, sqlite],
/// "SELECT id FROM users WHERE id = $1"
/// );
/// assert_eq!(FIND.params, 1);
/// ```
///
/// A statement that cannot be translated for a named target does not build. The twin above is the same
/// call with the fault (`md5` has no SQLite form) removed:
///
/// ```
/// use persistant::{Sql, sql};
/// const OK: Sql = sql!(source = postgres, targets = [postgres], "SELECT md5($1)");
/// ```
///
/// ```compile_fail
/// use persistant::{Sql, sql};
/// const BAD: Sql = sql!(source = postgres, targets = [postgres, sqlite], "SELECT md5($1)");
/// ```
pub use sql;
/// What `sql!` expands to, and the extension traits that run it (feature `sql-macros`).
pub use ;