HACKER Q&A
📣 IggleSniggle

SQL tooling: REPL-likes, Intellisense, etc.


I’ve gotten quite spoiled by the nodejs REPL and by TypeScript. I’m in love with the idea of sum-types. Threads over the years on HN about SQL have me constantly telling myself: there must be a better way to “live” SQL so that I feel like I’m having a more proactive dialogue with my db. I feel like I should be able to know, as I’m typing a query, what the semantic possibility space is for eg syntax completion / tablename / return type of object, before I have completed or sent a query.

I mostly use my “host” programming language or pgsql to write queries. Is there better tooling for this for either SQLite or PostgreSQL? I’m interested in moving my personal structured data into this format to make working with SQL feel more natural and interactive to me.

Surely this tooling exists. But surely the tooling is better than what I’m finding in my Google searches. Anybody have a killer setup for something like this?

Online is ok. One-time software purchase is ok. A working tool-chain of multiple tools is ok, as long as it results in a more real-time interaction with the existing real model of the db.

Any recommendations?


  👤 stonecharioteer Accepted Answer ✓
https://www.pgcli.com/ is an amazing tool. Has autocomplete, Vim mode, and warnings for destructive commands. The REPL experience is amazing as well!

Additionally, postgres's psql CLI supports an rc file, one you can use for awesome configs. Put some time into that as well.