Table of Contents
This project is heavily inspired by Lazygit, which I think is the best TUI client for Git.
I wanted to have a tool like that, but for SQL. I didn't find one that fits my needs, so I created one myself.
I live in the terminal, so if you are like me, this tool can become handy for you too.
This is my first Open Source project, also, this is my first Go project. I am not a brilliant programmer. I am just a typical JavaScript developer that wanted to learn a new language, I also wanted a TUI SQL Client, so white and bottled.
This project is in ALPHA stage, please feel free to complain about my spaghetti code.
I use Lazysql daily in my full-time job as a full-stack javascript developer in its current (buggy xD) state. So, the plan is to improve and fix my little boy as a side-project in my free time.
- Cross-platform (macOS, Windows, Linux)
- Vim Keybindings
- Can manage multiple connections (Backspace)
- Tabs
- SQL Editor (CTRL + e)
brew tap jorgerojas26/lazysql
brew install lazysql
go install github.com/jorgerojas26/lazysql@latest
For Windows, macOS or Linux, you can download a binary release here
Arch Linux users can install it from the AUR with:
paru -S lazysql
or
yay -S lazysql
or install it manual with:
git clone https://aur.archlinux.org/lazysql.git
cd lazysql
makepkg -si
$ lazysql
- MySQL
- PostgreSQL
- SQLite
- MSSQL
- MongoDB
Support for multiple RDBMS is a work in progress.
Key | Action |
---|---|
q | Quit |
CTRL + e | Open SQL editor |
Backspace | Return to connection selection |
? | Show keybindings popup |
Key | Action |
---|---|
c | Edit table cell |
d | Delete row |
o | Add row |
/ | Focus the filter input or SQL editor |
CTRL + s | Commit changes |
> | Next page |
< | Previous page |
K | Sort ASC |
J | Sort DESC |
H | Focus tree panel |
[ | Focus previous tab |
] | Focus next tab |
X | Close current tab |
R | Refresh the current table |
Key | Action |
---|---|
L | Focus table panel |
G | Focus last database tree node |
g | Focus first database tree node |
Key | Action |
---|---|
CTRL + R | Run the SQL statement |
CTRL + Space | Open external editor (Linux only) |
Specific editor for lazysql can be set by $SQL_EDITOR
.
Specific terminal for opening editor can be set by $SQL_TERMINAL
postgres://user:pass@localhost/dbname
pg://user:pass@localhost/dbname?sslmode=disable
mysql://user:pass@localhost/dbname
mysql:/var/run/mysqld/mysqld.sock
sqlserver://user:[email protected]/dbname
mssql://user:[email protected]/instance/dbname
ms://user:[email protected]:port/instance/dbname?keepAlive=10
oracle://user:[email protected]/sid
sap://user:pass@localhost/dbname
file:myfile.sqlite3?loc=auto
/path/to/sqlite/file/test.db
odbc+postgres://user:pass@localhost:port/dbname?option1=
- Support for NoSQL databases
- Columns and indexes creation through TUI
- Table tree input filter
- Custom keybindings
- Show keybindings on a modal
- Rewrite row
create
,update
anddelete
logic
See the open issues for a full list of proposed features (and known issues).
We use atotto/clipboard to copy to clipboard.
Platforms:
- OSX
- Windows 7 (probably work on other Windows)
- Linux, Unix (requires 'xclip' or 'xsel' command to be installed)
Contributions, issues, and pull requests are welcome!
Distributed under the MIT License. See LICENSE.txt
for more information.
Jorge Rojas - LinkedIn - [email protected]