How cryals/fdbsqlite works
Project type and purpose
• This is an open-source, cross-platform CLI/TUI utility (written in C++ with sqlite3 amalgamation) for interactively and programmatically manipulating SQLite databases.
• It produces a single binary that can run in either CLI mode (automation scripts) or TUI mode (interactive text UI).
File structure
• Top-level:
• CMakeLists.txt + build scripts under scripts/ → build system and CI (release.yml)
• /sqlite3/ → embedded sqlite3 amalgamation (no external deps)
• src/ → application code:
– main.cpp → entry point
– Config.* → configuration loader (config.txt)
– DatabaseManager.* → core abstraction over sqlite3: execSQL, backup/restore
– CLI.* → command-line interface implementation
– TUI.* → text-UI (curses-style) implementation
• assets/ → static logos (not runtime)
Key insights from README
• Two modes: CLI and TUI
• Automatic backup before editing
• Configurable defaults via config.txt
• Single dependency: sqlite3 (embedded)
• Targets Windows/Linux/macOS via CMake
Detailed component breakdown
• main.cpp: “Entry Point & Mode Selector”
• Config Loader: reads config.txt → supplies default DB path, language, autosave flags
• CLI Module: parses arguments, dispatches commands
• TUI Module: renders text menu, captures user input
• DatabaseManager:
• execSQL(sql, &error)
• backupDatabase(path)
• restoreBackup(path)
• sqlite3 amalgamation: direct API calls (sqlite3_open, sqlite3_exec, sqlite3_close)
• Build System: CMakeLists.txt → generates build targets, scripts/build.sh/.bat → compile steps
• CI Pipeline: .github/workflows/release.yml → automates packaging and release