emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Gerler <baron@bundesbrandschatzamt.de>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: ob-sql dbconnection engine
Date: Wed, 8 Feb 2023 16:28:12 +0100	[thread overview]
Message-ID: <7DD4D242-DCA0-4DF9-8EA9-03CE2823ECBD@bundesbrandschatzamt.de> (raw)
In-Reply-To: <87ilgge5xa.fsf@localhost>

Hi Ihor,

I use only MySQL, PostgreSQL and Vertica.
However for me sql-product postgres in my sql-connection-alist works both in ob-sql as well as SQLi.
In the end you are still able to overwrite in your src block parameters via :engine

Andy

> On Feb 5, 2023, at 11:58 AM, Ihor Radchenko <yantar92@posteo.net> wrote:
> 
> 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	other threads:[~2023-02-08 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21 12:20 ob-sql dbconnection engine Andreas Gerler
2023-01-27 13:15 ` Ihor Radchenko
2023-01-28 12:57   ` Andreas Gerler
2023-01-28 14:15     ` Andreas Gerler
2023-02-05 10:57     ` Ihor Radchenko
2023-02-08 15:28       ` Andreas Gerler [this message]
2023-02-09 11:16         ` Ihor Radchenko
2023-10-07 10:51           ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7DD4D242-DCA0-4DF9-8EA9-03CE2823ECBD@bundesbrandschatzamt.de \
    --to=baron@bundesbrandschatzamt.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).