Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR text is pending update
Note: There are some server-side bugs that need to be fixed/merged, including a protocol update. However, this PR can still be reviewed as-is.
Summary
Implement
JSON
column type. Fully resolves #1430.Usage
The user can use JSON in 3 ways:
clickhouse.JSON
type to assemble JSON data by path strings.map[string]any
.json.(Un)Marshal
and the strings get sent to the server as-is.The JSON column also supports the
clickhouse.Dynamic
andclickhouse.DynamicWithType
type for handling a path with multiple data types. Structs can also include a tag to specify type, such asjson:"my_field" chType:"Array(String)"
.See examples folder for sample code.
Checklist
Delete items not relevant to your PR: