-
Notifications
You must be signed in to change notification settings - Fork 573
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
Add JSON Type #1455
Add JSON Type #1455
Conversation
Updated with fixes and suggestions from Variant PR. There are still multiple server side bugs that will prevent certain features from working, but common scenarios work such as:
Once #1454 is merged then we can see if any tests are broken in the test matrix. Tests are passing on latest Go/ClickHouse versions. |
Looks like the tests are passing against main. Note that JSON string tests are skipped while we wait for: ClickHouse/ClickHouse#73924 @jkaflik ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Lets have it merged and iterate in next steps.
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
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: