branch: elpa/emacsql commit b4d5ef41fec34908b3fb435707d3fad534a3cfc3 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
make: Don't require pg.el to be available to build and test If it isn't available, a handful of warnings are shown, but compilation and testing continues, while at runtime failure is now delayed until `emacsql-pg' is used. --- emacsql-pg.el | 3 ++- tests/emacsql-external-tests.el | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/emacsql-pg.el b/emacsql-pg.el index 14abf8c74e..307d9112ce 100644 --- a/emacsql-pg.el +++ b/emacsql-pg.el @@ -19,7 +19,7 @@ ;;; Code: -(require 'pg) +(require 'pg nil t) (require 'eieio) (require 'cl-lib) (require 'cl-generic) @@ -40,6 +40,7 @@ (cl-defun emacsql-pg (dbname user &key (host "localhost") (password "") (port 5432) debug) "Connect to a PostgreSQL server using pg.el." + (require 'pg) (let* ((pgcon (pg:connect dbname user password host port)) (connection (make-instance 'emacsql-pg-connection :process (pgcon-process pgcon) diff --git a/tests/emacsql-external-tests.el b/tests/emacsql-external-tests.el index 781efc29fb..98bf4d7f92 100644 --- a/tests/emacsql-external-tests.el +++ b/tests/emacsql-external-tests.el @@ -10,7 +10,7 @@ (require 'emacsql-sqlite) (require 'emacsql-psql) (require 'emacsql-mysql) -(require 'emacsql-pg) +(when (require 'pg nil t) (require 'emacsql-pg)) (defvar emacsql-tests-timeout 4 "Be aggressive about not waiting on subprocesses in unit tests.")