How jorgerojas26/lazysql works
LazySQL is a terminal-based SQL database management client. Users start in a connection picker or supply a connection URL, select or open a database, browse data, and use the SQL editor or table views to inspect and modify data; query results can be explored and exported. The repository also includes query history and saved-query workflows, schema browsing, configurable themes, and database-specific drivers. The graph follows documented startup and sampled source references; links for unsampled subsystem internals are omitted rather than inferred.
Main entry points: driver.go Driver interface · main.go CLI startup · home.go Database workspace · results_table.go Results table
Components 22
Startup and configuration
- CLI startup
main.go - App configuration
app/config.go - TUI runtime
app/app.go
Database interface
- Connection picker
components/connection_selection.go - Database workspace
components/home.go - Schema browser
components/tree.go - Results table
components/results_table.go
Query workflows
- SQL editor
components/sql_editor.go - Query routing
components/query_routing.go - CSV export
components/csv_export_query.go - Query history UI
components/query_history_component.go - History and saved tabs
components/query_history_modal.go - Pending change review
components/query_preview_modal.go
Local persistence
- History persistence
internal/history/manager.go - Saved query storage
internal/saved/manager.go
Database drivers
- Driver interface
drivers/driver.go - PostgreSQL driver
drivers/postgres.go - MySQL driver
drivers/mysql.go - SQLite driver
drivers/sqlite.go - ClickHouse driver
drivers/clickhouse.go - SQL Server driver
drivers/mssqql.go
Other components
- Terminal user
Connections 21
- Terminal user → CLI startup: starts
main.go - CLI startup → App configuration: loads config
main.go - CLI startup → Connection picker: opens connection
main.go - CLI startup → TUI runtime: runs TUI
main.go - CLI startup → Database workspace: creates pages
main.go - App configuration → Driver interface: configures providers
app/config.go - Database workspace → Schema browser
- Database workspace → Results table
- SQL editor → Query routing
- Query routing → Driver interface: checks provider
components/query_routing.go - Results table → Driver interface: uses driver
components/results_table.go - Results table → History persistence: records queries
components/results_table.go - History and saved tabs → Query history UI: creates history tab
components/query_history_modal.go - Query history UI → History persistence: reads history
components/query_history_component.go - History and saved tabs → Saved query storage
- Pending change review → Driver interface: executes changes
components/query_preview_modal.go - Driver interface → PostgreSQL driver
- Driver interface → MySQL driver
- Driver interface → SQLite driver
- Driver interface → ClickHouse driver
- Driver interface → SQL Server driver