prom icon indicating copy to clipboard operation
prom copied to clipboard

Add Query.where() that is like .raw() but only for the where portion

Open Jaymon opened this issue 4 years ago • 1 comments

It would be great to have a where portion that can intermix with everything else, so you could do something like:

Orm.query.is_foo_id(10).where("bar_id='<SOME_VALUE>'".format(some_value)).is_che("blah")

would result in a query like:

SELECT * FROM <table_name> WHERE foo_id=? AND bar_id='<SOME_VALUE>' AND che='?'

Bonus if you could also pass in args, so you could do the query like this also:

Orm.query.is_foo_id(10).where("bar_id=?", some_value).is_che("blah")

and you'd get the same result

Jaymon avatar May 11 '20 19:05 Jaymon