branch: elpa/emacsql commit ca62adc4b271f6fbdc41d49c5282e7bc80d6d6a5 Author: Christopher Wellons <well...@nullprogram.com> Commit: Christopher Wellons <well...@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"