Skip to content

Commit

Permalink
closql-get: No longer resolve slots by default
Browse files Browse the repository at this point in the history
Proactively resolving slots is never actually unnecessary but often
extremely expensive.
  • Loading branch information
tarsius committed Sep 27, 2021
1 parent cd7c239 commit 15f906c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions closql.el
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,15 @@
(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
:where (= $i2 $s3)]
(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
Expand Down

0 comments on commit 15f906c

Please sign in to comment.