all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Mauger via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: "numbchild@gmail.com" <numbchild@gmail.com>,
	Michael Mauger <michael@mauger.com>,
	"40564@debbugs.gnu.org" <40564@debbugs.gnu.org>
Subject: bug#40564: 28.0.50; sql.el should add support PostgreSQL alias "postgresql" of "postgres"
Date: Sun, 26 Apr 2020 02:15:34 +0000	[thread overview]
Message-ID: <iSz3U6Tb6m5wrZk9jvJKwEEWahkwF4BjwTwNJ9pA4nz3HdvUdk37gSZFUrWJ6HcHIOByaxqKOvLck1APchDVC9QRj45EPwhloPEOcLtHbBc=@protonmail.com> (raw)
In-Reply-To: <CADwFkmnojYhq8Gsra8h-Umf-mdb2SVfQOsdb3beVwA0=TD+T6Q@mail.gmail.com>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, April 25, 2020 10:01 AM, Stefan Kangas <stefan@marxist.se> wrote:

> Hi Michael,
>
> Could you please take a look at the below bug report? Thanks in advance.
>
> stardiviner numbchild@gmail.com writes:
>
> > Emacs built-in sql.el mode "sql-mode" is used by many extra extensions. Like Org
> > Mode's "ob-sql.el" and ejc-sql (https://github.com/kostafey/ejc-sql) etc.
> > Here is a discussion
> > (https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00347.html) of add
> > alias "postgresql" for "postgres" which comes from `sql-product-alist'.
> > And in ejc-sql I got this issue again because `sql-set-product' invoked in ejc-sql
> > but has no match of "postgresql" in`sql-product-alist' caused error.
> > So I hope sql.el can support "postgresql" name alias in `sql-product-alist'.

From private emails concerning this issue last month:

* The user can add a copy of the `posgtgres' sql-mode product settings as `postgresql`
  easily from their own init.el:

    (let ((pg (cdr (assq 'postgres sql-product-alist))))  ; Make a copy of the postgres plist
      (add-to-list 'sql-product-alist                     ; Add as a new entry under postgresql
                   (cons 'postgresql (plist-put pg :name "PostgreSQL"))))

  Basically copy the `postgres' entry in `sql-product-alist' and add it as `postgresql'.

* Based on my understanding of this issue, I believe that this not a feature appropriate
  for sql-mode, but rather it represents a weakness in the EJC->SQL mapping. Sql.el has
  used `postgres' as the identifier of the PostgreSQL since the first commit in '99. It
  was exposed as a user visible variable in `sql-product-alist' in 2003. EJC is using a
  heuristic that may work for other products, but it definitely won't work for all (It is
  broken for EJC's `sqlserver', which is `ms' in sql.el).

123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789

  I have an opinion as to how it should be solved in EJC but I do not have a patch to offer.

  The `ejc-get-product-name` function, in ejc-lib.sql, is specifically for fetching
  the `sql-product' based on the EJC product identification.  I recommend that this function
  first look up a :sql-product attribute for the EJC product and then fall-back on the heuristic
  it now uses. The product attributes are defined in `ejc-connect-interactive' and passed to
  `ejc-create-connection'. I also recommend the definition of product attributes be pulled out
  to a user visible global variable so that users could control settings.

I believe that is is not a failure on sql.el's part and that it is more properly addressed in EJC.
I am also reluctant to add cruft to sql.el to support a package outside of the Emacs/ELPA source
repository because I am unable to build automated tests of the desired feature and be assured
nothing has broken.

--
MICHAEL@MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer





  reply	other threads:[~2020-04-26  2:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12  1:11 bug#40564: 28.0.50; sql.el should add support PostgreSQL alias "postgresql" of "postgres" stardiviner
2020-04-25 14:01 ` Stefan Kangas
2020-04-26  2:15   ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-04-26  2:36     ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-26 13:04     ` Stefan Kangas
2020-04-26 20:55       ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-27  6:11         ` Stefan Kangas
2020-04-27  5:08       ` stardiviner

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

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

  git send-email \
    --in-reply-to='iSz3U6Tb6m5wrZk9jvJKwEEWahkwF4BjwTwNJ9pA4nz3HdvUdk37gSZFUrWJ6HcHIOByaxqKOvLck1APchDVC9QRj45EPwhloPEOcLtHbBc=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=40564@debbugs.gnu.org \
    --cc=michael@mauger.com \
    --cc=mmauger@protonmail.com \
    --cc=numbchild@gmail.com \
    --cc=stefan@marxist.se \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.