Expose pypika query building
See original GitHub issueIs your feature request related to a problem? Please describe. Tortoise is great, but it lacks some features like jsonb filtering.
Describe the solution you’d like
Expose internal make_query
, so one can create queryset
using existing Tortoise API and update it with more complex logic using query builder. For example
qs = Model.filter(...).limit(100)
raw_query = qs.query # in current implementation qs.query is empty
raw_query.select().where()
For now one should use
qs = Model.filter(...).limit(100)
qs._make_query() # make query using pypika as query builder
raw_query = qs.query
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:9 (9 by maintainers)
Top Results From Across the Web
kayak/pypika - Python Query Builder
PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting...
Read more >PyPika - Python Query Builder — PyPika 0.35.16 documentation
PyPika is a Python API for building SQL queries. ... Designed with data analysis in mind, PyPika leverages the builder design pattern to...
Read more >Advanced Query Features — PyPika 0.35.16 documentation
The package pypika.analytic contains analytic function wrappers. These can be used in SELECT clauses when building queries for databases that support them.
Read more >pypika Documentation
PyPika is a Python API for building SQL queries. ... Functions which use window aggregation expose the functions rows() and range() with ...
Read more >Tutorial — PyPika 0.35.16 documentation - Read the Docs
In simple queries like the above example, columns in the “from” table can be referenced by passing string names into the select query...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now you can use
queryset.as_query()
For now, I have to use this snippet