reddit / emacs

SQL browser?

GidiomGates · 2022-11-18 19:59
Hi, in some projects it's nice to have some kind of sql browser, but in emacs I couldn't find one and I had to leave emacs for that. So I wrote a little python code in org mode blocks (why not a .py file? just because I like org) to create another .org document with the sql database tables for a quick overview and not having to exit emacs. So now I like to build a function in emacs-lisp to execute the code blocks in the org mode file to automatically generate the tables when you call it, but I'm very new to emacs-lisp and don't know where to start. Any suggestions for that? . Is there a package that does something similar? https://preview.redd.it/26l7blnykr0a1.png?width=1306&format=png&auto=webp&s=2193c8397719cb6d9206dd20d4fc79ebbaad5215
github-alphapapa · 2022-11-18 21:52
You can go to and call Org Babel source blocks by name. You can use the `apropos-function` command to find relevant functions.
DefiantAverage1 · 2022-11-18 22:10
I think https://github.com/kostafey/ejc-sql is pretty good.
uita23 · 2022-11-18 22:35
Way back when I used SLIME, SBCL, and CL-SQL for interactive SQL data exploration. I realize that's not exactly what you're asking for, but I found it to be highly effective. Something with org-babel would probably be a more modern approach, but having the full power of Common Lisp available is really nice.
GidiomGates · 2022-11-18 23:39
thank, I'll try
GidiomGates · 2022-11-18 23:41
Its seem to be an sql interaction framework in emacs, not exactly I want. But I'll try with that, thanks.
GidiomGates · 2022-11-18 23:44
Yes, I really would like to write the code using Lisp, but for now I'm not proficient at it, so for now I'll use org-babel, which seemed like a quick way out of solving the problem without leaving emacs.
uita23 · 2022-11-19 03:38
I totally agree with what you're saying. But I'd like to gently encourage you to, if you happen to have the spare time, play around with the Common Lisp toolset for DBs. Here is the homepage: https://clsql.kpe.io/ It's stable software, so it doesn't get a lot of updates, but there is still activity on the repo as of last month so it's not abandoned.
FreeAd7233 · 2022-11-19 04:51
there are SQL language servers. For example `sqls`. You can use it with Eglot or lspmode
sandbox_actual · 2022-11-19 06:27
[EDBI](https://github.com/kiwanami/emacs-edbi)–also available on [MELPA](https://melpa.org/#/edbi)–is worth taking a look at.