diff --git a/Makefile b/Makefile index e60c5fe..5c7c6c4 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ TEST_ELS += tests/emacsql-tests.el TEST_ELCS = $(TEST_ELS:.el=.elc) DEPS = pg +DEPS += peg DEPS += sqlite3 EMACS ?= emacs diff --git a/emacsql-pg.el b/emacsql-pg.el index fa2e79d..475ca37 100644 --- a/emacsql-pg.el +++ b/emacsql-pg.el @@ -7,13 +7,14 @@ ;; Homepage: https://github.com/magit/emacsql ;; Package-Version: 3.1.1.50-git -;; Package-Requires: ((emacs "25.1") (emacsql "20230220") (pg "0.16")) +;; Package-Requires: ((emacs "28.1") (emacsql "20240623") (pg "0.37")) ;; SPDX-License-Identifier: Unlicense ;;; Commentary: ;; This library provides an EmacSQL back-end for PostgreSQL, which -;; uses the `pg' package to directly speak to the database. +;; uses the `pg' package to directly speak to the database. This +;; library requires at least Emacs 28.1. ;; (For an alternative back-end for PostgreSQL, see `emacsql-psql'.) @@ -21,7 +22,9 @@ (require 'emacsql) -(require 'pg nil t) +(if (>= emacs-major-version 28) + (require 'pg nil t) + (message "emacsql-pg.el requires Emacs 28.1 or later")) (declare-function pg-connect "pg" ( dbname user &optional (password "") (host "localhost") (port 5432) (tls nil))) diff --git a/tests/emacsql-external-tests.el b/tests/emacsql-external-tests.el index e7b52ca..777d00e 100644 --- a/tests/emacsql-external-tests.el +++ b/tests/emacsql-external-tests.el @@ -20,10 +20,14 @@ (require 'emacsql-mysql) (require 'emacsql-psql) ;; FIXME(CI) Broken and thus disabled in test.yml. -(if (require 'pg nil t) - (require 'emacsql-pg) - (message "WARNING: Forgo testing `%s' because `%s' is unavailable" - 'emacsql-pg 'pg)) +(cond + ((< emacs-major-version 28) + (message "WARNING: Forgo testing `%s' because it is unsupported on Emacs %s" + 'emacsql-pg emacs-version)) + ((require 'pg nil t) + (require 'emacsql-pg)) + ((message "WARNING: Forgo testing `%s' because `%s' is unavailable" + 'emacsql-pg 'pg))) (defvar emacsql-tests-timeout 4 "Be aggressive about not waiting on subprocesses in unit tests.")