From 15f906c393db1a0fb6577afc3cf59466531eafef Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 28 Sep 2021 00:45:01 +0200 Subject: [PATCH] closql-get: No longer resolve slots by default Proactively resolving slots is never actually unnecessary but often extremely expensive. --- CHANGELOG | 5 +++++ closql.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 01aa82b..87b824d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,9 @@ # -*- mode: org -*- +* v1.2.0 2021/09/28 + +- By default ~closql-get~ no longer proactively resolves all slots, + which is never actually unnecessary but often extremely expensive. + * v1.1.0 2021/09/27 - Added support for alternative database connectors. diff --git a/closql.el b/closql.el index 6b184ce..f521e7d 100644 --- a/closql.el +++ b/closql.el @@ -350,7 +350,7 @@ (eieio-object-class obj)) (error "Cannot reload object"))) -(cl-defmethod closql-get ((db closql-database) ident &optional class) +(cl-defmethod closql-get ((db closql-database) ident &optional class resolve) (unless class (setq class (oref-default db object-class))) (when-let ((row (car (emacsql db [:select * :from $i1 @@ -358,7 +358,7 @@ (oref-default class closql-table) (oref-default class closql-primary-key) ident)))) - (closql--remake-instance class db row t))) + (closql--remake-instance class db row resolve))) (cl-defmethod closql-query ((db closql-database) &optional select pred class) (if select