all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* help with using sql-connect
@ 2014-12-17  9:07 Luca Ferrari
  2014-12-17 19:49 ` Alex Kost
  0 siblings, 1 reply; 7+ messages in thread
From: Luca Ferrari @ 2014-12-17  9:07 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-18 12:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-17  9:07 help with using sql-connect Luca Ferrari
2014-12-17 19:49 ` Alex Kost
2014-12-18  7:54   ` Luca Ferrari
2014-12-18  9:12     ` Thien-Thi Nguyen
2014-12-18 11:20       ` Luca Ferrari
2014-12-18 12:01         ` Thien-Thi Nguyen
2014-12-18 12:44           ` Luca Ferrari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.