summaryrefslogtreecommitdiff
path: root/lisp/sqlite-mode.el
diff options
context:
space:
mode:
authorThomas Hilke <t.hilke@rollomatic.ch>2023-09-15 10:30:25 +0200
committerEli Zaretskii <eliz@gnu.org>2023-09-17 13:02:50 +0300
commitf549d4330f34a0fa6867f3d83832476ce5c4873f (patch)
treed4093ed52360f508f5a61d84b4ad396df8607780 /lisp/sqlite-mode.el
parentcf7efabe3ff667550fc4f61c4d5b5e9656df9d4c (diff)
Remove column quoting from sqlite-mode
* lisp/sqlite-mode.el (sqlite-mode--column-names): Unquote column name. (Bug#65998) Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/sqlite-mode.el')
-rw-r--r--lisp/sqlite-mode.el17
1 files changed, 1 insertions, 16 deletions
diff --git a/lisp/sqlite-mode.el b/lisp/sqlite-mode.el
index 71c9e57fc12..38e9f84b842 100644
--- a/lisp/sqlite-mode.el
+++ b/lisp/sqlite-mode.el
@@ -136,22 +136,7 @@
(defun sqlite-mode--column-names (table)
"Return a list of the column names for TABLE."
- (let ((sql
- (caar
- (sqlite-select
- sqlite--db
- "select sql from sqlite_master where tbl_name = ? AND type = 'table'"
- (list table)))))
- (with-temp-buffer
- (insert sql)
- (mapcar #'string-trim
- (split-string
- ;; Extract the args to CREATE TABLE. Point is
- ;; currently at its end.
- (buffer-substring
- (1- (point)) ; right before )
- (1+ (progn (backward-sexp) (point)))) ; right after (
- ",")))))
+ (mapcar (lambda (row) (nth 1 row)) (sqlite-select sqlite--db (format "pragma table_info(%s)" table))))
(defun sqlite-mode-list-data ()
"List the data from the table under point."