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
//! Rust model generation from an introspected database.
//!
//! The companion to the TypeScript generator: the same introspected schema, emitted
//! as `sqlx` models instead of Drizzle tables. Generation follows the layout the
//! hand-written models use, so generated code is indistinguishable from code written
//! by hand — one folder per table, holding:
//!
//! - `mod.rs` — the struct, its derives, `Default`, and `new`
//! - `create.rs` — the insert
//! - `read.rs` — the listing and the keyed lookup
//! - `update.rs` — the update
//! - `delete.rs` — the delete
//!
//! Each CRUD file contributes an `impl` block to the struct the module root declares
//! and reaches it through `use super::<Name>`. Splitting by verb keeps every file
//! short enough to read whole, and means a developer looking for one statement knows
//! which file holds it before opening anything.
pub use write as write_api;
pub use ;
pub use Model;
pub use ;