[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql c89ccf82df 241/427: Make a reconnect generic metho
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql c89ccf82df 241/427: Make a reconnect generic method. |
Date: |
Tue, 13 Dec 2022 02:59:48 -0500 (EST) |
branch: elpa/emacsql
commit c89ccf82dfba245085d28903fa6fa0059915695d
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Make a reconnect generic method.
---
README.md | 1 +
emacsql.el | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0a7998fe57..2e5b59096b 100644
--- a/README.md
+++ b/README.md
@@ -321,6 +321,7 @@ inherits from `emacsql-connection`.
* Provide `emacsql-types` if needed (hint: use a class-allocated slot).
* Ensure that you properly read NULL as nil (hint: ask your back-end
to print it that way).
+ * Preferably provide `emacsql-reconnect` if possible.
The provided implementations should serve as useful examples. If your
back-end outputs data in a clean, standard way you may be able to use
diff --git a/emacsql.el b/emacsql.el
index fc0d415836..315414e159 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -70,7 +70,7 @@ If nil, wait forever.")
(defclass emacsql-connection ()
((process :type process
:initarg :process
- :reader emacsql-process)
+ :accessor emacsql-process)
(log-buffer :type (or null buffer)
:initarg :log-buffer
:accessor emacsql-log-buffer
@@ -85,6 +85,13 @@ If nil, wait forever.")
(defgeneric emacsql-close (connection)
"Close CONNECTION and free all resources.")
+(defgeneric emacsql-reconnect (connection)
+ "Re-establish CONNECTION with the same parameters.")
+
+(defmethod emacsql-live-p ((connection emacsql-connection))
+ "Return non-nil if CONNECTION is still alive and ready."
+ (not (null (process-live-p (emacsql-process connection)))))
+
(defgeneric emacsql-types (connection)
"Return an alist mapping Emacsql types to database types.
This will mask `emacsql-type-map' during expression compilation.
- [nongnu] elpa/emacsql 72b34f6522 173/427: Add some more autoloading., (continued)
- [nongnu] elpa/emacsql 72b34f6522 173/427: Add some more autoloading., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3229cd41af 180/427: Change the requirements for front-end implementations., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 431a3b325f 200/427: Toss "reap" and switch to new finalize with Cask., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ed86b098ce 197/427: Add prefix arg to emacsql-show-last-sql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 027c5df94e 209/427: Organize all the keywords in the README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1ebbc22411 212/427: Disable undo in process buffers., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5bef799b6b 220/427: Make some tweaks to accommodate Windows., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0cb9e47d24 227/427: Test all available backends., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 730e4d882a 235/427: Fix up the README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4b45472ffa 240/427: Don't copy the binary every time., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c89ccf82df 241/427: Make a reconnect generic method.,
ELPA Syncer <=
- [nongnu] elpa/emacsql 159195690d 245/427: Include bin/ in the package., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql f98ee5e7cd 246/427: Use no-undo buffers., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4b58a6717e 250/427: Don't use temporary tables in foreign key test., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 462d1f1b31 252/427: Fix stupid backslash escape mode in MySQL., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b0f0d3085d 258/427: Get OS tuple from Emacs., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1b5891298a 255/427: Officially add MySQL to unit testing., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 127bb98df2 264/427: Set coding system to utf-8-auto for sqlite., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 933e6f109a 263/427: Clean up for easier cross-compilation., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 810243e823 290/427: Remember SQLite fetch preference in customization., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql fb2270509f 279/427: Adjust make clean., ELPA Syncer, 2022/12/13