Skip to content

Conversation

stepansergeevitch
Copy link
Collaborator

Added support for set statements based on the design doc
https://docs.google.com/document/u/1/d/1tuo_zAbRYUog3OiW8duMYkivsQhi20gutCibxa5o5ic/edit
Added unit and integration tests.
Added deprecation warning for old way to pass set parameters

@stepansergeevitch stepansergeevitch self-assigned this Mar 16, 2022
@stepansergeevitch stepansergeevitch changed the title Fir 11986 full support for set statement feat: Fir 11986 full support for set statement Mar 16, 2022
Copy link
Contributor

@ptiurin ptiurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from those points, logic LGTM.

return formatted_sql


Set = namedtuple("Set", ["name", "value"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to avoid confusion with set in python? Same with typing.Set. Maybe Setting would be better? I'm open to other naming suggestions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of ParameterSet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about SetParameter then? This way it sounds just how we call them outside of code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, fine with me

and cursor._set_parameters["param"] == "1"
)

cursor.flush_parameters()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a test for multiple set paramter queries? Either executed separately or in the same statement. So then in the end _set_parameters contains both a and b.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, makes sense

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

88.6% 88.6% Coverage
0.0% 0.0% Duplication

@stepansergeevitch stepansergeevitch merged commit 2d53aee into main Mar 18, 2022
@stepansergeevitch stepansergeevitch deleted the FIR-11986-full-support-for-set-statement branch March 18, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants