[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql dcb9a903c7 284/427: Put emacsql-thread inside a tr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql dcb9a903c7 284/427: Put emacsql-thread inside a transaction. |
Date: |
Tue, 13 Dec 2022 02:59:51 -0500 (EST) |
branch: elpa/emacsql
commit dcb9a903c73e558fb4536fa4fcb42273ed73e6d5
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Put emacsql-thread inside a transaction.
---
emacsql.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/emacsql.el b/emacsql.el
index 7a6857fef0..297cf0bb25 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -240,17 +240,6 @@ CONNECTION-SPEC establishes a single binding.
(progn ,@body)
(emacsql-close ,(car connection-spec)))))
-(defmacro emacsql-thread (connection &rest statements)
- "Thread CONNECTION through STATEMENTS.
-A statement can be a list, containing a statement with its arguments."
- (declare (indent 1))
- `(let ((emacsql--conn ,connection))
- ,@(cl-loop for statement in statements
- when (vectorp statement)
- collect (list 'emacsql 'emacsql--conn statement)
- else
- collect (append (list 'emacsql 'emacsql--conn) statement))))
-
(defvar emacsql--transaction-level 0
"Keeps track of nested transactions in `emacsql-with-transaction'.")
@@ -275,6 +264,18 @@ single transaction at the lowest level."
(not emacsql--completed))
(emacsql emacsql--connection [:rollback])))))
+(defmacro emacsql-thread (connection &rest statements)
+ "Thread CONNECTION through STATEMENTS.
+A statement can be a list, containing a statement with its arguments."
+ (declare (indent 1))
+ `(let ((emacsql--conn ,connection))
+ (emacsql-with-transaction emacsql--conn
+ ,@(cl-loop for statement in statements
+ when (vectorp statement)
+ collect (list 'emacsql 'emacsql--conn statement)
+ else
+ collect (append (list 'emacsql 'emacsql--conn) statement)))))
+
(defmacro emacsql-with-bind (connection sql-and-args &rest body)
"For each result row bind the column names for each returned row.
Returns the result of the last evaluated BODY.
- [nongnu] elpa/emacsql 97ccd7d9e6 398/427: Update library commentaries of package libraries, (continued)
- [nongnu] elpa/emacsql 97ccd7d9e6 398/427: Update library commentaries of package libraries, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6728a8649a 396/427: No longer try to clear a buffer that isn't live anymore, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a118b6c95a 381/427: Don't use -lm flag on Windows (#55), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e7b932a5c9 378/427: Handle read-only emacsql install diretory, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9e48d12e42 402/427: Fix typos in README.md, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6d8cd93662 382/427: README: Remove a duplicate word, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b6a0336d62 405/427: make: Compile SQLite binary before Elisp, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b9d848fa9c 407/427: make: Don't warn about implicit fallthroughs, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dbf0598731 087/427: Add "-interactive" argument (fixes #1)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 79fb8cb223 230/427: Heavy compiler rework., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dcb9a903c7 284/427: Put emacsql-thread inside a transaction.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 4a570e3016 301/427: Predict new location when compiling binary., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 57fa0e1d3e 306/427: Use just BEGIN for transactions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ef10c33355 317/427: Only create the executable when compiling emacsql-sqlite, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a270218fd9 324/427: Ignore generated var/ directory, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f00f724495 325/427: Enforce use of spaces for indentation, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 016f2bf05a 330/427: Give up compiling at compile time., ELPA Syncer, 2022/12/13
- [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