emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 f549d4330f3: Remove column quoting from sqlite-mode


From: Eli Zaretskii
Subject: emacs-29 f549d4330f3: Remove column quoting from sqlite-mode
Date: Sun, 17 Sep 2023 06:04:54 -0400 (EDT)

branch: emacs-29
commit f549d4330f34a0fa6867f3d83832476ce5c4873f
Author: Thomas Hilke <t.hilke@rollomatic.ch>
Commit: Eli Zaretskii <eliz@gnu.org>

    Remove column quoting from sqlite-mode
    
    * lisp/sqlite-mode.el (sqlite-mode--column-names): Unquote column
    name.  (Bug#65998)
    
    Copyright-paperwork-exempt: yes
---
 lisp/sqlite-mode.el | 17 +----------------
 1 file changed, 1 insertion(+), 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]