Questions tagged [sql-interactive-mode]
21 questions
10
votes
1 answer
Is there a company backend for completion in sql-interactive-mode?
I'm using sql-interactive-mode, and I'm in need for a Company backends that will complete SQL keywords, and preferably, also column/table names of the used database.
When looking around for any completion, to my surprise, there was no backend for…

ReneFroger
- 3,855
- 22
- 63
7
votes
3 answers
sql-send-paragraph results in mis-aligned headers
Anyone know how to fix this? I'm connecting to Postgres, and when I use a command like sql-send-paragraph to send a SQL query to the interactive *SQL* buffer, the headers are not aligned right. It's really hard to read.
For example a multiline…

Rob N
- 547
- 2
- 12
6
votes
1 answer
Variables in Babel evaluation with SQL blocks
According to the org-mode manual, you can set variables in code blocks
as follows:
#+HEADERS: :var foo="blah"
#+BEGIN_SRC elisp
(message foo)
#+END_SRC
#+RESULTS:
: blah
However, when I try to do this with a babel block with SQL, I have no
good…

Sohail
- 503
- 3
- 10
4
votes
1 answer
Why do sql-mode and sql-interactive-mode not highlight strings the same way?
Here is a screenshot showing the difference between sql-interactive-mode (top) and sql-mode (bottom).
Why does the string not get highlighted properly in sql-interactive-mode? (Note - this also happens with no color theme enabled.

Trevoke
- 2,375
- 21
- 34
4
votes
1 answer
sql-connect with Ivy
I've switched from helm to Ivy and mostly everything works, but today I noticed that connecting to databases with sql-connect doesn't work anymore. I have the following in the variable sql-connection-alist
(setq sql-connection-alist
'(("dev"…

flooose
- 511
- 6
- 14
4
votes
2 answers
How to change the indentation of major mode (SQL-mode)?
Configuration:
Emacs 25.0.50 on Ubuntu 15.04.
How to produce?
Do emacs -Q, then M-x sql-mode.
Paste the following in the buffer:
SELECT SUM(T01.foobar)
FROM db_foo.bar T01
WHERE T01.fooID = 1
AND T01.barID = 2
AND T01.foo IS NOT NULL'
When…

ReneFroger
- 3,855
- 22
- 63
3
votes
0 answers
Send custom commands via psql interface
When interacting with postgresql via Emacs sql-postgres, is it possible to write aliases or functions, to be able to type for example, databases instead of \l, when I want to list all databases?

Nsukami _
- 6,341
- 2
- 22
- 35
3
votes
0 answers
How to abort a command executing in sqli-mode?
Whilst using a sqli buffer I accidentally ran a mahoosive query. What's the easiest way to abort it?
I used sql-postgres to start the process.

cammil
- 509
- 3
- 12
2
votes
1 answer
Storing Database Authentication Details Securely
(Note: I would normally use gpg versions of these files but for debugging I've scrapped gpg until I can get it working without encrypting!)
I'd like to store my username/password credentials securely for use with Emacs for database logins - using…

Phil
- 533
- 4
- 17
2
votes
1 answer
How to send a string to the SQLi (sql-mode/sql-interactive-mode) buffer after processing?
How can I send a selected region in the sql-mode buffer to an external shell command and let the result be displayed in the sql-interactive-mode buffer (REPL)?
For example, normally, if I select a region in the sql-mode buffer (e.g. my_table) and…

tinlyx
- 1,276
- 1
- 12
- 27
2
votes
1 answer
How to use a hyphenated user-name with postgres in sql-interactive-mode?
I have the following configuration in emacs init files to set a variable (user) to the current Unix login user:
(setq sql-postgres-login-params
`((user :default ,user-login-name)
(database :default ,user-login-name)
(server…

tinlyx
- 1,276
- 1
- 12
- 27
2
votes
1 answer
Shortcut to restart sql-postgres process from sql-mode buffer?
Is there a shortcut key or command in Emacs (25.x under Unbuntu 18.04 LTS) to restart the sql-postgres process?
I need to quit and restart sql-postgres very often (for debugging purposes). Currently, my work flow is to
switch to the sql-postgres…

tinlyx
- 1,276
- 1
- 12
- 27
2
votes
1 answer
How do I make multiple buffers use a single sql connection?
I am using sql mode. Is there a way to connect multiple buffers to a single sql connection? When I try to connect an existing buffer to a database, it always creates a new connection instead of reusing the existing one.
Appreciate the help.

mandark
- 159
- 7
1
vote
0 answers
Postgres sql prompt
I have connected to my remote postgres db via: https://stackoverflow.com/a/65310225/5065796
I am able to query and interact just fine. I cannot, however, see the prompt. It's just a blank line. It looks like this:
\c
You are now connected to…

Lorem Ipsum
- 4,327
- 2
- 14
- 35
1
vote
0 answers
sql-connect: (setting-constant nil)
I am using latest Helm from MELPA on Emacs GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-11
When I issue sql-connect I see this:
The only connection I have saved (in custom.el) is the second one, boccaperta. First…

Manuel Uberti
- 3,150
- 18
- 36