Skip to content
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

feat: support untyped NULL value parameters #1224

Merged
merged 6 commits into from
Jun 8, 2023

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented May 10, 2023

Support untyped null parameter values for PreparedStatement. This will allow users to add null values as a statement parameter value without having to know what type the column that the parameter is bound to uses.

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner-jdbc API. labels May 10, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jun 2, 2023
@olavloite olavloite marked this pull request as ready for review June 2, 2023 13:23
@olavloite olavloite requested review from a team as code owners June 2, 2023 13:23
Copy link
Contributor

@rajatbhatta rajatbhatta left a comment

Choose a reason for hiding this comment

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

JSON and JSONB are nullable. But I see that the setNullValue() method does not cover JSON and JSONB data types (JsonType.VENDOR_TYPE_NUMBER and PgJsonbType.VENDOR_TYPE_NUMBER are missing from switch case). Can we add these too and verify once if all supported data types are included in the switch case so we do not miss out on any case? Let me know if we should do this as a separate exercise.

@olavloite
Copy link
Collaborator Author

JSON and JSONB are nullable. But I see that the setNullValue() method does not cover JSON and JSONB data types (JsonType.VENDOR_TYPE_NUMBER and PgJsonbType.VENDOR_TYPE_NUMBER are missing from switch case). Can we add these too and verify once if all supported data types are included in the switch case so we do not miss out on any case? Let me know if we should do this as a separate exercise.

Good point, I've added those to the switch case as well.

Copy link
Contributor

@rajatbhatta rajatbhatta left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@harshachinta harshachinta left a comment

Choose a reason for hiding this comment

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

LGTM

@olavloite olavloite merged commit 80d2b9d into main Jun 8, 2023
21 checks passed
@olavloite olavloite deleted the support-untyped-null-value-params branch June 8, 2023 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants