Function: sqlite-mode-list-columns

sqlite-mode-list-columns is an interactive and byte-compiled function defined in sqlite-mode.el.gz.

Signature

(sqlite-mode-list-columns)

Documentation

List the columns of the table under point.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/sqlite-mode.el.gz
(defun sqlite-mode-list-columns ()
  "List the columns of the table under point."
  (interactive nil sqlite-mode)
  (let ((row (get-text-property (point) 'sqlite--row)))
    (unless row
      (user-error "No table under point"))
    (let ((columns (sqlite-mode--column-names (car row)))
          (inhibit-read-only t))
      (save-excursion
        (forward-line 1)
        (if (looking-at " ")
            ;; Delete the info.
            (delete-region (point) (if (re-search-forward "^[^ \t]" nil t)
                                       (match-beginning 0)
                                     (point-max)))
          ;; Insert the info.
          (dolist (column columns)
            (insert (format "  %s\n" column))))))))