Fork me on GitHub
#datomic
<
2022-05-20
>
zakkor15:05:31

I'm trying to add a where clause based on some condition (basically, if the min-surface variable is not nil). This doesn't work, but neither does putting the (when) outside of the [] clause. Any tips?

(d/q '[:find (pull ?e [*])
                            :in $ ?min-surface
                            :where
                            [?e :posting/surface ?surface]
                            [(when true (>= ?surface ?min-surface))]]
                          (d/db conn) 30)