Hello,
I'm working on a Postmodern backend for weblocks. To conform to their
Store API I need to implement a count-persistent-objects method. I would like to be able to write something like:
(defmethod count-persistent-objects ((store list) class-name
&key where &allow-other-keys)
(let ((sql-expr `(:select (:count '*) :from ,class-name
,@(when where (list :where where)))))
(with-connection store
(query sql-expr :single))))
However a simple test of this results in a type error:
The value of CL-POSTGRES::QUERY is (:SELECT (:COUNT '*) :FROM QUOTES), which is not of type STRING.
Is there a reason that query doesn't support evaluated lists? If so, how would you recommend this be done?
Regards,
Brit Butler