-
Notifications
You must be signed in to change notification settings - Fork 26
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
refactor: use analyze to get statement params #478
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.
int max = 0; | ||
for (int i = 0; i < parameters.getFieldsCount(); i++) { | ||
try { | ||
int paramIndex = Integer.parseInt(parameters.getFields(i).getName().substring(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required? What are the extra fields that are coming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
, ...)
Execute statements in
PLAN
mode to get parameter metadata instead of re-writing the SQL statements to aSELECT
.Fixes #460