datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
oly 2021-02-19T12:57:15.047100Z

curious how are people handling optional where clauses ? I am currently passing in search via :in then striping nil from the vector I am building it works. or as another example, if I want to match on product/name how can I match everything if the match is blank ?

:where (remove
            nil?
            ['[?product-entity :product/id ?i]
             '[?product-entity :product/name ?n]
             (when search '[(re-find ?search ?n)])