[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql aa9283ca0a 132/427: Allow sub-selects with :from.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql aa9283ca0a 132/427: Allow sub-selects with :from. |
Date: |
Tue, 13 Dec 2022 02:59:35 -0500 (EST) |
branch: elpa/emacsql
commit aa9283ca0a638fa53625743624e8e74b8cf6fbae
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Allow sub-selects with :from.
---
README.md | 2 ++
emacsql.el | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index e3beb5d452..d936c94f92 100644
--- a/README.md
+++ b/README.md
@@ -151,6 +151,8 @@ Provides `FROM`.
```el
[... :from employees]
+[... :from [employees accounts]]
+[... :from (:select ...)]
```
#### :where `<expr>`
diff --git a/emacsql.el b/emacsql.el
index 91808ae202..c38af94b21 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -535,7 +535,10 @@ definitions for return from a `emacsql-defexpander'."
(emacsql-defexpander :from (table)
"Expands to the FROM keyword."
(emacsql-with-vars "FROM "
- (var table :identifier)))
+ (cl-etypecase table
+ (vector (idents table))
+ (symbol (var table :identifier))
+ (list (combine (emacsql-expand table :subsql-p))))))
(emacsql-defexpander :replace ()
(list "REPLACE"))
- [nongnu] elpa/emacsql f9820deed7 056/427: Add unary operators., (continued)
- [nongnu] elpa/emacsql f9820deed7 056/427: Add unary operators., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f9c562b0a4 069/427: Add SQLite link., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 43ecb5a252 071/427: Tweak README names., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 58e31aa3a9 079/427: Add :update and :set expanders., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c9aab20d47 082/427: Add in operator (special case operator)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 25f9817064 094/427: Add work-in-progress note back., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 03295cba37 119/427: Add ORDER BY expanders., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d1c0904564 120/427: Fix missing quotes., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4718ff4e89 122/427: Simplify all the expanders with new local functions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 54247e4b5e 127/427: Add another insertion unit test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql aa9283ca0a 132/427: Allow sub-selects with :from.,
ELPA Syncer <=
- [nongnu] elpa/emacsql c236aa8437 144/427: Remove extra space., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 75ea77c9a0 149/427: Add an "as" operator, greatly simplifying :from., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 213bb71b7a 152/427: Add :having expander., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8123020ca7 153/427: Make and and or operators variadic., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 76bf0c34dc 038/427: Add rudimentary :where expander., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql afe64ca63a 040/427: Fix emacsql-add-expander example., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 72145a1627 045/427: Allow for multi-arity keyword expanders., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f54142f1eb 062/427: Argument list checking in emacsql-format., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 86687b6ba3 067/427: Flesh out more README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a306de980a 070/427: Add :delete keyword., ELPA Syncer, 2022/12/13