2019-05-23 14:30:09 +00:00
|
|
|
|
|
|
|
;; Copyright 2019 Éibhear Ó hAnluain
|
|
|
|
|
|
|
|
;; This file is part of ENODE.
|
|
|
|
;;
|
|
|
|
;; ENODE is free software: you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; ENODE is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with ENODE. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(defun enode-mysql-start-sql-engine ()
|
2019-05-24 13:53:26 +00:00
|
|
|
"A function to set up the SQL engine for connecting to a mysql
|
|
|
|
or MariaDB database.
|
|
|
|
|
|
|
|
Until further notice, this function does nothing. It just returns
|
|
|
|
T."
|
|
|
|
t
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(defun enode-mysql-connect (conn-user conn-pass conn-database conn-hostname &optional conn-port)
|
|
|
|
"A function to create to a mysql/mariadb database"
|
|
|
|
|
|
|
|
(if sql-buffer
|
|
|
|
(if (not (get-buffer-process sql-buffer))
|
|
|
|
(progn
|
|
|
|
(kill-buffer sql-buffer)
|
|
|
|
(enode-mysql-new-session conn-user conn-pass conn-database conn-hostname conn-port)
|
|
|
|
)
|
|
|
|
(enode-mysql-reconnect conn-user conn-pass conn-database conn-hostname conn-port)
|
|
|
|
)
|
|
|
|
(enode-mysql-new-session conn-user conn-pass conn-database conn-hostname conn-port)
|
|
|
|
)
|
|
|
|
(setq enode-current-connection connection-description)
|
|
|
|
(setq enode-connected t)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defun enode-mysql-new-session (conn-user conn-pass conn-database conn-hostname conn-port)
|
|
|
|
"A function to start a brand-new mysql/mariadb session"
|
|
|
|
(let ((sql-user conn-user)
|
|
|
|
(sql-database conn-database)
|
|
|
|
(sql-server conn-hostname)
|
|
|
|
)
|
|
|
|
(sql-mysql)
|
2019-05-23 14:30:09 +00:00
|
|
|
)
|
|
|
|
)
|