Function: sqlite-mode-delete
sqlite-mode-delete is an interactive and byte-compiled function
defined in sqlite-mode.el.gz.
Signature
(sqlite-mode-delete)
Documentation
Delete the row under point.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/sqlite-mode.el.gz
(defun sqlite-mode-delete ()
"Delete the row under point."
(interactive nil sqlite-mode)
(let ((table (get-text-property (point) 'sqlite--type))
(row (get-text-property (point) 'sqlite--row))
(inhibit-read-only t))
(when (or (not (consp table))
(not (eq (car table) 'row)))
(user-error "No row under point"))
(unless (yes-or-no-p "Really delete the row under point? ")
(user-error "Not deleting"))
(sqlite-execute
sqlite--db
(format "delete from \"%s\" where %s"
(cdr table)
(string-join
(cl-mapcar (lambda (column value)
(format "\"%s\" %s ?"
(car (split-string column " "))
(if value "=" "is")))
(cons "rowid" (sqlite-mode--column-names (cdr table)))
row)
" and "))
row)
(delete-region (line-beginning-position) (progn (forward-line 1) (point)))))