Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

feat: support untyped NULL value parameters#1224

Merged
olavloite merged 6 commits intomainfrom
support-untyped-null-value-params
Jun 8, 2023
Merged

feat: support untyped NULL value parameters#1224
olavloite merged 6 commits intomainfrom
support-untyped-null-value-params

Conversation

@olavloite
Copy link
Copy Markdown
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 and harshachinta June 2, 2023 13:23
Comment thread src/main/java/com/google/cloud/spanner/jdbc/AbstractJdbcPreparedStatement.java Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@olavloite olavloite deleted the support-untyped-null-value-params branch June 8, 2023 06:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants