I'm working with org-mode
and org-babel
to query a PostgreSQL database. It's pretty cool setup and I love it.
At the moment, I have multiple org files with the same database property configuration like the following.
#+PROPERTY: header-args:sql :dbhost myhost
#+PROPERTY: header-args:sql+ :dbuser username :database secretdb :engine postgresql :exports result
This is duplicated in each org file now. I'm wondering if there's a way to configure this in one place and org-babel
pick it up from.
I also have database configuration for multiple environments. So configuration for each database is also duplicated in the respective org files. It was fine in the beginning, now I have too many files with same +#PROPERTY:
value in them, and it kind of getting confusing and tedious.
I'm looking for a way to have the configuration in one place and org-babel
have them pickup.
Here's is what I tried so far.
#+INCLUDE: "./connection-properties.org"
You get the idea. This includes the org file, and also says Local setup has been refreshed
when I do Ctrl-C-Ctrl-C
. But when I execute the sql block, it fails with org-babel-execute:sql: Wrong type argument: stringp, nil
Looking for clues! Thanks!