Skip to content

fix: EXPOSED-1021 [PostgreSQL][R2DBC] Inserting null on nullable datetime array column throws - #2920

Open
Chantal Loncle (bog-walk) wants to merge 1 commit into
mainfrom
bog-walk/fix-pg-null-datetime-arrays
Open

fix: EXPOSED-1021 [PostgreSQL][R2DBC] Inserting null on nullable datetime array column throws#2920
Chantal Loncle (bog-walk) wants to merge 1 commit into
mainfrom
bog-walk/fix-pg-null-datetime-arrays

Conversation

@bog-walk

Copy link
Copy Markdown
Member

Description

Summary of the change: Switch exact array types passed to Statement.bindNull() to types supported by r2dbc-postgresql driver.

Detailed description:

  • Why: While insert() with omitted column values works on PostgreSQL for nullable array() datetime columns, attempting to manually insert null on such columns results in unsupported errors like Cannot encode null parameter of type [Ljava.sql.Date;. R2DBC ArrayTypeMapper binds null statement values using either Array<java.sql.Date> or Array<java.sql.Timestamp>, neither of which r2dbc-postgresql has supporting codecs for. The exact supported types should be LocalDate | LocalDatetime | String.

  • What:

    • Pass dialect so a check can be used to ensure the correct Array<> type is passed to bindNull()
    • Update datetime array tests to cover null value inserts

Type of Change

Please mark the relevant options with an "X":

  • Bug fix

Affected databases:

  • Postgres

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)

Related Issues

EXPOSED-1021

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.

2 participants