Skip to content

Array elements are always nullable #571

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

Merged
merged 4 commits into from
Aug 13, 2024
Merged

Conversation

plcplc
Copy link
Contributor

@plcplc plcplc commented Aug 13, 2024

What

PR #565 fixed field nullability of composite type fields, but neglected to treat the similar issue that exists for arrays.

In Postgres, any array type (e.g. int4[], text[], etc.) may contain elements which are null. The type system does not support declaring arrays with non-null elements.

This PR fixes that issue.

How

Whenever we have to translate an ndc-postgres array type to an ndc-spec array type in the schema generation we annotate the element type as being nullable.

@plcplc plcplc requested a review from soupi August 13, 2024 09:31
@@ -69,12 +69,11 @@ ROW(
3421 -- NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also replace this?

Suggested change
3421 -- NULL
NULL

Copy link
Contributor

@soupi soupi left a comment

Choose a reason for hiding this comment

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

Cool.

@plcplc plcplc added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit bf4bb44 Aug 13, 2024
29 checks passed
@plcplc plcplc deleted the plc/issues/APIPG-760-take-two branch August 13, 2024 10:03
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