[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 1ad58cd68d 108/427: Allow substatement in IN opera
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 1ad58cd68d 108/427: Allow substatement in IN operator. |
Date: |
Tue, 13 Dec 2022 02:59:33 -0500 (EST) |
branch: elpa/emacsql
commit 1ad58cd68dc47f7deb118b57aa78a1b75ace60c5
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Allow substatement in IN operator.
---
emacsql.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/emacsql.el b/emacsql.el
index 401dc74506..e946a29422 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -466,9 +466,14 @@ definitions for return from a `emacsql-defexpander'."
(2 (format "%s - %s" (recur 0) (recur 1)))))
;; IN special case
((in)
- (if (= 2 (length args))
- (format "%s IN %s" (recur 0)
- (var (nth 1 args) :vector))))))))))
+ (cl-case (length args)
+ (1 (error "Wrong number of operands for %s" op))
+ (2 (format "%s IN %s" (recur 0) (var (nth 1 args) :vector)))
+ (otherwise
+ (let ((subsql (cl-coerce (cdr args) 'vector)))
+ (format "%s IN %s"
+ (recur 0)
+ (combine (emacsql-expand subsql :sub)))))))))))))
;; SQL Expansion Functions:
- [nongnu] elpa/emacsql 59147c4cdf 373/427: Update README paragraph about automatic downloads (#46), (continued)
- [nongnu] elpa/emacsql 59147c4cdf 373/427: Update README paragraph about automatic downloads (#46), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 936ac5bc86 386/427: Define emacsql using cl-defgeneric, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e597696682 358/427: Fix some indentation (whitespace cleanup), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 76489e0a10 362/427: Tweak Makefile documentation, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8c5f095458 368/427: Bump to version 3.0.0 (#20), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 49348329df 376/427: Document op. precedence handling, clean up format string expansion, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 50ae54d159 053/427: Use expressions in select columns., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a13eba5f05 059/427: Use the timeout argument in emacsql-wait., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d440b44778 076/427: Add escape vector test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1db49d7f4c 090/427: Add Windows notice again., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1ad58cd68d 108/427: Allow substatement in IN operator.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 8fa7c00978 170/427: Add sentinel cleanup to psql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6d17256e1b 171/427: Add a mix-in class to reduce code duplication., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 749becb017 181/427: Disable notices and warnings in psql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e42d939235 187/427: In SQLite, block for up to 30 seconds on db lock., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3ba9109d45 198/427: Start using real version numbers., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql de0bde9a02 207/427: Use Cask package-file directive instead., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql bb3dbfc891 213/427: Set a global query timeout., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 394bb062aa 219/427: Add a small library for determining binary to use., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f030b9952d 224/427: Fix up psql-connection., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dc2afbbc1f 221/427: Adjust the Emacsql wire protocol., ELPA Syncer, 2022/12/13