Expand description
Creating the first admin user (gize createadmin, ADR-017).
Connects with SQLx’s AnyPool (like crate::migrate) so one code path serves Postgres,
SQLite and MySQL. Because the Any driver passes SQL through unchanged, the INSERT uses
the dialect’s own placeholder style and id strategy — and binds the id as raw bytes so the
stored value is byte-for-byte what the generated app reads back for its uuid::Uuid id.
Functions§
- create
- Insert an admin user (
is_admin = true) into theuserstable.password_hashmust already be an Argon2 PHC string (seegize-auth). Rejects a duplicate email up front and reports a missinguserstable with guidance to migrate first.