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

[Appender] Cast float64 to numeric destination type #198

Merged
merged 18 commits into from Apr 5, 2024

Conversation

taniabogatsch
Copy link
Contributor

Depends on #196.

Adds an implicit cast from the source type float64 to any expected numeric destination (column) type. These changes, and the previous work in #196, enable the appender to append generic interface inputs, also those retrieved from json.Unmarshal.

https://go.dev/blog/json

The json package uses map[string]interface{} and []interface{} values to store arbitrary JSON objects and arrays; it will happily unmarshal any valid JSON blob into a plain interface{} value. The default concrete Go types are:
bool for JSON booleans,
float64 for JSON numbers,
string for JSON strings, and
nil for JSON null.

@marcboeker marcboeker merged commit e0c5b9b into marcboeker:main Apr 5, 2024
4 checks passed
@taniabogatsch taniabogatsch deleted the implicit-cast 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