orgtbl-mode

139 views
Skip to first unread message

Martin Blais

unread,
Nov 6, 2025, 10:24:55 PMNov 6
to Beancount
I'm wondering if anyone ever got this working with beanquery: 

Daniele Nicolodi

unread,
Nov 16, 2025, 5:06:25 PMNov 16
to bean...@googlegroups.com
On 07/11/25 04:24, Martin Blais wrote:
> I'm wondering if anyone ever got this working with beanquery:
> https://www.youtube.com/watch?v=g43XNwKY1YA <https://www.youtube.com/
> watch?v=g43XNwKY1YA>

I assume that with "this" you mean Org Babel and not orgtbl-mode.

The former is the org-mode facility for evaluating source code written
as source code blocks in an org-mode document. The latter is a major
mode to use org-mode table editing facilities to edit tables written in
other markup languages.

In this case, I just published ob-beanquery

https://github.com/dnicolodi/ob-beanquery

To use it, just drop something like

(use-package ob-beanquery
:load-path (lambda () (expand-file-name "~/src/ob-beanquery/")))

in your .emacs. Then you can evaluate code blocks like these:

#+begin_src beanquery :db test.beans :numberify yes
SELECT *
#+end_src

#+RESULTS:...

#+begin_src beanquery :db /dev/null :colnames no
SELECT 1+1 FROM #
#+end_src

#+RESULTS:
: 2

It works for me when I need it but it hasn't seen much more testing than
that and Babel has many options and capabilities that I do not use.
Submit issues if it breaks and I'll try to fix it.

Cheers,
Dan

Stefano Merlo

unread,
Dec 1, 2025, 8:41:59 AMDec 1
to Beancount
Hi Dan,
    thanks for ob-beanquery. I'd like to work on supporting `org-edit-src-code': have you worked, or plan to do, on a `beanquery-mode'? If not, I'll do, integrate in ob-beanquery, add support for `org-edit-src-code' (C-c ') and do a pull request.
Any suggestion is welcome.
Best,

Stefano

Daniele Nicolodi

unread,
Dec 6, 2025, 6:26:06 AMDec 6
to bean...@googlegroups.com
On 01/12/25 14:41, Stefano Merlo wrote:
> Hi Dan,
>     thanks for ob-beanquery. I'd like to work on supporting `org-edit-
> src-code': have you worked, or plan to do, on a `beanquery-mode'? If
> not, I'll do, integrate in ob-beanquery, add support for `org-edit-src-
> code' (C-c ') and do a pull request.
> Any suggestion is welcome.

I didn't use the remote editing feature on beanquery code blocks so far.
However, I think using sql-mode for editing beanquery code should work
well enough:

(use-package ob-beanquery
:load-path (lambda () (expand-file-name "~/src/ob-beanquery/"))
:config (add-to-list 'org-src-lang-modes '("beanquery" . sql)))

I'll add this to the ob-beanquery README.

It could be worth adding a beanquery dialect to sql-mode, but I am not
familiar with the capabilities of sql-mode, thus I don't know which
aspects would benefit from specialization for beanquery.

Cheers,
Dan

Stefano Merlo

unread,
Dec 6, 2025, 3:19:49 PMDec 6
to Beancount
Thanks Dan,
  using sql-mode works very well and allows syntax highlighting and `org-edit-src-code'.
I'll keep like this for the time being.
Best,
--Stefano
Reply all
Reply to author
Forward
0 new messages