Function: sqlite-mode-open-file

sqlite-mode-open-file is an autoloaded, interactive and byte-compiled function defined in sqlite-mode.el.gz.

Signature

(sqlite-mode-open-file FILE)

Documentation

Browse the contents of an sqlite file.

View in manual

Probably introduced at or before Emacs version 29.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/sqlite-mode.el.gz
;;;###autoload
(defun sqlite-mode-open-file (file)
  "Browse the contents of an sqlite file."
  (interactive "fSQLite file name: ")
  (unless (sqlite-available-p)
    (error "This Emacs doesn't have SQLite support, so it can't view SQLite files"))
  (if (file-remote-p file)
      (error "Remote SQLite files are not yet supported"))
  (pop-to-buffer (get-buffer-create
                  (format "*SQLite %s*" (file-name-nondirectory file))))
  (sqlite-mode)
  (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))