[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 3127283cd1 218/427: Clean up middleware a bit.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 3127283cd1 218/427: Clean up middleware a bit. |
Date: |
Tue, 13 Dec 2022 02:59:45 -0500 (EST) |
branch: elpa/emacsql
commit 3127283cd10c527894a802355ae4b33b10f32e46
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Clean up middleware a bit.
---
sqlite/emacsql.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/sqlite/emacsql.c b/sqlite/emacsql.c
index 28b5bae03f..bb163aa578 100644
--- a/sqlite/emacsql.c
+++ b/sqlite/emacsql.c
@@ -48,12 +48,6 @@ void buffer_free(buffer *buffer) {
free(buffer);
}
-#define CHECK(sqlitecall) \
- if (sqlitecall != SQLITE_OK) { \
- send_error(sqlite3_errcode(db), sqlite3_errmsg(db)); \
- continue; \
- }
-
int main(int argc, char **argv) {
char *file = NULL;
if (argc != 2) {
@@ -100,9 +94,15 @@ int main(int argc, char **argv) {
continue;
}
- /* Run SQL and print rows. */
+ /* Parse SQL statement. */
sqlite3_stmt *stmt = NULL;
- CHECK(sqlite3_prepare_v2(db, input->buffer, length, &stmt, NULL));
+ result = sqlite3_prepare_v2(db, input->buffer, length, &stmt, NULL);
+ if (result != SQLITE_OK) {
+ send_error(sqlite3_errcode(db), sqlite3_errmsg(db));
+ continue;
+ }
+
+ /* Print out rows. */
int ncolumns = sqlite3_column_count(stmt);
printf("%d\n", ncolumns);
while (sqlite3_step(stmt) == SQLITE_ROW) {
@@ -124,7 +124,7 @@ int main(int argc, char **argv) {
sqlite3_column_bytes(stmt, i), stdout);
break;
case SQLITE_BLOB:
- send_error(SQLITE_NOLFS, "blobs not supported by Emacsql");
+ printf(" nil");
break;
}
}
- [nongnu] elpa/emacsql 7341144e49 201/427: Fix ordering bug in emacsql--var-vars., (continued)
- [nongnu] elpa/emacsql 7341144e49 201/427: Fix ordering bug in emacsql--var-vars., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d8d4bf4b98 202/427: Add emacsql-with-transaction macro., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dc178532e5 203/427: Add emacsql-with-bind., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql cc92c154ee 205/427: Disallow nil as an identifier., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 75c0c4aeb7 204/427: Tweak emacsql-with-bind macro., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3f38b357c3 206/427: Detect empty SQL vectors (better error messages)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ad24b1c508 208/427: Add JOIN syntax., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fe2eef212c 210/427: Fix header typo., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 89654ad76b 211/427: Add identifier note., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 543189295d 215/427: Drop the pointless autoloads., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3127283cd1 218/427: Clean up middleware a bit.,
ELPA Syncer <=
- [nongnu] elpa/emacsql cf16cdb2f8 217/427: Add a special characters test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2db4a84598 225/427: Allow os tuples to be specified as an env var., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ba2fac7701 228/427: Update the README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql af2cdddca1 231/427: Squash a bunch of bugs., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d3fa5b908f 234/427: Add funcall operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b29ea275d4 236/427: Tweak limitations notes., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 45ac14390a 239/427: Fix up emacsql.el header to match new syntax., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 7c774ffe12 248/427: Improve MySQL error parsing., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 89e42aed13 253/427: Add docstring to emacsql-mysql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5c423307a8 254/427: Fix README typo., ELPA Syncer, 2022/12/13