-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parametrize related field queries #1797
Parametrize related field queries #1797
Conversation
Pull Request Test Coverage Report for Build 12142120565Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
hi @henadzit. I have a question. I've noticed that if we call MyModel.filter(id__in=Subquery(OtherModel.filter(field=some_value).values_list("id"))).sql(params_inline=True) then the value of Thank you for your time. |
Great catch! This PR doesn't handle it and not related, please open a separate issue, thanks. |
Description
This is the final (hopefully) parametrization PR. After this is merged, all queries should be parameterized.
get_parameterized_query
instead of doing parameterization itself. It shifts the responsibility of parameterization to pypika. This PR introducesQueryBuilder.get_parameterized_query
.Motivation and Context
Parameterized queries are crucial for preventing SQL injection attacks and but also can improve performance of database operations.
This PR should finally allow us to close #81.
This also checks one of the requirements for v1.0.0, related ticket.
How Has This Been Tested?
Checklist: