refactor: use analyze to get statement params - #478
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## postgresql-dialect #478 +/- ##
========================================================
+ Coverage 87.65% 87.77% +0.11%
+ Complexity 2048 2033 -15
========================================================
Files 123 121 -2
Lines 6799 6732 -67
Branches 972 946 -26
========================================================
- Hits 5960 5909 -51
+ Misses 589 585 -4
+ Partials 250 238 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Disabling clirr as it only adds noise, and somehow refuses to pick up the latest ignore.
olavloite
marked this pull request as ready for review
November 18, 2022 17:30
pratickchokhani
approved these changes
Nov 25, 2022
| int max = 0; | ||
| for (int i = 0; i < parameters.getFieldsCount(); i++) { | ||
| try { | ||
| int paramIndex = Integer.parseInt(parameters.getFields(i).getName().substring(1)); |
Collaborator
There was a problem hiding this comment.
Why is this required? What are the extra fields that are coming?
Collaborator
Author
There was a problem hiding this comment.
The parameters are all named p1, p2, ... p10, ...
So we need to parse the parameter index from the name by skipping the p, and we cannot use the position in the list as the index, as the order is textual, meaning that they are actually returned as (p1, p10, p2, ...)
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.
Execute statements in
PLANmode to get parameter metadata instead of re-writing the SQL statements to aSELECT.Fixes #460