// server/repository — Database access layer (CRUD) // // Each sub-module owns the queries for one domain entity. // All functions accept `&AnyPool` and return `Result<_, DbError>`, // so the caller never has to think about raw SQL or connection management. // // Design choices: // - Free functions (not struct methods) keep the API simple. // - `sqlx::query()` is used instead of `sqlx::query!()` because the // compile-time macro requires a live database at build time. // - All integer columns are read as `i64` (the AnyPool normalizes // INTEGER/BIGINT to 64-bit integers internally). // - Port numbers are stored as i64 in the DB and cast to u16 in Rust // (safe because valid port numbers 0–65535 fit in u16). pub mod applications; pub mod hosts; pub mod networks; pub mod ports;