Skip to content

generating query filter dynamically #51

@roti

Description

@roti

Hi,

I'm trying to generate the filter expression dynamically. It does not seem possible with the current implementation of query. Take following function

(defn filterexpand [params]
(map #(list '= (key %) (val %)) params))

Using it like this is not possible:
(defn search-orders [params]
(let [o (ds/query :kind Order (filterexpand params))]
(map-xml-list o)))

I also tried with a macro version of filterexpand:
(defmacro filterexpand [body]
(let [p (eval body)]
(map #(list '= (key %) (val%)) p)))

Can such usage of query be made possible?

Razvan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions