Expand description
Database management for the Peillute application
This module handles all database operations, including user management, transaction processing, and state synchronization. It uses SQLite as the underlying database engine.
Structs§
- DB_CONN
- Transaction
- Represents a transaction in the system
Constants§
- NULL 🔒
- Special value representing a null user
Functions§
- calculate_
solde - Calculates the current balance for a user
- create_
transaction - Creates a new transaction between users
- create_
user - Creates a new user with zero balance
- delete_
user - Deletes a user from the database
- deposit
- ensure_
user - Ensures a user exists, creating it if necessary
- get_
local_ state - Get the local state of the site
- get_
local_ transaction_ log - get_
transaction - get_
transactions_ for_ user - get_
users - has_
been_ refunded - init_db
- Initializes the database schema
- is_
database_ initialized - Checks if the database has been initialized
- print_
transaction_ for_ user - print_
transactions - print_
users - refund_
transaction - transaction_
exists - Check if a transaction exists in the database
- update_
db_ with_ snapshot - Update the database with a snapshot
- update_
local_ state - Update the local state of the site
- update_
solde - Updates the stored balance for a user
- user_
exists - Checks if a user exists in the database
- withdraw