emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ob-sql dbconnection engine


From: Ihor Radchenko
Subject: Re: ob-sql dbconnection engine
Date: Sun, 05 Feb 2023 10:57:05 +0000

Andreas Gerler <baron@bundesbrandschatzamt.de> writes:

> without the patch your org source block has to look like:
>
> #+begin_src sql :engine mysql :dbconnection mysqldb1
>   SELECT * FROM nodes;
> #+end_src
>
> with that patch you can just type
>
> #+begin_src sql :dbconnection mysqldb1
>   SELECT * FROM nodes;
> #+end_src
>
> because your engine is mapped to sql-product in your sql-connection-alist:
>
> (setq sql-connection-alist
>       '((mysqldb1 (sql-product 'mysql)
>                 (sql-server "10.10.42.1")
>                 (sql-user "dbadmin")
>                 (sql-password "foo")
>                 (sql-database "testdb"))))

Thanks for the explanation!
This logic assumes that engine names in ob-sql are the same with
products in `sql-product-alist'. Which is not true. For example, ob-sql
has postgresql while `sql-product-alist' has postgres.

Further, some engines are in ob-sql but not in sql.el and vice versa.

In order to provide auto-detection of sql engine we should first
synchronize the engine names.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]