[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 5c4aa1030b 415/427: Do not warn about missing pg f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 5c4aa1030b 415/427: Do not warn about missing pg functions |
Date: |
Tue, 13 Dec 2022 03:00:24 -0500 (EST) |
branch: elpa/emacsql
commit 5c4aa1030be157229cdccd6b11cb30ca94cda954
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Do not warn about missing pg functions
Do not annoy users who do not have that installed (i.e., all
or nearly all users).
Cannot use `declare-function' for `pgcon-prosess' because
it doesn't know about functions defined using `cl-defstruct'.
---
emacsql-pg.el | 11 +++++++++--
tests/emacsql-external-tests.el | 2 +-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/emacsql-pg.el b/emacsql-pg.el
index 83ae94201a..afb188d368 100644
--- a/emacsql-pg.el
+++ b/emacsql-pg.el
@@ -19,7 +19,13 @@
;;; Code:
-(require 'pg nil t)
+(unless (require 'pg nil t)
+ (declare-function pg-connect "pg"
+ ( dbname user &optional
+ (password "") (host "localhost") (port 5432) (tls nil)))
+ (declare-function pg-disconnect "pg" (con))
+ (declare-function pg-exec "pg" (connection &rest args))
+ (declare-function pg-result "pg" (result what &rest arg)))
(require 'eieio)
(require 'cl-lib)
(require 'cl-generic)
@@ -43,7 +49,8 @@
(require 'pg)
(let* ((pgcon (pg-connect dbname user password host port))
(connection (make-instance 'emacsql-pg-connection
- :process (pgcon-process pgcon)
+ :process (and (fboundp 'pgcon-process)
+ (pgcon-process pgcon))
:pgcon pgcon
:dbname dbname)))
(when debug (emacsql-enable-debugging connection))
diff --git a/tests/emacsql-external-tests.el b/tests/emacsql-external-tests.el
index 98bf4d7f92..72a04a2254 100644
--- a/tests/emacsql-external-tests.el
+++ b/tests/emacsql-external-tests.el
@@ -25,7 +25,7 @@
(reg "sqlite" #'emacsql-sqlite nil)
(when pgdatabase
(reg "psql" #'emacsql-psql pgdatabase))
- (when (and pgdatabase pguser)
+ (when (and pgdatabase pguser (fboundp 'emacsql-pg))
(reg "pg" #'emacsql-pg pgdatabase pguser))
(when mysql-dbname
(reg "mysql" #'emacsql-mysql mysql-dbname)))
- [nongnu] elpa/emacsql b907279bab 418/427: Fix docstring of emacsql-sqlite-condition-alist, (continued)
- [nongnu] elpa/emacsql b907279bab 418/427: Fix docstring of emacsql-sqlite-condition-alist, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9ee397b2be 413/427: Whitespace cosmetics, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d3d76ea72a 409/427: make: Use essentially same Makefile as for other packages I maintain, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b4d5ef41fe 410/427: make: Don't require pg.el to be available to build and test, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5818000c7d 412/427: make: Update pg repository url, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0da3f06e89 416/427: Fix docstring typo, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 20cdad6fe6 417/427: Include sqlite error code in error data, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1becb00945 419/427: Define a few constants as such, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 40c41d0d97 421/427: Release version 3.1.0, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql bfbd0c3a73 422/427: Resume development, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5c4aa1030b 415/427: Do not warn about missing pg functions,
ELPA Syncer <=
- [nongnu] elpa/emacsql be95788334 214/427: Use global timeout in tests., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 944de63e9d 298/427: Add functions to fix vector indentation., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e061847083 302/427: Improve emacsql-fix-vector-indentation., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3f3c36a403 341/427: Expand identifier vectors when passed as parameters (#7)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1de10e8ad4 357/427: Fix warning in emacsql-sqlite initialize-instance (#38), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 488e7ebbb5 380/427: Change defvar to defconst for emacsql-version (fix #53), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e80281487b 399/427: Bump back-ends' dependency on emacsql, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ec4f3d091b 424/427: Resume development, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c1a44076c0 423/427: Release version 3.1.1, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6b2e65bdf7 427/427: Use new version string format for unreleased revisions, ELPA Syncer, 2022/12/13