LazySQL puts a database client inside the terminal, Lazygit style
A cross-platform TUI database management tool written in Go.
At a glance
- What is it?
- LazySQL is a Go terminal UI for MySQL, PostgreSQL, MSSQL, SQLite and ClickHouse, with vim keys, tabs and a TOML file that holds saved connections. It suits developers who already live in a shell, and its DBName behaviour and per-connection read-only switch are worth checking before you point it at a production instance.
- Who is it for?
- Adopt LazySQL if you already work in a shell, keep connections in a text file you can commit, and want one binary across macOS, Linux and Windows with a per-connection read-only switch. Check the README's Commands and Keybindings sections before relying on it for result export, schema diffing or a query history, and do not treat it as a replacement for a desktop client on the databases you care about.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 26 days ago.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- jorgerojas26/lazysql4,430 ★ · +109
| Repository | 2026-09-23 | 2026-11-13 |
|---|---|---|
| jorgerojas26/lazysql | 4.3k | 4.4k |
109 Stars in the last 51 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The gap the author hit writing SQL without leaving the shell
Most database work happens in a terminal, and most database tools do not. A developer who keeps a shell open for version control, process management and logs still has to switch windows to inspect a table, run a count, or check a column type. LazySQL is the author's answer to that gap, built explicitly on the pattern Lazygit established for Git: a single full-screen interface where the object you are working on is selected on the left and its contents fill the pane beside it. The stated audience is narrow and honest, a developer who lives in the terminal and wants SQL browsing to feel like editing files. The feature set confirms the scope rather than a general-purpose client. Cross-platform support for macOS, Windows and Linux, vim keybindings, multiple stored connections reachable with Backspace, tabs, and a SQL editor opened with CTRL + e. There is no import of dump files, no schema diff view and no result export in that list. The driver set is broad instead, and it is fixed in go.mod: lib/pq for PostgreSQL, go-sql-driver/mysql, microsoft/go-mssqldb, modernc.org/sqlite for SQLite without cgo, and clickhouse-go v2, plus dburl to parse connection strings. Whether that combination of narrow workflow and broad driver coverage is right depends on whether you browse databases as often as you script them.
Connections live in a TOML file that moves with XDG_CONFIG_HOME
Every saved connection is an entry in a TOML file, not in a local database of the tool's own. If XDG_CONFIG_HOME is set, the file is ${XDG_CONFIG_HOME}/lazysql/config.toml. If it is not set, Windows uses %APPDATA%\lazysql\config.toml, macOS uses ~/Library/Application Support/lazysql/config.toml and Linux uses ~/.config/lazysql/config.toml. Because the file is plain text, a connection can be committed to a dotfiles repository, generated by a provisioning script, or copied to a colleague. That is the single most useful design decision in the project, and it is also the one that makes it unusual. Each entry carries a Name, a Provider, a DBName and a URL, and the URL can use ${placeholder} values filled by the entry's Commands, such as a forwarded port or a user name saved from command output. Application-level settings live under [application] in the same file, including DefaultPageSize, DisableSidebar, SidebarOverlay and JSONViewerWordWrap. A connection entry can override the connection pool with max_open_connections and max_idle_connections. An omitted value inherits the application setting, an explicit 0 falls back to LazySQL's default of 8, and an idle count larger than the open count is rejected.
ReadOnly is a per-connection switch, not a global mode
The ReadOnly field on a database entry defaults to false and can be set to true per connection. When it is on, LazySQL blocks every mutation query it recognises, INSERT, UPDATE, DELETE and DROP among them, so a single production entry can sit next to a scratch entry without one guarding the other. The value is written into the config file, which means the guard travels with the file and is not a runtime toggle you can lose by closing the terminal. That is the detail worth reading carefully, because the protection is a configuration property and not a permission enforced by the server: the database login in the URL still carries whatever privileges it has, and a query sent through another client will not be touched. The pool settings behave the same way, per connection, with inheritance from the application section. SQLite is the exception, since it always runs one open and one idle connection to keep in-memory database behaviour intact and ignores the general pool values. If you are evaluating LazySQL as a way to make a production database safer to poke at, this switch is a genuine control. If you are evaluating it as a substitute for database permissions, it is not.
Installing on macOS, Linux and Windows, then opening the first connection
Homebrew covers macOS and Linux with a single command, and the Go toolchain route works anywhere Go is already installed. Both commands put a lazysql binary on your PATH:
brew install lazysqlgo install github.com/jorgerojas26/lazysql@latestWindows users have no package manager entry documented and are pointed at the prebuilt binaries on the repository's own downloads page. Arch Linux has community packages maintained outside the repository, installed with paru -S lazysql or yay -S lazysql, or built from the AUR git repository with makepkg -si. Run lazysql with no arguments and you land on a connection picker. Press a to add a connection, which opens the in-app form, or e to edit the one selected. The connection picker is also where Backspace reaches the existing connections, and each entry you save is written into the same config.toml described earlier. From there, CTRL + e opens the SQL editor for the current connection, and tabs hold more than one open session so you can compare a production count against a local one. The repository also ships a docker-compose.yml for a manual test environment: MySQL on 127.0.0.1:3307, PostgreSQL on 127.0.0.1:5433, an amd64 MSSQL service, and seed SQL mounted from testdata into each container's entrypoint directory. That file exists for manual testing, not for production use.
The sidebar gets pinned to one database by the very form that creates it
Here is the catch that a skim misses. DBName is documented as optional, and when it is empty or omitted the sidebar lists every database on the instance that the connecting user has CONNECT privileges on, which is exactly what you want when one PostgreSQL login is valid across several databases. But the in-app connection form auto-fills DBName from whatever database is embedded in the connection URL, and saving through that form therefore pins the tree to that single database. A connection you add by hand, thinking you are getting instance-wide browsing, gets a single-database tree, and the fix is either to delete the DBName line from config.toml or to tick Show all databases in this instance in the connection form. The About section calls the project ALPHA while the feature list is entirely checked off, and the same author describes using it daily in a full-time job in its current, in their words, buggy state. That combination of honest labelling and daily use is a fair description of what to expect.
Packaged builds phone home unless you switch the count off
Packaged builds disclose minimal anonymous aggregate usage counts before sending anything, and the default is to keep telemetry enabled. Source builds send nothing at all, which means a `go install` of the tagged code and a Homebrew binary can behave differently on the network even though the code looks the same. Opting out is either the Disable choice in the prompt or the --no-telemetry command line flag. The project keeps a separate telemetry document covering the data collected, the opt-out path, the stated limitations and instructions for self-hosting the endpoint. That last point is the one to check first if telemetry is a blocker for you, since a self-hosted collector is a different operational commitment than a local SQLite file or a config.toml. For an engineer who would rather not have a database client call home at all, installing from source removes the question. For a team that only cares about aggregate counts, the default keeps the author's numbers honest without touching anything else.
Where Harlequin differs: Python internals against a Go binary
Harlequin is the closest comparison to make. The difference is in what the two tools assume about the environment. Harlequin is a Python application. LazySQL is a single Go binary that depends on database/sql through five drivers, and its interface conventions come from Lazygit rather than from a Python TUI. The practical consequences follow from that. LazySQL ships as one file with no interpreter to install, which matters on a locked-down workstation or a container where the tool is copied in rather than managed by pip. The choice is between a static binary with vim keys and a TOML file, and a Python tool that fits an existing Python setup. LazySQL also notes its inspiration openly, which makes the design lineage easy to trace when a keybinding feels familiar.
A Go 1.23 module with five drivers and lint tooling around it
The build targets Go 1.23.0 as declared in go.mod, and the dependency list is long rather than tidy: BurntSushi/toml, tview, tcell, fuzzysearch and five database drivers sit next to the Azure SDK pieces that mssqldb pulls in. The repository ships .golangci.yml, a goreleaser configuration, an AGENTS.md, a CONTEXT.md and a .lazysql.example.toml, which is the shape of a project with tooling around it rather than a script someone runs from a home directory. Nothing in that setup is a substitute for knowing who answers when a driver breaks. The last push was on 2026-10-20, so the code is moving rather than sitting still, and the author uses it daily in what they call its current buggy state. Whether that pace suits you depends on how much of your own tooling you are willing to keep around the connection file, and on how comfortable you are being an early user of a database client that blocks your mutations rather than asking twice.
Editorial conclusion
Adopt LazySQL if you already work in a shell, keep connections in a text file you can commit, and want one binary across macOS, Linux and Windows with a per-connection read-only switch. Check the README's Commands and Keybindings sections before relying on it for result export, schema diffing or a query history, and do not treat it as a replacement for a desktop client on the databases you care about. Verify two things before pointing it at anything important: open the connection in the picker and confirm the sidebar lists the databases you expect, since the in-app form auto-fills DBName and pins the tree to one of them, then set ReadOnly = true on that entry in config.toml and check that your driver and your privileges agree.
Frequently asked questions
How do I use LazySQL?
Install the binary with brew install lazysql, go install github.com/jorgerojas26/lazysql@latest, or download a prebuilt binary for Windows, macOS or Linux. Running it opens a connection picker where a adds a connection and e edits the selected one, CTRL + e opens the SQL editor, and Backspace reaches your saved connections.
Where does LazySQL keep its connections?
In a TOML file at ${XDG_CONFIG_HOME}/lazysql/config.toml when XDG_CONFIG_HOME is set, otherwise %APPDATA%\lazysql\config.toml on Windows, ~/Library/Application Support/lazysql/config.toml on macOS and ~/.config/lazysql/config.toml on Linux.
Can LazySQL stop me from running DELETE by accident?
Setting ReadOnly = true on a connection entry blocks mutation queries such as INSERT, UPDATE, DELETE and DROP for that connection. It is a configuration setting that travels with config.toml, not a database permission, so the login in the URL keeps whatever privileges the server grants it.
Which databases does LazySQL connect to?
go.mod lists lib/pq for PostgreSQL, go-sql-driver/mysql, microsoft/go-mssqldb, modernc.org/sqlite for SQLite and clickhouse-go v2 for ClickHouse, with xo/dburl used to parse connection strings. SQLite always uses one open and one idle connection to preserve in-memory behaviour.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/jorgerojas26-lazysql)Star history chart for your README
[](https://hysenlabs.com/projects/jorgerojas26-lazysql)Was this useful?