Show HN: Sqlit – A lazygit-style TUI for SQL databases
190 points| MaxTeabag | 2 months ago |github.com
I wanted something like lazygit for databases – run it, connect, and query and frankly just make it enjoyable to access data.
Sqlit is a keyboard-driven SQL TUI with:
- Context-based keybindings (always visible)
- Neovim-like interface with normal and insert mode for query editing
- Browse databases, tables, views, stored procedures
- Adapters for SQL Server, SQLite, PostgreSQL, Turso & more
- SSH tunneling support
- Themes (Tokyo Night, Nord, Gruvbox etc.)
Inspired by lazygit, neovim and lazysql. Built with Python/Textual.
Feedback welcome – especially on which adapters to prioritize next. My vision of sqlit is to make a tool that makes it easy to connect and query data, and to do that, and that thing only, really well.
tanin|2 months ago
It focuses more on editing and exploring data for power users. UI space is utilized well. Exploring millions of rows is a breeze. Writing SQLs and managing them is pleasant with the multi-tab approach.
I'm working through adding the shortcuts and modal mode. I want to make it more like vim where you just use shortcuts to do things.
It supports postgres, click house, and sqlite
I'm looking for early beta users. If you are interested in a GUI version, here: https://github.com/tanin47/backdoor
caminanteblanco|2 months ago
MaxTeabag|2 months ago
I am going to implement the option to leave the password blank, so you'll get prompted for a password on connection every time, so nothing will get stored.
In the next release I am going to use Keyring to store credentials on the operating system's credential store. Stay tuned :)
nodesocket|2 months ago
vinshoo|2 months ago
- Browse explorer tree with jk
- Next/Prev autocomplete suggestion with ^+j,^+k
- Browse Results with hjkl
Some other suggestions:
- Filter tables (f.e. press / and start typing to filter down tables)
- Ability to edit cell value
Otherwise it feels great, thanks for it :) UI looks much nicer than on lazysql and toggleable sidebar is great.
MaxTeabag|2 months ago
yoavm|2 months ago
kej|2 months ago
tracker1|2 months ago
Maybe I'm just a little jaded at seeing a lot of the same type of thing rehashed multiple times a week lately.
This isn't meant to detract from this author, or any other... You have an itch and scratched it. This is what makes open-source work.
no_news_is|2 months ago
It seems you put some menu items behind what I'll call "[space] mode," where you you have to press the spacebar first to open the command menu, then use the command.
This is not reflected properly in the help text shown when you press ? and that was a source of confusion for me.
Especially since I managed to activate the fullscreen mode for one pane AND turn it off, but then couldn't figure out how I did it; and also, I did not find the space-Q option to Quit at first.)
Edit to add, I prefer installing with pipx.
These commands worked for me, to get Postgresql and MariaDB database plugins:
I didn't try installing system-wide as per the GitHub instructions, I don't know if that would have worked just as well with pipx or not.zahlman|2 months ago
I haven't tried this, but I'm familiar with pipx. It provides a higher-level interface, so something like this should work:
Ref.: https://pipx.pypa.io/stable/#inject-a-package> I don't know if that would have worked just as well with pipx or not.
I don't actually see anything in the GitHub instructions about system-wide installation? But yes, since version 1.5 (https://pipx.pypa.io/stable/changelog/#150-2024-03-29) Pipx can do a `--global` install that by default puts the managed venv in /opt and executable symlink in /usr/local/bin.
MaxTeabag|2 months ago
Also the pipx comment made me decide to put much more thought into how sqlit helps with package installation on runtime, and I'm going to suggest pipx by default and it's also going to give the correct commands for every popular package manager.
Thanks!
oulipo2|2 months ago
uvx --with psycopg2-binary --from sqlit-tui sqlit
lgas|2 months ago
hiichbindermax|2 months ago
debarshri|2 months ago
I'm wondering if thats true.
baq|2 months ago
SSMS is super duper nice if you’re an admin or a power SQL server user/dev. Nothing I’ve seen in Postgres world is comparable.
mrbump|2 months ago
MaxTeabag|2 months ago
slimebot80|2 months ago
MaxTeabag|2 months ago
mxgrn|2 months ago
waterTanuki|2 months ago
First error: "Connection failed, no module named 'psycopg2'"
lgas|2 months ago
ruicraveiro|2 months ago
MaxTeabag|2 months ago
oulipo2|2 months ago
NSPG911|2 months ago
> I wanted to make something that makes intuitive sense to me, and I wanted to make a sql version of what lazygit does, namely you can just jump in and there's no need for external documentation. To navigate the harlequin with keyboard only you have to learn the keybindings. Also I though it was quite hard to connect to databases via the cli and install adapters (again, documentation necessary). I wanted to have a tool that you can just run and its intuitive. There's definitely more features in harlequin and I went with more lightweight, though sqlit has SSH tunnels, which harlequin lacks.
When I linked lazysql[0], he replied with this
> That was my original inspiration. Same problem with harlequin, I didn't feel like it was intutive and to follow the "lazy" mindset of lazydocker and lazygit, it should just be easy and not require looking up keybindings. Lazysql ended up with too many features for my taste to the point it was difficult to use
[0]: https://github.com/jorgerojas26/lazysql
jbstack|2 months ago
It seems like the OP's offering has the same problem, although it does offer more objects than Harlequin. I'll be bookmarking it to see how it develops.
le-mark|2 months ago
ursula_gren|2 months ago
Not sure if this is what is being used here though.
talideon|2 months ago
alsetmusic|2 months ago
onemoresoop|2 months ago
bpiroman|2 months ago
unknown|2 months ago
[deleted]