Skip to main content

Module ops

Module ops 

Source
Expand description

Persistence operations — load, save, and query application settings backed by a redb embedded key-value database.

Functions§

get_last_repo
Convenience: get the last opened repo path.
get_saved_layout
Convenience: get saved layout preferences.
get_saved_theme
Convenience: get saved theme name.
load_settings
Load settings from the database. Returns default settings if the database doesn’t exist or any table is missing.
record_repo_and_save_session
Record that a repo was opened AND update the session in one DB write. Returns the updated recent-repos list.
record_repo_opened
Convenience: record that a repo was opened (updates history + last_repo).
save_layout
Convenience: save layout preferences.
save_session
Persist the open-tab session without touching the recent-repos list.
save_settings
Save settings to the database. Creates the database and tables if needed.
save_theme
Convenience: save theme preference.
settings_dir
Get the settings directory (~/.config/gitkraft/ or platform equivalent).