Expand description
§apiplant-db
The database layer. It has two jobs:
- Migrations ([
migrate]) — make Postgres match the resource schemas. - CRUD (
Db) — build parameterised statements for aResourceat runtime and hand rows back as plain JSON.
Rows come back as JSON by letting Postgres do the conversion (to_jsonb /
jsonb_agg), so the executor only ever extracts a single JSON column and
never needs a compile-time entity for a table it only learned about from a
TOML file. Values always travel as $n bind parameters; only validated,
double-quoted identifiers are ever interpolated.
Re-exports§
pub use migrate::migrate;
Modules§
Structs§
- Db
- A connection pool plus the dynamic CRUD executor.