feat: add back as_query method to AwaitableQuery#2194
Conversation
as_query method to AwaitableQueryas_query method to AwaitableQuery
|
@abondar @waketzheng can you please review this PR? |
|
@seladb Thanks for your work. The general direction makes sense: #2056 describes a legitimate escape-hatch use case where users need to reuse the SQL/PyPika query already built by Tortoise and then compose something that the ORM API does not currently support well. One thing worth considering is whether
A slightly safer approach might be:
Overall this seems like a useful capability to restore, but it may be worth keeping the public API surface narrower than adding it directly to |
Description
Addresses #2056: bring back
AwaitableQuery.as_query().Motivation and Context
As described in #2056 there are cases where users have complex queries and need access to the internal pypika layer. The
as_query()method used to exist but was removed in #1777. I don't see a reason why not to add it back.How Has This Been Tested?
Yes, tests added int this PR.
Checklist: