Close SQL database when corresponding 'sqlite-mode' buffer is killed
* lisp/sqlite-mode.el (sqlite-mode-open-file): Close DB when the buffer is killed. (Bug#65998) Copyright-paperwork-exempt: yes
This commit is contained in:
parent
cbd8fac283
commit
d9a1175a61
1 changed files with 1 additions and 0 deletions
|
@ -63,6 +63,7 @@
|
|||
(setq-local sqlite--db (sqlite-open file))
|
||||
(unless (sqlitep sqlite--db)
|
||||
(error "`sqlite-open' failed to open SQLite file"))
|
||||
(add-hook 'kill-buffer-hook (lambda () (sqlite-close sqlite--db)) nil t)
|
||||
(sqlite-mode-list-tables))
|
||||
|
||||
(defun sqlite-mode-list-tables ()
|
||||
|
|
Loading…
Add table
Reference in a new issue