Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Query pass in raw to a field operator #120

Closed Jaymon closed 1 year ago

Jaymon commented 3 years ago

so you could do something like:

q.is_foo('MAX("foo")', raw=True)

and MAX("foo") would be passed directly for the foo field. This is a totally fake example, but it should get the idea across about what I'm thinking

Jaymon commented 2 years ago

I think this might be more likely to work:

q.raw_field('MAX("foo") = %s', value)

and MAX("foo") = %s would just get added to the select query at the appropriate place and value would be added to the query args if it was passed in.