[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql f794d4d38f 116/427: Allow for selected columns in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql f794d4d38f 116/427: Allow for selected columns in :insert-into. |
Date: |
Tue, 13 Dec 2022 02:59:33 -0500 (EST) |
branch: elpa/emacsql
commit f794d4d38fb1dece67b13ccb4465085e6100da97
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Allow for selected columns in :insert-into.
---
README.md | 1 +
emacsql.el | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 46b2465ecb..318906e58a 100644
--- a/README.md
+++ b/README.md
@@ -166,6 +166,7 @@ Provides `INSERT INTO`.
```el
[:insert-into employees ...]
+[:insert-into (employees [id name]) ...]
```
#### :delete
diff --git a/emacsql.el b/emacsql.el
index 91be4b9b3a..548606715f 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -502,7 +502,12 @@ definitions for return from a `emacsql-defexpander'."
(emacsql-defexpander :insert-into (table)
"Expands to the INSERT INTO keywords."
(emacsql-with-vars "INSERT INTO "
- (var table :identifier)))
+ (cl-typecase table
+ (symbol (var table :identifier))
+ (list (cl-destructuring-bind (name columns) table
+ (format "%s (%s)" (var name :identifier)
+ (mapconcat (lambda (c) (var c :identifier))
+ columns ", ")))))))
(emacsql-defexpander :where (expr)
(emacsql-with-vars "WHERE "
- [nongnu] elpa/emacsql 8f59fe6e80 073/427: Add a vector escape., (continued)
- [nongnu] elpa/emacsql 8f59fe6e80 073/427: Add a vector escape., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql eb3283990e 077/427: Drop emacsql-create., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 66df2afbf1 091/427: Simplify start-process call., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e956d91f99 095/427: Add -identifier to emacsql-escape., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8aade12994 101/427: Add a unit test for vector update., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql beb0e00b9e 100/427: Rename emacsql--vars-collect., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ee2877dab0 106/427: Clearer error message from escape identifier., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e9b77b4774 112/427: Add a test for CREATE TABLE., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 652847dbf5 110/427: Allow memoization cache to be nil (for development)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ff4c59a2a7 113/427: Fix cl-lib mistake., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f794d4d38f 116/427: Allow for selected columns in :insert-into.,
ELPA Syncer <=
- [nongnu] elpa/emacsql cefe1ec014 121/427: Add emacsql-sqlite3-unavailable-p., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b2d83c6477 123/427: Fix up ORDER BY, drop :ascending-by., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f52af86b05 124/427: Break apart and organize compilation tests., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0bff8ccc34 126/427: Fix up README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a362a97c98 136/427: Add README section on foreign keys., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 223db2d397 141/427: Add quote operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8951084b40 143/427: Add variable escaping., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 19a65f390e 147/427: Add ignored features section to README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 530b0ad98c 151/427: Allow arbitrary sub-statements., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3012f5b725 154/427: Fix typo., ELPA Syncer, 2022/12/13