[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql 5f4c2ed5a7 166/427: Add emacsql-psql-unavailable-p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql 5f4c2ed5a7 166/427: Add emacsql-psql-unavailable-p. |
Date: |
Tue, 13 Dec 2022 02:59:38 -0500 (EST) |
branch: elpa/emacsql
commit 5f4c2ed5a73fe658999a15b64a5d126f6af1833e
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Add emacsql-psql-unavailable-p.
---
emacsql-psql.el | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/emacsql-psql.el b/emacsql-psql.el
index 9406826b55..2e5cbfa081 100644
--- a/emacsql-psql.el
+++ b/emacsql-psql.el
@@ -9,6 +9,23 @@
(defvar emacsql-psql-executable "psql"
"Path to the psql (PostgreSQL client) executable.")
+(defun emacsql-psql-unavailable-p ()
+ "Return a reason if the psql executable is not available.
+:no-executable -- cannot find the executable
+:cannot-execute -- cannot run the executable
+:old-version -- sqlite3 version is too old"
+ (let ((psql emacsql-psql-executable))
+ (if (null (executable-find psql))
+ :no-executable
+ (condition-case _
+ (with-temp-buffer
+ (call-process psql nil (current-buffer) nil "--version")
+ (let ((version (cl-third (split-string (buffer-string)))))
+ (if (version< version "1.0.0")
+ :old-version
+ nil)))
+ (error :cannot-execute)))))
+
(defclass emacsql-psql-connection (emacsql-connection)
((dbname :reader emacsql-psql-dbname :initarg :dbname))
(:documentation "A connection to a PostgreSQL database."))
- [nongnu] elpa/emacsql a09911a205 125/427: Add LIMIT and OFFSET expanders., (continued)
- [nongnu] elpa/emacsql a09911a205 125/427: Add LIMIT and OFFSET expanders., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 8945af0dd8 129/427: Add :check and allow schemas to have variables., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4206b17f39 134/427: Add support for AS with CREATE TABLE., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6c32f02139 137/427: Add emacsql-thread macro., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 54c180017e 138/427: Add :pragma and note in README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5e2ab842f7 139/427: Add foreign key test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 42c2fd7569 145/427: Tweak limitation wording., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fe0c7004fc 146/427: Add :begin, :commit, and :rollback., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2550196816 162/427: Drop SQLite version requirements., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9a1b4209ba 164/427: Add PostgreSQL front-end., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5f4c2ed5a7 166/427: Add emacsql-psql-unavailable-p.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 1d0ef4011c 167/427: Make emacsql-connection abstract., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 64c3a03d62 169/427: Flesh out some more README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9f6c10eca0 172/427: Move error checking out to helper mix-in., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4f76b94f7c 168/427: Set psql to print nil for NULL., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 7434263d82 174/427: Oops, drop leftover function call., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ca62adc4b2 177/427: Add debug argument to emacsql-psql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql afef528d81 179/427: Fix memoization to include type map., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b2f2dd37cf 178/427: Allow connection to specify their own types., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4aa889882d 182/427: Fix slot allocation on emacsql-connection., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 769abe20fa 183/427: Don't rely on a closure in cleanup hook., ELPA Syncer, 2022/12/13