Skip to content

Improve nullability evaluation - #2858

Closed
lorenz wants to merge 1 commit into
sqlc-dev:mainfrom
lorenz:fix2
Closed

lorenz wants to merge 1 commit into
sqlc-dev:mainfrom
lorenz:fix2

Conversation

@lorenz

@lorenz lorenz commented Oct 15, 2023

Copy link
Copy Markdown

This now supports evaluating nullability if subqueries, function-defined tables or sqlc.embed macros are involved.
If nullable embeds are generated, this now errors out instead of emitting code which breaks at runtime.

Generating correct type definitions for that case would be easy, but scanning data into embed pointers is hard as it would require "peeking" at row nullability to decide if the type should be allocated and scanned into. Otherwise the null columns need to be directed into some kind of sink. Because this is nontrivial to do this is not part of this PR.

This now supports evaluating nullability if subqueries, function-defined
tables or sqlc.embed macros are involved.
If nullable embeds are generated, this now errors out instead of
emitting code which breaks at runtime.

Generating correct type definitions for that case would be easy, but
scanning data into embed pointers is hard as it would require "peeking"
at row nullability to decide if the type should be allocated and scanned
into. Otherwise the null columns need to be directed into some kind
of sink. Because this is nontrivial to do this is not part of this PR.
@jaredweinfurtner

Copy link
Copy Markdown

@lorenz FYI you still have conflicts if you wanted to follow up on it.

Copy link
Copy Markdown
Collaborator

🤖 Automated message

This PR has been closed because it has merge conflicts with main. To reopen it, rebase onto the latest main to resolve the conflicts, then reopen the PR.


Generated by Claude Code

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.

3 participants