Subject: Re: bug#47358: 28.0.50; sql-list-tables: quotes are cumbersome, no need for it; include history

From: Michael Mauger <[email-masked]>
Date: Tue, 05 Jul 2022 01:17:59 +0000

Lars, your analysis was correct--they value is merely inserted into whatever command the dialect uses to display the table structure and relies upon the underlying command interpreter's rules.  I understand the desire to not make typing of the double quotes required even if they are required in the underlying command then being consistent with what the underlying parser requires is not particularly onerous. The handling of the double quotes becomes a challenge when the underlying cli does not accept the same table-name syntax as the "list tables" command requires.

I am playing around with completion (and the insertion of enclosing dquotes when required) in code and in the minibuffer but that'll be a little while before that is ready. I'll take a look at the smaller bugs first and move on to this. I do use sql-mode every day (I was a predominantly Oracle user for many years, but PostgreSQL and a little MS SQL Server and SQLite have become my current emphasis).

--
[email-masked] // FSF and SFConservancy // GNU Emacs sql.el maintainer

------- Original Message -------
On Sunday, June 26th, 2022 at 2:38 PM, Lars Ingebrigtsen <[email-masked]> wrote:

> Stefan Kangas [email-masked] writes:
>
> > Jean Louis [email-masked] writes:
> >
> > > When executing C-c C-l t in sql-interactive-mode then tables are
> > > completed with quotes like "activities" instead of just activities.
> > >
> > > It would be good not to use quotes, it is more usable that
> > > way. Internally the table could require quotes to be called, but for
> > > user to complete a string or name of table should not be necessary.
> > >
> > > Additionally I propose to include history for the function
> > > sql-list-tables as calling tables' definitions may be frequent with some
> > > users, and other mini buffer entries are not relevant to it.
> >
> > I'm copying in the sql.el maintainer here. Michael, could you please take a
> > look at the above feature request?
>
>
> I'm not very familiar with sql.el, but if I read the code correctly,
> `C-c C-l t' just outputs the data the SQL server spits back at us? So
> if you're using PostgreSQL, I guess that means that that's how
> PostgreSQL formats the CREATE TABLE statement.
>
> But I may be mistaken -- perhaps Michael has some comments here.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no