branch: elpa/emacsql
commit 936ac5bc86d3271bb1581e0d68b5edfdd702160f
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    Define emacsql using cl-defgeneric
---
 emacsql.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emacsql.el b/emacsql.el
index e5745f44b3..b26d97b368 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -171,8 +171,10 @@ MESSAGE should not have a newline on the end."
          (emacsql-type-map (or mask emacsql-type-map)))
     (concat (apply #'emacsql-format (emacsql-prepare sql) args) ";")))
 
+(cl-defgeneric emacsql ((connection emacsql-connection) sql &rest args)
+  "Send SQL s-expression to CONNECTION and return the results.")
+
 (cl-defmethod emacsql ((connection emacsql-connection) sql &rest args)
-  "Send SQL s-expression to CONNECTION and return the results."
   (let ((sql-string (apply #'emacsql-compile connection sql args)))
     (emacsql-clear connection)
     (emacsql-send-message connection sql-string)

Reply via email to