[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] SQL enhancements
From: |
Michael Mauger |
Subject: |
Re: [patch] SQL enhancements |
Date: |
Fri, 16 Apr 2010 16:06:32 -0700 (PDT) |
> > Since my employer has decided that they no longer need my services,
> > I've got time to dedicate to Emacs!
>
> I haven't looked at your patch yet, but could you answer
> if you fixed annoyances that I noticed in the current SQL mode:
>
> 1. `sql-product' is not marked as a safe local variable.
I have added
(put 'sql-product 'safe-local-variable 'symbolp)
in this patch (sql-user, sql-database, and sql-server have been marked safe as
well)
> 2. I see no way to start SQL interactive mode without entering
> its login parameters (user, password, database, server) in the
> minibuffer.
>
> I'd like to create a command that let-binds parameters:
>
> (let ((sql-database "database.sqlite"))
> (sql-sqlite))
>
> but it still asks for the database name (with the correct default value).
> I mean it's right to ask this by default, but there should be a way
> to skip confirmation of already defined parameters.
With this patch you can do the following:
(let ((sql-database "database.sqlite")
(sql-sqlite-login-params nil))
(sql-sqlite))
to set the parameters and avoid the prompting. You can set
`sql-sqlite-login-params' to
a list of the parameters you want to be prompted for; the default for sqlite
is '(user password server database).
or
(sql-set-product-feature 'sqlite :sqli-login nil) ; Permanently disable
prompting
(let ((sql-database "database.sqlite"))
(sql-sqlite))
[There's actually a bug in my patch in this second case that I have since
corrected.]
> 3. And this is not directly related to SQL mode but important:
> A colleague of mine has switched from Emacs to other editors
> because in SQL mode Emacs doesn't have horizontal scroll bars!
>
> Unlike other modes, SQL mode produces the wide output where
> it's necessary to easily scroll tabular data horizontally.
I've encountered the same issue but found that C-x > (scroll-right) and C-x <
(scroll-left)
provide a useful way to pan left and right without having to reach for the
mouse.
But, point taken.