Tables

categories

Expense category table; built-in categories cannot be deleted; custom categories can be added, edited, or removed

Design Notes

-------------------------------------------------------
Categories table (source: categories API)
-------------------------------------------------------
@table-comment categories Expense category table; built-in categories cannot be deleted; custom categories can be added, edited, or removed

Fields

NameTypeConstraintsNullableDefaultComment
PKAI id INTEGER - NO - Unique category identifier; auto-increment primary key
name TEXT - NO - Category name; unique constraint
icon TEXT - YES - Category icon emoji (optional)
is_default INTEGER - NO 0 Whether built-in category (0 = custom, 1 = built-in)
created_at TEXT - NO (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) Created at, ISO 8601 format

Indexes

NameTypeFields
-UNIQUEname

records

Expense records table; stores each user expense entry

Design Notes

-------------------------------------------------------
Expense records table (source: records API)
-------------------------------------------------------
@table-comment records Expense records table; stores each user expense entry

Fields

NameTypeConstraintsNullableDefaultComment
PKAI id INTEGER - NO - Unique record identifier; auto-increment primary key
amount INTEGER - NO - Amount in yuan, stored as integer hundredths of a yuan to avoid floating-point precision issues
category_id INTEGER FK → categories(id) NO - Category ID; foreign key to categories
created_at TEXT - NO (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) Created at, ISO 8601 format
remark TEXT - YES - Note (optional, max 200 characters)

Indexes

NameTypeFields
idx_records_created_atINDEXcreated_at
idx_records_category_idINDEXcategory_id

settings

User settings table; stores passcode lock and other preferences

Design Notes

-------------------------------------------------------
Settings table (source: settings API)
-------------------------------------------------------
@table-comment settings User settings table; stores passcode lock and other preferences

Fields

NameTypeConstraintsNullableDefaultComment
value TEXT - NO - Setting value (password-related values stored hashed)

password_salt

Password salt table; stores the salt for each password

Design Notes

-------------------------------------------------------
Password-related auxiliary table (optional; for password history, etc.)
-------------------------------------------------------
@table-comment password_salt Password salt table; stores the salt for each password

Fields

NameTypeConstraintsNullableDefaultComment
PK id INTEGER CHECK id = 1 NO - Salt identifier; currently only a single password is supported
salt TEXT - NO - Random salt, Base64-encoded