Adds support for format operators in SQLQueryParameterization#361
Merged
andrecsilva merged 18 commits intomainfrom Mar 14, 2024
Merged
Adds support for format operators in SQLQueryParameterization#361andrecsilva merged 18 commits intomainfrom
andrecsilva merged 18 commits intomainfrom
Conversation
clavedeluna
requested changes
Mar 12, 2024
ed38ff9 to
32acb6a
Compare
drdavella
approved these changes
Mar 13, 2024
Member
drdavella
left a comment
There was a problem hiding this comment.
This looks great overall. It's a lot of very impressive work, thanks for the effort.
I'm starting to see how some of these pieces could be taken and reused for other kinds of codemods (e.g. xpath injection).
| } | ||
|
|
||
|
|
||
| def parse_formatted_string( |
Member
There was a problem hiding this comment.
This is pretty heroic, nice work. I could have sworn that there was something in the standard library that helped to tokenize format strings but I'm having trouble digging it up right now.
clavedeluna
approved these changes
Mar 13, 2024
Use Assignment Expression (Walrus) In Conditional Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
3081549 to
0639c3e
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Overview
SQLQueryParameterizationwill now parameterize queries built with the format operator%Description
SQLQueryParameterizationwill now correctly parameterize queries built with the format operator%;LinearizeStringExpression. It takes a string expression and finds all the pieces that composes that string. For example:"1" + a + "2"will return a list with the nodes that represents"1",aand"2";RemoveUnusedVariables. It removes local assignments that are not referenced anywhere else;format_string_parsermodule;Tackles #301.