emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] ob-sql.el: Add support for SAP HANA


From: Kyle Meyer
Subject: Re: [PATCH] ob-sql.el: Add support for SAP HANA
Date: Tue, 16 Mar 2021 00:43:23 -0400

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 via email to

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