module

Yozgat::DB

Constants

SELECT_USER_COLUMNS = "id, email, password_hash, role, created_at"

Class methods

count_users
Source
create_admin(email : String, password_hash : String) : Int64 | Nil

Inserts the first (admin) user atomically. Returns the new id, or nil if a user already exists (the WHERE NOT EXISTS guard makes it race-free).

Source
database
Source
find_user_by_email(email : String) : UserRow | Nil
Source
find_user_by_id(id : Int64) : UserRow | Nil
Source
first_admin_email
Source
open!

Opens the SQLite file (creating the directory as needed) and applies pending migrations. WAL + busy_timeout + NORMAL synchronous.

Source
recover_after_restart!

Marks in-flight deploys/projects as failed after a process restart.

Source

Nested types