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

Improved type casting in the appender #196

Merged
merged 16 commits into from Apr 5, 2024

Conversation

taniabogatsch
Copy link
Contributor

Depends on #195.

Relevant changes

  • Introduce a recursive tryCast function attempting to cast the driver.Value input of each column into the expected duckdb type.
  • Support unmarshalled struct fields like map[string]any to simplify appending JSON inputs. Respective test: TestAppenderWithJSON.
  • Throw a dedicated error message for mismatching struct fields.
  • Moved nil checks into the respective setter functions.
  • Return dedicated driverErr to indicate a bug in the driver (code should never reach this).

@marcboeker marcboeker merged commit f5dc5c3 into marcboeker:main Apr 5, 2024
4 checks passed
@taniabogatsch taniabogatsch deleted the implicit-types branch May 6, 2024 11:34
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.

None yet

2 participants