all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luca Ferrari <fluca1978@infinito.it>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: help with using sql-connect
Date: Wed, 17 Dec 2014 10:07:20 +0100	[thread overview]
Message-ID: <CAKoxK+5MUW8uWCdBCknR55F5STgR_3n+8q8P+v9+FnknHnTkZA@mail.gmail.com> (raw)

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



             reply	other threads:[~2014-12-17  9:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17  9:07 Luca Ferrari [this message]
2014-12-17 19:49 ` help with using sql-connect 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKoxK+5MUW8uWCdBCknR55F5STgR_3n+8q8P+v9+FnknHnTkZA@mail.gmail.com \
    --to=fluca1978@infinito.it \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.