emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql ca62adc4b2 177/427: Add debug argument to emacsql-


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql ca62adc4b2 177/427: Add debug argument to emacsql-psql.
Date: Tue, 13 Dec 2022 02:59:39 -0500 (EST)

branch: elpa/emacsql
commit ca62adc4b271f6fbdc41d49c5282e7bc80d6d6a5
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Add debug argument to emacsql-psql.
---
 TODO.md         | 8 ++++++++
 emacsql-psql.el | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000000..63e1b881f1
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,8 @@
+## Important
+ * ALTER TABLE
+ * indexes
+ * views
+ * schema lookup
+ * distinct (select)
+
+## Bonus
diff --git a/emacsql-psql.el b/emacsql-psql.el
index 47ed1e0eb7..1f23407018 100644
--- a/emacsql-psql.el
+++ b/emacsql-psql.el
@@ -32,7 +32,7 @@
   (:documentation "A connection to a PostgreSQL database."))
 
 ;;;###autoload
-(cl-defun emacsql-psql (dbname &key username hostname port)
+(cl-defun emacsql-psql (dbname &key username hostname port debug)
   "Connect to a PostgreSQL server using the psql command line program."
   (let ((args (list dbname)))
     (when username
@@ -54,6 +54,9 @@
       (prog1 connection
         (setf (process-sentinel process)
               (lambda (_proc _) (kill-buffer buffer)))
+        (when debug
+          (setf (emacsql-log-buffer connection)
+                (generate-new-buffer "*emacsql-log*")))
         (emacsql-register connection)
         (mapc (apply-partially #'emacsql-send-string connection)
               '("\\pset pager off"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]