emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/emacsql 3f3c36a403 341/427: Expand identifier vectors when


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 3f3c36a403 341/427: Expand identifier vectors when passed as parameters (#7).
Date: Tue, 13 Dec 2022 03:00:00 -0500 (EST)

branch: elpa/emacsql
commit 3f3c36a4031bdf9561fb030450f468439f0f9b46
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Expand identifier vectors when passed as parameters (#7).
---
 emacsql-compiler.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/emacsql-compiler.el b/emacsql-compiler.el
index 2fb55407f3..2f5b596f4e 100644
--- a/emacsql-compiler.el
+++ b/emacsql-compiler.el
@@ -59,19 +59,22 @@
   "Escape an identifier, if needed, for SQL."
   (when (or (null identifier)
             (keywordp identifier)
-            (not (symbolp identifier)))
+            (not (or (symbolp identifier)
+                     (vectorp identifier))))
     (emacsql-error "Invalid identifier: %S" identifier))
-  (let ((name (symbol-name identifier)))
-    (if (string-match-p ":" name)
-        (mapconcat #'emacsql-escape-identifier
-                   (mapcar #'intern (split-string name ":")) ".")
-      (let ((print (replace-regexp-in-string "-" "_" (format "%S" identifier)))
-            (special "[]-\000-\040!\"#%&'()*+,./:;<=>?@[\\^`{|}~\177]"))
-        (if (or (string-match-p special print)
-                (string-match-p "^[0-9$]" print)
-                (emacsql-reserved-p print))
-            (emacsql-quote-identifier print)
-          print)))))
+  (if (vectorp identifier)
+      (mapconcat #'emacsql-escape-identifier identifier ", ")
+    (let ((name (symbol-name identifier)))
+      (if (string-match-p ":" name)
+          (mapconcat #'emacsql-escape-identifier
+                     (mapcar #'intern (split-string name ":")) ".")
+        (let ((print (replace-regexp-in-string "-" "_" (format "%S" 
identifier)))
+              (special "[]-\000-\040!\"#%&'()*+,./:;<=>?@[\\^`{|}~\177]"))
+          (if (or (string-match-p special print)
+                  (string-match-p "^[0-9$]" print)
+                  (emacsql-reserved-p print))
+              (emacsql-quote-identifier print)
+            print))))))
 
 (defun emacsql-escape-scalar (value)
   "Escape VALUE for sending to SQLite."



reply via email to

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