Connecting successfully for a new session

This commit is contained in:
Éibhear Ó hAnluain 2019-05-24 17:34:23 +01:00
parent 8b905487c5
commit b4ad99a0d7

View file

@ -26,29 +26,37 @@ T."
) )
(defun enode-mysql-connect (conn-user conn-pass conn-database conn-hostname &optional conn-port) (defun enode-mysql-connect (conn-user conn-pass conn-connection conn-hostname conn-prompt &optional conn-port)
"A function to create to a mysql/mariadb database" "A function to create to a mysql/mariadb database"
(if sql-buffer (if sql-buffer
(if (not (get-buffer-process sql-buffer)) (if (not (get-buffer-process sql-buffer))
(progn (progn
(kill-buffer sql-buffer) (kill-buffer sql-buffer)
(enode-mysql-new-session conn-user conn-pass conn-database conn-hostname conn-port) (enode-mysql-new-session conn-user conn-pass conn-connection conn-hostname conn-prompt conn-port)
) )
(enode-mysql-reconnect conn-user conn-pass conn-database conn-hostname conn-port) (enode-mysql-reconnect conn-user conn-pass conn-connection conn-hostname conn-prompt conn-port)
) )
(enode-mysql-new-session conn-user conn-pass conn-database conn-hostname conn-port) (enode-mysql-new-session conn-user conn-pass conn-connection conn-hostname conn-prompt conn-port)
) )
(setq enode-current-connection connection-description) ;; (setq enode-current-connection connection-description)
(setq enode-connected t) ;; (setq enode-connected t)
) )
(defun enode-mysql-new-session (conn-user conn-pass conn-database conn-hostname conn-port) (defun enode-mysql-new-session (conn-user conn-pass conn-connection conn-hostname conn-prompt conn-port)
"A function to start a brand-new mysql/mariadb session" "A function to start a brand-new mysql/mariadb session"
(let ((sql-user conn-user) (let ((sql-user conn-user)
(sql-database conn-database) (sql-database conn-connection)
(sql-server conn-hostname) (sql-server conn-hostname)
(sql-password conn-pass)
) )
(sql-mysql) (sql-mysql)
) )
) )
(defun enode-mysql-reconnect (conn-user conn-pass conn-connection conn-hostname conn-prompt conn-port)
"Undocumented, and incomplete"
t
)
(provide 'enode-mysql)