joy-framework / joy

A full stack web framework written in janet
https://joy.swlkr.com
MIT License
535 stars 30 forks source link

OR's in db/from #70

Closed AlecTroemel closed 4 years ago

AlecTroemel commented 4 years ago

is it possible to do WHERE ... OR ... queries in db/from? Something like this

(db/from :tablename :where {:a a} :or {:b b})

(the above doesn't work as far as i can tell)

swlkr commented 4 years ago

It's not quite what you were asking but you can do this:

(db/from :table :where ["a = ? or b = ?" a b])
AlecTroemel commented 4 years ago

nice! That does what I need :+1: thanks for the awesome project!