Skip to content

fix: let sqlc output nullable array#4112

Open
babariviere wants to merge 1 commit into
sqlc-dev:mainfrom
babariviere:fix/unnest-array
Open

fix: let sqlc output nullable array#4112
babariviere wants to merge 1 commit into
sqlc-dev:mainfrom
babariviere:fix/unnest-array

Conversation

@babariviere
Copy link
Copy Markdown

@babariviere babariviere commented Sep 23, 2025

Close #1851

This allow postgres to output nullable array.

Adds a new config flag to avoid breaking changes called emit_nullable_for_null_arrays.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 23, 2025
@dosubot dosubot Bot added the 🔧 golang label Sep 23, 2025
@babariviere babariviere marked this pull request as draft September 23, 2025 16:25
@babariviere babariviere force-pushed the fix/unnest-array branch 9 times, most recently from d69f8cf to 76233d4 Compare September 24, 2025 08:05
@babariviere babariviere marked this pull request as ready for review September 24, 2025 08:05
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Sep 24, 2025
This allow postgres to output nullable array.
@andreyxaxa
Copy link
Copy Markdown

@kyleconroy
hello! check this please.
I compiled this branch locally and tested it on my project. It works correctly with sql_package: pgx/v5 and emit_nullable_for_null_arrays: true:

unnest(sqlc.narg(sender_timestamps)::BIGINT[]) -> SenderTimestamps []pgtype.Int8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files. 🔧 golang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlc.narg ignored with array cast

2 participants