[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql c8de0ff1fd 293/427: Adjust the EmacSQL protocol.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql c8de0ff1fd 293/427: Adjust the EmacSQL protocol. |
Date: |
Tue, 13 Dec 2022 02:59:52 -0500 (EST) |
branch: elpa/emacsql
commit c8de0ff1fda3358e696eb588f83d24ae6f26384a
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Adjust the EmacSQL protocol.
---
emacsql.el | 4 +++-
sqlite/emacsql.c | 9 ++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/emacsql.el b/emacsql.el
index 38964c8d07..82d3b7eabe 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -213,7 +213,9 @@ specific error conditions."
(value (read)))
(if (eql value 'error)
(emacsql-handle connection (read) (read))
- value))))
+ (prog1 value
+ (unless (eq 'success (read))
+ (emacsql-handle connection (read) (read))))))))
(provide 'emacsql) ; end of generic function declarations
diff --git a/sqlite/emacsql.c b/sqlite/emacsql.c
index 34b3481c10..884c4d2fe6 100644
--- a/sqlite/emacsql.c
+++ b/sqlite/emacsql.c
@@ -165,9 +165,12 @@ int main(int argc, char **argv) {
}
printf(")\n");
if (sqlite3_finalize(stmt) != SQLITE_OK) {
- fprintf(stderr, "error %d: %s\n",
- sqlite3_errcode(db), sqlite3_errmsg(db));
- exit(EXIT_FAILURE);
+ /* Despite any error code, the statement is still freed.
+ * http://stackoverflow.com/a/8391872
+ */
+ send_error(sqlite3_errcode(db), sqlite3_errmsg(db));
+ } else {
+ printf("success\n");
}
}
buffer_free(input);
- [nongnu] elpa/emacsql 9dcfebfba7 030/427: Factor out schema->string code., (continued)
- [nongnu] elpa/emacsql 9dcfebfba7 030/427: Factor out schema->string code., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1f6c06bda9 050/427: Use expr expansion in :where expander., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 39aa16906a 034/427: Remove redundant wait., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql cda366379a 085/427: Add Windows note., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql db0159f138 032/427: Update README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 801bc6239f 222/427: Swap the tuple order., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9e6ea00f01 243/427: Add note about PostgreSQL., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ad6c09681e 261/427: Oops, print the tuple., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ff59ca9336 265/427: Clear out binaries in distclean, too., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 00bb81ff2b 266/427: Fix Makefile typo., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c8de0ff1fd 293/427: Adjust the EmacSQL protocol.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 51224aab7a 288/427: Add unit test for last change., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c5845884f4 021/427: Rename type to column., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 7caa63c11e 023/427: Allow any sequence for table spec., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 963f221b82 049/427: Add expr expansion function., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 109664b88b 060/427: Memoize emacsql-expand., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1fb97f7d4a 092/427: Drop unusable macro emacsql-with-connection., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql add06c47b9 117/427: Bring back :into for :replace (oops!)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d7a05db54e 080/427: Add :replace expander., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0f0840ffbf 128/427: Add :default column constraint., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql bbe3031a50 130/427: Add table constraints., ELPA Syncer, 2022/12/13