[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help with using sql-connect
From: |
Luca Ferrari |
Subject: |
help with using sql-connect |
Date: |
Wed, 17 Dec 2014 10:07:20 +0100 |
Hi all,
I'm trying to write down a simpler configuration for connecting to a
few database:
(setq sql-connection-alist
'((TEST (sql-product 'postgres)
(sql-port 5432)
(sql-server "localhost")
(sql-user "demo")
(sql-password "demo")
(sql-database "demodb"))
(PROD (sql-product 'postgres)
(setq sql-port 5432)
(sql-user "demo")
(sql-password "demo")
(sql-database "demodb") ) ) )
(defun pg-connect (which)
(interactive "sWhich database?" )
(setq sql-product 'postgres)
(let ()
(message "Connecting to %s" which)
(sql-connect which ) ) )
The problem is that no matter what connection name I pass to
pg-connect, it always answers me that "SQL Connection <TEST> does not
exist".
I suspect the problem is that sql-connect expects a symbol, but even
wrapping "which" with (symbol-name) does not help.
What am I missing?
Thanks,
Luca
- help with using sql-connect,
Luca Ferrari <=