p3orm has full support for executing PyPika queries. PyPika queries are constructed by building blocks that are analogous to the underlying SQL, the learning curve is minimal if you already know SQL.
Available PyPika shortcuts
select- Equivalent to PyPika's
QueryBuilder().from_(tablename).select(field). This defaults to return everything (
*) but you can pass in a specific model field for executing subqueries.
update- Equivalent to PyPika's
QueryBuilder().update(tablename). You can then chain this with your own
delete- Equivalent to PyPika's
QueryBuilder().delete().from(tablename). You can then chain this with your own
from_-> Calls underlying
QueryBuilder().from_(tablename), useful if you need to execute broader queries.
These shortcuts only build queries. To run the query against a database you must use your driver's
Selecting with PyPika queries
Updating with PyPika queries
p3orm provides the
with_returning function to wrap PyPika insert/udpate/delete queries so that they return results.