Skip to content
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

handle ANY type in nested values #132

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

jraymakers
Copy link
Contributor

Fix for second part of #128.

The C API returns nullptr when attempting to create a value of a nested type with a item or entry type of ANY. Note that nullptr is distinct from a duckdb_value representing a SQL NULL value; we don't want duckdb_value to ever be nullptr. So, we need to fail gracefully in this case, by throwing an exception.

In the Node Neo API, when binding values to prepared statements, the user might leave the type unspecified in a way that we can't infer (such as by passing an empty array), or they might explicitly specify the ANY type. In either case, we can end up with an ANY type (failed inference returns ANY). Rather than let the generic low-level exception through, we detect these cases and throw an error with a more specific and hopefully helpful message.

@jraymakers
Copy link
Contributor Author

The Windows bindings tests started to fail nondeterministically for unknown reasons. I've (hopefully temporarily) skipped this run; I plan to troubleshoot later. The API tests still run (and pass).

@jraymakers jraymakers merged commit a44fe9b into main Jan 30, 2025
5 checks passed
@jraymakers jraymakers deleted the jray/handle-any-type-in-nested-values branch January 30, 2025 23:06
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.

1 participant