Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql-mode]

The tag has no usage guidance.

-1
votes
0answers
27 views

Emacs: sending a selected region in my SQL script to a sqli buffer, doesn't flush the query to sqli

My environment: Database: Postgresql 11.1 OS: Ubuntu 16.04 (x86_64) Emacs version: 26.1 I have the following SQL script open in an Emacs buffer: -- ================== select ...
0
votes
1answer
42 views

Emacs: Error message when sending a region to a sql connection buffer: Wrong type argument: processp, nil

Based on the article here: https://emacsredux.com/blog/2013/06/13/using-emacs-as-a-database-client/ I wish to have a .sql buffer to edit my queries and once prepared send it by (C-c C-r) to an already ...
1
vote
1answer
63 views

Is it possible to have shared #+PROPERTY: between multiple org files?

I'm working with org-mode and org-babel to query a PostgreSQL database. It's pretty cool setup and I love it. At the moment, I have multiple org files with the same database property configuration ...
0
votes
0answers
22 views

servicename in sql-oracle (without tnsnames.ora)

I would like to use emacs to connect to Oracle, and run sql code from a buffer as I do using Oracle SQL Developer. I was able to trick sql-mode into connecting me to Oracle by using the minibuffer ...
1
vote
1answer
181 views

How to use mysql client (sql-mysql-program) from a docker container?

I am running MySQL inside a docker container. When I try to connect to it using M-x sql-mysql I see the following error: Unable to locate SQL program ‘mysql’ Yeah, I don't have mysql-client ...
3
votes
0answers
94 views

Eval SQL in Org Babel using sql-connection-alist for credentials

I would like to evaluate SQL source blocks in Org Babel using the connections I have set up in sql-connection-alist from sql-mode. This way I can save database credentials in a private (Elisp) file ...
4
votes
1answer
130 views

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-...
2
votes
0answers
73 views

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.
3
votes
1answer
446 views

Using sql-sqlite via TRAMP

I want to use sql-sqlite on a remote database file via TRAMP. According to this website it should be possible, but I cannot get it to work. I visit the remote directory with Dired and then invoke sql-...
7
votes
1answer
762 views

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 ...
1
vote
1answer
215 views

How do I encourage Emacs to follow the output of the SQL-buffer?

This issue might be related. I have a SQL process viewed in a buffer in a frame. When I send SQL-statements from another window in frame to the SQL-process in the another frame, I have to scroll my ...
2
votes
2answers
987 views

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 = ...
2
votes
1answer
129 views

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 ...
1
vote
1answer
335 views

How to programmatically invoke interactive function? [duplicate]

I have written an interactive function to connect to multiple mysql databases (defun mysql-connect (name) "Connect to a predefined MySQL connection." (interactive (list (completing-read "...
1
vote
0answers
163 views

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 ...
5
votes
2answers
752 views

How to indent SQL code just 4 spaces, without alignment &c?

SQL mode has some cool stuff set up for indenting with aligned keywords and such. Normally, I'd think it was cool. The problem is that at my new job, the people who wrote our mountains of sql did not ...
3
votes
0answers
83 views

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?
4
votes
1answer
652 views

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 ...