Skip to content

Instantly share code, notes, and snippets.

@ieure
Created January 5, 2015 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ieure/ee08ec2e74b0df58cfdb to your computer and use it in GitHub Desktop.
Save ieure/ee08ec2e74b0df58cfdb to your computer and use it in GitHub Desktop.
(defun sql-connect* (connection &optional new-name)
(interactive
(list (sql-read-connection "Connection: " nil '(nil))
current-prefix-arg)
nil)
(require 'tramp)
(let ((dir (cadr (assoc 'default-directory
(cdr (assoc connection sql-connection-alist))))))
(if dir
(let ((default-directory dir))
(sql-connect connection new-name))
(sql-connect connection new-name))))
(setq sql-preset-alist
'((whatever
(default-directory "~/")
(sql-product 'postgres)
(sql-user "user")
(sql-database "db")
(sql-server "host"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment