1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

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:
Thomas Hilke 2023-09-15 10:30:25 +02:00 committed by Eli Zaretskii
parent cbd8fac283
commit d9a1175a61

View File

@ -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 ()