Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testapp.core=> (select testt (where (and {:acronym [like "%on%"]} {:name [like "%an%"]})))
- ({:id 11, :app_id 5122, :name "Sem Vitae Aliquam Company", :acronym "Henderson"} {:id 76, :app_id 1090, :name "Erat Company", :acronym "Fontenoille"})
- testapp.core=> mysearch
- {:acronym "%on%", :name "%an%"}
- testapp.core=> (select testt (where (and (map (fn [[key val]] ({key [like val]}))) mysearch)))
- ()
- testapp.core=> (sql-only(select testt (where (and (map (fn [[key val]] ({key [like val]}))) mysearch))))
- "SELECT `test`.* FROM `test` WHERE (? AND (`test`.`acronym` = ? AND `test`.`name` = ?))"
- testapp.core=> (dry-run(select testt (where (and (map (fn [[key val]] ({key [like val]}))) mysearch))))
- dry run :: SELECT `test`.* FROM `test` WHERE (? AND (`test`.`acronym` = ? AND `test`.`name` = ?)) :: [#object[clojure.core$map$fn__4549 0x720696f clojure.core$map$fn__4549@720696f] %on% %an%]
- [{:id 1}]
Advertisement
Add Comment
Please, Sign In to add comment