[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24646: [PATCH] Complete the name of PostgreSQL databases
From: |
Michael Mauger |
Subject: |
bug#24646: [PATCH] Complete the name of PostgreSQL databases |
Date: |
Mon, 7 Nov 2016 04:03:27 +0000 (UTC) |
On Sunday, November 6, 2016 9:47 AM, Simen Heggestøyl <simenheg@gmail.com>
wrote:
>On Sun, Oct 23, 2016 at 11:50 PM, Michael Mauger <michael@mauger.com>
>wrote:
>> In the meantime, I'll review your patch and test further; I'll get
>> back to you if I have any issues.
>
>Thanks, Michael. Did you get a chance to test it yet? If it saves you
>time, I can install the patch once you're happy with it.
>
>
>-- Simen
Several comments:
* Rather than hard-coding "psql", please use `sql-postgres-program' which can
be customized to locate the psql executable.
* The "psql -l" command should also use the "-X,--no-psqlrc" option to avoid a
configuration file overriding the field separator and changing the output format
* Rather than `(substring row (match-beginning 1) (match-end 1))' use
`(match-string 1 row)'
* Return the nreverse of the result list so that the completion list is in the
same order as psql lists them.
* `dolist' can specify the return value rather than having a separate
expression after the loop. That is, (dolist (row (process-lines ...) (nreverse
res)) ...)) is equivalent to (dolist (row (process-lines ...)) ...) (nreverse
res)
* I'm concerned about the change to the `completing-read' call in
`sql-get-login-ext'. Rather than `nil', I'd suggest `confirm' so that if the
value isn't in the list, it must be confirmed.
* If the REQUIRE-MATCH parameter should really be something other than `t',
then possibbly we should add another keyword :completion-required whose value
would be used in the `completing-read' call (default to `t' to preserve current
functionality).
* Thank you including the test module. I need to expand automated testing
significantly and I appreciate your efforts to kickstart the effort and shame
me to action :).
I greatly appreciate your submission but think we need to tighten up the code a
bit before we commit it to the code base.