How does this compare to Harlequin?
Open-Source CLI tool to inspect databases fast
11–17 of 17 posts
Re: Open-Source CLI tool to inspect databases fast
#12Re: Open-Source CLI tool to inspect databases fast
#13This seems really cool! Looking forward to any updates on it.
Re: Open-Source CLI tool to inspect databases fast
#14Instead of a gif, please just paste that output into code fences in the README file.
Re: Open-Source CLI tool to inspect databases fast
#15So, Emacs has a built-in interactive SQL mode (M-x sql-mysql / postgres / sqlite). This mode opens a SQL shell similar to what you would see in a terminal. From there, you can do your selects, inserts, updates, etc.
You can also send strings from a different buffer to your SQL shell buffer.
Now in Emacs you can very easily evaluate Lisp code to define functions, redefine functions, and execute arbitrary expressions. You can also wrap your SQL expressions inside of Lisp code. By doing so, you can take advantage of Emacs's built-in Lisp evaluation tools to interact with your SQL database.
So instead of opening a shell in your terminal, selecting a database, and writing select statements to inspect your DB, you can instead...
In Emacs, create a file called something like "sql-notebook.el". Inside that file you write Lisp expressions to execute SQL queries. To execute those queries, you move the cursor over it and just run the command `eval-last-expr` (I have this bound to Ctrl-c Ctrl-c). The results of the evaluated expressions appear in your interactive SQL buffer.
The obvious advantage of this is that you end up creating a library of often-used queries which are very convenient to execute simply by moving the cursor over the query and hitting Ctrl-c twice.
You also retain a history of these queries by virtue of them existing in a plain file, as opposed to ephemeral shell history.
Re: Open-Source CLI tool to inspect databases fast
#16I've started using Emacs as a database explorer. So, Emacs has a built-in interactive SQL mode (M-x sql-mysql / postgres / sqlite). This mode opens a SQL shell similar to what you would see in a terminal. From there, you can do your selects, inserts, updates, etc. You can also send strings from a different buffer to your SQL shell buffer. Now in Emacs you can very easily evaluate Lisp code to define functions, redefi…
Re: Open-Source CLI tool to inspect databases fast
#17I've started using Emacs as a database explorer. So, Emacs has a built-in interactive SQL mode (M-x sql-mysql / postgres / sqlite). This mode opens a SQL shell similar to what you would see in a terminal. From there, you can do your selects, inserts, updates, etc. You can also send strings from a different buffer to your SQL shell buffer. Now in Emacs you can very easily evaluate Lisp code to define functions, redefi…
hey thats pretty cool, I will try to see how that works, I didn't know it. But it sounds like a lot of work to set it up. I wanted to make something faster