emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Robin Campbell Joy <rcj@robinjoy.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ob-sql.el: Add support for SAP HANA
Date: Tue, 16 Mar 2021 00:43:23 -0400	[thread overview]
Message-ID: <87lfaniu8k.fsf@kyleam.com> (raw)
In-Reply-To: <CADzxVkGUJEDuL08GODL383yvwGnZb-17mM1_bpDN1PO+yyH82g@mail.gmail.com>

Robin Campbell Joy writes:

> Hi,
>
> could someone please let me know if something is missing/incorrect?

Thanks for the patch, and sorry for the delay.

> On Thu, 4 Feb 2021 at 08:55, Robin Campbell Joy <rcj@robinjoy.net> wrote:
>
>> * lisp/ob-sql.el (org-babel-execute:sql, org-babel-sql-dbstring-saphana):
>> Add basic support for SAP HANA to SQL blocks
>> * testing/lisp/test-ob-sql.el: Basic tests for generated db connection
>> string

Style nit: missing periods at the end of the changelog entries.

  https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Style-of-Change-Logs

>> This change adds basic support for SAP HANA to SQL blocks by
>> specifying saphana as :engine.
>>
>> It also adds a new header arg `dbinstance' in order to specify the SAP
>> HANA instance to connect to.
>>
>> Signed-off-by: Robin Campbell Joy <rcj@robinjoy.net>

This trailer is fine but doesn't have any meaning in this project.

This patch is large enough that copyright should be assigned to the FSF.
Assuming you haven't already, are you willing to complete the copyright
paperwork?

  https://orgmode.org/worg/org-contribute.html#copyright-issues

>> ---
>>  lisp/ob-sql.el              |  25 ++-
>>  testing/lisp/test-ob-sql.el | 382 ++++++++++++++++++++++++++++++++++++

Great, thanks for adding tests.

>>  2 files changed, 406 insertions(+), 1 deletion(-)
>>  create mode 100644 testing/lisp/test-ob-sql.el
>>
>> diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el

The patch doesn't apply.

  $ curl -fSs \
    https://orgmode.org/list/CADzxVkEO=X6r_YAi3qjKOoJiPVPHxpcFRc2jAW7fpUFs92w3Kg@mail.gmail.com/raw | \
    git am
  Applying: ob-sql.el: Add support for SAP HANA
  error: corrupt patch at line 40
  Patch failed at 0001 ob-sql.el: Add support for SAP HANA
  [...]

It looks like many of the lines are corrupted by additional line breaks,
so it'd take a lot of manual editing to resolve the issues on my end.

From scanning through it, the patch looks well done.  Here are a few
quick comments.

>> index 902194ae8..5398c85aa 100644
>> --- a/lisp/ob-sql.el
>> +++ b/lisp/ob-sql.el
>> @@ -40,6 +40,7 @@
>>  ;; - dbuser
>>  ;; - dbpassword
>>  ;; - dbconnection (to reference connections in sql-connection-alist)
>> +;; - dbinstance

Hmm, so if we can't shoehorn this into an existing parameter, I guess
this should mention that dbinstance is relevant only for saphana?

>>  ;; - database
>>  ;; - colnames (default, nil, means "yes")
>>  ;; - result-params
>> @@ -58,6 +59,7 @@
>>  ;; - postgresql (postgres)
>>  ;; - oracle
>>  ;; - vertica
>> +;; - saphana
>>  ;;
>>  ;; TODO:
>>  ;;
>> @@ -85,6 +87,7 @@
>>      (dbport       . :any)
>>      (dbuser       . :any)
>>      (dbpassword       . :any)
>> +    (dbinstance       . :any)
>>      (database       . :any))
>>    "SQL-specific header arguments.")
>>
>> @@ -174,6 +177,18 @@ SQL Server on Windows and Linux platform."
>>    (when database (format "-d %s" database))))
>>        " "))
>>
>> +(defun org-babel-sql-dbstring-saphana (host port instance user password
>> database)
>> +  "Make SAP HANA command line args for database connection. Pass nil to
>> omit that arg."

To follow the Emacs docstring convention, "Pass" should be moved to the
second line.

>> +  (mapconcat #'identity
>> +             (delq nil
>> +                   (list (when (and host port) (format "-n %s:%s" host
>> port))

Please prefer `and' here and in other spots where the return value is of
interest.

  (and host port (format ...))

(Possibly breaking it up across lines if you're getting over ~80 chars.)


  reply	other threads:[~2021-03-16  4:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  7:55 [PATCH] ob-sql.el: Add support for SAP HANA Robin Campbell Joy
2021-03-10  7:50 ` Robin Campbell Joy
2021-03-16  4:43   ` Kyle Meyer [this message]
2021-03-16 15:34     ` Robin Campbell Joy
2021-03-17  4:07       ` Kyle Meyer
2021-03-16 19:27 ` Daniele Nicolodi
  -- strict thread matches above, loose matches on Subject: below --
2021-02-04  7:15 Robin Campbell Joy
2021-02-03 20:56 Robin Campbell Joy

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=87lfaniu8k.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rcj@robinjoy.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).