3

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-sqlite:

C-x d /user@host:/directory
M-x sql-sqlite /scp:user@host:/directory/test.db

As expected, this opens an *SQL* buffer with an sqlite prompt. Entering any SQL statements or SQLite commands, however, results in this:

Error: unable to open database "/scp:user@host:/directory/test.db": unable to open database file

Process SQL exited abnormally with code 1

I am using Emacs 25.1 with emacs -Q (the other two versions I have access to, 24.3 and 24.5, behave identically).

Thomas
  • 31
  • 1

1 Answers1

5

After some experimentation and a bit of digging around in the source code, I recognized what went wrong. Running M-x sql-sqlite from the remote Dired buffer starts a remote SQLite process and that process needs to be provided with the absolute path to the database file on the remote machine. So instead of this:

C-x d /user@host:/directory
M-x sql-sqlite RET /scp:user@host:/directory/test.db

I need to to this:

C-x d /user@host:/directory
M-x sql-sqlite RET /directory/test.db
Thomas
  • 51
  • 1
  • You seem to have created multiple accounts, see http://emacs.stackexchange.com/help/merging-accounts – npostavs Oct 21 '16 at 04:16