Created
January 5, 2015 19:27
-
-
Save ieure/ee08ec2e74b0df58cfdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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