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

Convert values whose data types do not have explicit support in NodeJS into strings #5130

Merged
merged 1 commit into from
Oct 30, 2022

Conversation

jwills
Copy link
Contributor

@jwills jwills commented Oct 29, 2022

Fixes #5125

I thought it would be worthwhile to follow what the node-postgres project does and convert values for DuckDB data types that do not have corresponding support in Javascript into strings:

https://node-postgres.com/features/types

This PR changes the default behavior for type conversion from throwing an exception (that crashes the interpreter) to one where we return a string using Value.ToString and tests that this fixes the issue with returning TIME types from queries to NodeJS.

@jwills jwills changed the title Convert data types that do not have explicit support to strings in NodeJS Convert values whose data types do not have explicit support in NodeJS into strings Oct 29, 2022
@Mytherin
Copy link
Collaborator

Thanks! LGTM

@Mytherin Mytherin merged commit b4f5e6e into duckdb:master Oct 30, 2022
@jwills jwills deleted the jwills_add_in_time_type_to_nodejs branch October 30, 2022 20:07
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.

Querying a TIME type from NodeJS crashes the Javascript Interpreter
2 participants