[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 6c32f02139 137/427: Add emacsql-thread macro.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 6c32f02139 137/427: Add emacsql-thread macro. |
Date: |
Tue, 13 Dec 2022 02:59:36 -0500 (EST) |
branch: elpa/emacsql
commit 6c32f02139d54b989be62fb530ff2e73899ceb74
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Add emacsql-thread macro.
---
emacsql.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/emacsql.el b/emacsql.el
index a1986e2e19..6e44c2a2bd 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -161,6 +161,17 @@ CONN-SPEC is a connection specification like the call to
(progn ,@body)
(emacsql-close ,(car conn-spec)))))
+(defmacro emacsql-thread (conn &rest statements)
+ "Thread CONN through STATEMENTS.
+A statement can be a list, containing a statement with its arguments."
+ (declare (indent 1))
+ `(let ((emacsql--conn ,conn))
+ ,@(cl-loop for statement in statements
+ when (vectorp statement)
+ collect (list 'emacsql 'emacsql--conn statement)
+ else
+ collect (append (list 'emacsql 'emacsql--conn) statement))))
+
(defun emacsql-buffer (conn)
"Get proccess buffer for CONN."
(process-buffer (emacsql-process conn)))
- [nongnu] elpa/emacsql dd3f153406 089/427: Drop old with-errors macro., (continued)
- [nongnu] elpa/emacsql dd3f153406 089/427: Drop old with-errors macro., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 72c1954517 096/427: Block on connection until the output has flushed., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1e9857ccc4 103/427: Allow variables inside vectors., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8a66563af6 105/427: Combine :insert and :into., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d04ef64ce0 109/427: Add IF NOT EXISTS and TEMPORARY to CREATE TABLE., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 58641b9827 115/427: Fill out keywords in README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fc941d7c75 118/427: Capture a common identifier vector pattern., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a09911a205 125/427: Add LIMIT and OFFSET expanders., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8945af0dd8 129/427: Add :check and allow schemas to have variables., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4206b17f39 134/427: Add support for AS with CREATE TABLE., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6c32f02139 137/427: Add emacsql-thread macro.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 54c180017e 138/427: Add :pragma and note in README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5e2ab842f7 139/427: Add foreign key test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 42c2fd7569 145/427: Tweak limitation wording., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fe0c7004fc 146/427: Add :begin, :commit, and :rollback., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2550196816 162/427: Drop SQLite version requirements., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9a1b4209ba 164/427: Add PostgreSQL front-end., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5f4c2ed5a7 166/427: Add emacsql-psql-unavailable-p., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1d0ef4011c 167/427: Make emacsql-connection abstract., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 64c3a03d62 169/427: Flesh out some more README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9f6c10eca0 172/427: Move error checking out to helper mix-in., ELPA Syncer, 2022/12/13