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
//! Typed async repository layer over SQLx/Postgres.
//!
//! The repository layer gives domain structs a type-safe CRUD API without
//! hand-written SQL. Annotate a struct with `#[schema]` (from
//! [`macros::schema`]) and it gains:
//!
//! - `InsertRow` / `UpdateRow` / `PatchField` / `Field` generated types
//! - Blanket implementations of [`implement::Interface`] for `select`,
//! `insert_one`, `update_many`, and `patch`
//! - Row-level auth key filtering via [`implement::KeyAuths`]
//!
//! # Quick start
//!
//! Add `#[schema]` to a domain struct:
//!
//! ```text
//! #[schema]
//! pub struct User {
//! pub id: i32,
//! pub name: String,
//! }
//! ```
//!
//! Then call `User::select(&ctx, vec![Field::All])` etc. from your handlers.
// mod sql_parts;