update packages
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
;; Maintainer: Jonas Bernoulli <emacs.emacsql@jonas.bernoulli.dev>
|
||||
;; Homepage: https://github.com/magit/emacsql
|
||||
|
||||
;; Package-Version: 4.2.0
|
||||
;; Package-Version: 20250601.1009
|
||||
;; Package-Revision: ced062890061
|
||||
;; Package-Requires: ((emacs "26.1"))
|
||||
|
||||
;; SPDX-License-Identifier: Unlicense
|
||||
@@ -32,17 +33,13 @@
|
||||
"The EmacSQL SQL database front-end."
|
||||
:group 'comm)
|
||||
|
||||
(defconst emacsql-version "4.2.0")
|
||||
(defconst emacsql-version "4.3.1")
|
||||
|
||||
(defvar emacsql-global-timeout 30
|
||||
"Maximum number of seconds to wait before bailing out on a SQL command.
|
||||
If nil, wait forever. This is used by the `mysql', `pg', `psql' and
|
||||
`sqlite' back-ends. It is not being used by the `sqlite-builtin' and
|
||||
`sqlite-module' back-ends, which only use `emacsql-sqlite-busy-timeout'.")
|
||||
|
||||
(defvar emacsql-data-root
|
||||
(file-name-directory (or load-file-name buffer-file-name))
|
||||
"Directory where EmacSQL is installed.")
|
||||
If nil, wait forever. This is used by the `mysql', `pg' and `psql'. It
|
||||
is not being used by the `sqlite-builtin' and `sqlite-module' back-ends,
|
||||
which respect `emacsql-sqlite-busy-timeout' instead.")
|
||||
|
||||
;;; Database connection
|
||||
|
||||
@@ -101,29 +98,6 @@ MESSAGE should not have a newline on the end."
|
||||
(goto-char (point-max))
|
||||
(princ (concat message "\n") buffer)))))
|
||||
|
||||
(cl-defgeneric emacsql-process (this)
|
||||
"Access internal `handle' slot directly, which you shouldn't do.
|
||||
Using this function to do it anyway, means additionally using a
|
||||
misnamed and obsolete accessor function."
|
||||
(and (slot-boundp this 'handle)
|
||||
(oref this handle)))
|
||||
(cl-defmethod (setf emacsql-process) (value (this emacsql-connection))
|
||||
(oset this handle value))
|
||||
(make-obsolete 'emacsql-process "underlying slot is for internal use only."
|
||||
"EmacSQL 4.0.0")
|
||||
|
||||
(cl-defmethod slot-missing ((connection emacsql-connection)
|
||||
slot-name operation &optional new-value)
|
||||
"Treat removed `process' slot-name as an alias for internal `handle' slot."
|
||||
(pcase (list operation slot-name)
|
||||
('(oref process)
|
||||
(message "EmacSQL: Slot `process' is obsolete")
|
||||
(oref connection handle))
|
||||
('(oset process)
|
||||
(message "EmacSQL: Slot `process' is obsolete")
|
||||
(oset connection handle new-value))
|
||||
(_ (cl-call-next-method))))
|
||||
|
||||
;;; Sending and receiving
|
||||
|
||||
(cl-defgeneric emacsql-send-message (connection message)
|
||||
@@ -159,8 +133,8 @@ misnamed and obsolete accessor function."
|
||||
|
||||
(defun emacsql-compile (connection sql &rest args)
|
||||
"Compile s-expression SQL for CONNECTION into a string."
|
||||
(let* ((mask (and connection (emacsql-types connection)))
|
||||
(emacsql-type-map (or mask emacsql-type-map)))
|
||||
(let ((emacsql-type-map (or (and connection (emacsql-types connection))
|
||||
emacsql-type-map)))
|
||||
(concat (apply #'emacsql-format (emacsql-prepare sql) args) ";")))
|
||||
|
||||
(cl-defgeneric emacsql (connection sql &rest args)
|
||||
@@ -205,14 +179,12 @@ specific error conditions."
|
||||
(goto-char (point-min))
|
||||
(let* ((standard-input (current-buffer))
|
||||
(value (read)))
|
||||
(if (eql value 'error)
|
||||
(if (eq value 'error)
|
||||
(emacsql-handle connection (read) (read))
|
||||
(prog1 value
|
||||
(unless (eq 'success (read))
|
||||
(unless (eq (read) 'success)
|
||||
(emacsql-handle connection (read) (read))))))))
|
||||
|
||||
(provide 'emacsql) ; end of generic function declarations
|
||||
|
||||
;;; Automatic connection cleanup
|
||||
|
||||
(defun emacsql-register (connection)
|
||||
@@ -306,7 +278,7 @@ Each column must be a plain symbol, no expressions allowed here."
|
||||
(args (and (not (vectorp sql-and-args)) (cdr sql-and-args))))
|
||||
(cl-assert (eq :select (elt sql 0)))
|
||||
(let ((vars (elt sql 1)))
|
||||
(when (eq '* vars)
|
||||
(when (eq vars '*)
|
||||
(error "Must explicitly list columns in `emacsql-with-bind'"))
|
||||
(cl-assert (cl-every #'symbolp vars))
|
||||
`(let ((emacsql--results (emacsql ,connection ,sql ,@args))
|
||||
@@ -402,4 +374,6 @@ Once activated, vector contents no longer indent like lists."
|
||||
(advice-add 'calculate-lisp-indent :around
|
||||
#'emacsql--calculate-vector-indent))
|
||||
|
||||
(provide 'emacsql)
|
||||
|
||||
;;; emacsql.el ends here
|
||||
|
||||
Reference in New Issue
Block a user