-
Notifications
You must be signed in to change notification settings - Fork 460
Closed
Labels
Next ReleaseIssues tagged for next Major release targetIssues tagged for next Major release targetUrgentenhancementNew feature or requestNew feature or requestsecurity
Description
Is your feature request related to a problem? Please describe.
Two actually:
- Security as in SQL excaping issues. Until we are 100% parametrised, we have limited defence against SQL injection attacks.
- We can't handle non-text representative fields for updates or filtering until we change over to parametrised, as those fields don't parse well as text.
Describe the solution you'd like
Update PyPika to allow parametrised queries.
Describe alternatives you've considered
There isn't really. Build our own is too much work for negative gain.
Additional context
We can't guarantee that parameters will be presented in the SQL query in the order we specify, so I feel the simplest solution might be to send the parameters as per usual, but then have a to_parametrised_query() method that returns (str, query parameter objects) so we can use parametrised queries, and PyPika is then in charge of managing order.
Then we need to update our code to use the parameters.
Done:
- Add parameter support to PyPika
- Use parameters for Inserts
- Use parameters for Deletes
- Use parameters for Updates
- Add
BinaryField - Have an escaping strategy for filters using
LIKE - Use parameters for Queryset Updates
- Use parameters for Queryset Filters
- Use parameters for Related matching
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Next ReleaseIssues tagged for next Major release targetIssues tagged for next Major release targetUrgentenhancementNew feature or requestNew feature or requestsecurity