[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 60d92d3051 159/427: Change the output mode to list
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 60d92d3051 159/427: Change the output mode to list. |
Date: |
Tue, 13 Dec 2022 02:59:38 -0500 (EST) |
branch: elpa/emacsql
commit 60d92d30513822b1895bae4ee2bafcf94158d96f
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Change the output mode to list.
This should be faster and cleaner.
---
emacsql.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/emacsql.el b/emacsql.el
index 1e286709f5..e22e9f6c6c 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -184,7 +184,7 @@ This collection exists for cleanup purposes.")
"Flush (and toss) any waiting output from CONN."
(emacsql--send conn ";\n.print EMACSQL")
(with-current-buffer (emacsql-buffer conn)
- (cl-loop until (string-match-p "EMACSQL\n#" (buffer-string))
+ (cl-loop until (string-match-p "EMACSQL\n]" (buffer-string))
do (accept-process-output)))
(emacsql--clear conn))
@@ -200,8 +200,9 @@ buffer. This is for debugging purposes."
(process (start-process "emacsql" buffer emacsql-sqlite3-executable
"-interactive" fullfile)))
(setf (process-sentinel process) (lambda (_proc _) (kill-buffer buffer)))
- (process-send-string process ".prompt #\n")
- (process-send-string process ".mode line\n")
+ (process-send-string process ".prompt ]\n")
+ (process-send-string process ".mode list\n")
+ (process-send-string process ".separator ' '\n")
(process-send-string process ".nullvalue nil\n")
(let ((conn (emacsql--create :process process :file (when file fullfile))))
(when log
@@ -290,8 +291,8 @@ A statement can be a list, containing a statement with its
arguments."
(defun emacsql--complete-p (conn)
"Return non-nil if receive buffer has finished filling."
(with-current-buffer (emacsql-buffer conn)
- (cond ((= (buffer-size) 1) (string= "#" (buffer-string)))
- ((> (buffer-size) 1) (string= "\n#"
+ (cond ((= (buffer-size) 1) (string= "]" (buffer-string)))
+ ((> (buffer-size) 1) (string= "\n]"
(buffer-substring
(- (point-max) 2) (point-max)))))))
@@ -300,13 +301,11 @@ A statement can be a list, containing a statement with
its arguments."
(with-current-buffer (emacsql-buffer conn)
(let ((standard-input (current-buffer)))
(setf (point) (point-min))
- (cl-loop until (looking-at "#")
- do (search-forward " = ")
- for value = (read)
- collect value into row
- do (forward-char)
- when (or (looking-at "\n") (looking-at "#"))
- collect row into rows and do (setf row ())
+ (cl-loop until (looking-at "]")
+ collect (read) into row
+ when (looking-at "\n")
+ collect row into rows
+ and do (progn (forward-char 1) (setf row ()))
finally (cl-return rows)))))
(defun emacsql--check-error (conn)
- [nongnu] elpa/emacsql 231ec586ca 088/427: Drop forced process coding system., (continued)
- [nongnu] elpa/emacsql 231ec586ca 088/427: Drop forced process coding system., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql eba26bead6 102/427: Add emacsql-compile function for debugging., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d5cfaee783 158/427: Be more precise about error messages., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f512300aba 054/427: Fix a few things in emacsql-expr., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e900f99091 075/427: Update examples., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1116a0873e 163/427: Turn everything into generic functions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 47d9476a02 142/427: Add tests for quote operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql cd5e856ea6 150/427: Add :autoincrement., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f31120edb6 155/427: Fix up documentation headers., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql adfbc7ed83 156/427: Add emacsql-show-last-sql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 60d92d3051 159/427: Change the output mode to list.,
ELPA Syncer <=
- [nongnu] elpa/emacsql d2f1bcef5d 165/427: Rename add-connection to register., ELPA Syncer, 2022/12/13
- [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