emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] ob-sql: Respect database param when using dbconnection


From: Daniel Kraus
Subject: Re: [PATCH] ob-sql: Respect database param when using dbconnection
Date: Mon, 31 Oct 2022 08:02:42 +0100

Hi,

sorry for replying to a 2 year old thread.
Attached is a new patch with the change from Kyle and
I also added a news entry.
Not sure if the text for the news entry is any good,
or if there should be an example etc.
Feedback welcome.

Otherwise, the patch itself is not much and I use it daily.

Thanks,
  Daniel

Attachment: 0001-ob-sql.el-Respect-all-params-when-using-dbconnection.patch
Description: Text Data

Stefano Rodighiero <stefano.rodighiero@gmail.com> writes:

> On Mon, Jun 1, 2020 at 4:16 AM Kyle Meyer <kyle@kyleam.com> wrote:
>
> Daniel Kraus writes:
>>
>> > I use ob-sql with the :dbconnection param so I don't have my username
>> and password in my org file.
>> > But often I don't want to use the default database from the dbconnection
>> alist but
>> > rather specify it explicitly with :database.
>> > Attached is a patch that fixes this.
>>
>
> Thank you @Daniel
>
>
>> […]
>> From what I can gather from your description, this looks reasonable.
>> I'm not an ob-sql user, so perhaps I missing something, but would it
>> make sense for any connection parameter to take precedence if explicitly
>> given in the source block header (i.e. something like the patch below)?
>> [+cc Stefano, who added the :dbconneciton feature.]
>>
>
> I think it makes sense.
>
> (I personally handle cases like those described by Daniel differently,
> keeping distinct sql-connection-alist entries for each DB
> param combination I might need, but I can imagine why someone
> would want to "override" the database or the host params.
> For port, user and password I have more difficulties imagining a
> case where combinations of those params would need override,
> but I think @Kyle's generic solution is better)
>
> s.

reply via email to

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