Skip to content

[codex] Use native ClickHouse JSON paths#284

Merged
ruslandoga merged 6 commits into
masterfrom
ruslandoga+conductor/ruslandoga-conductor/native-json-path-changelog
Jun 2, 2026
Merged

[codex] Use native ClickHouse JSON paths#284
ruslandoga merged 6 commits into
masterfrom
ruslandoga+conductor/ruslandoga-conductor/native-json-path-changelog

Conversation

@ruslandoga
Copy link
Copy Markdown
Collaborator

@ruslandoga ruslandoga commented Jun 2, 2026

What changed

  • Compile Ecto json_extract_path/2 and bracket JSON access to native ClickHouse JSON subcolumn paths such as json.foo.bar.
  • Quote non-identifier JSON keys with backticks in generated native paths.
  • Update SQL rendering expectations for JSON path queries.
  • Enable the skipped JSON serialization coverage by creating a local settings JSON table in the test and checking native path access.
  • Add a JSON integration test for json_extract_path/2 and bracket syntax on nested JSON paths.
  • Document the SQL output change as a breaking change in the changelog.

Why

ClickHouse native JSON columns support reading leaf paths as subcolumns, and using JSON_QUERY(json, '$.foo.bar') keeps the adapter on the older function-based path syntax. This changes the adapter to emit the native path form requested by the current JSON support.

Impact

This is a breaking SQL generation change for callers relying on the exact JSON_QUERY(...) output from json_extract_path/2 or Ecto bracket JSON access. Generated queries now use ClickHouse native path syntax.

Related: #269

@ruslandoga ruslandoga marked this pull request as ready for review June 2, 2026 11:21
Comment thread CHANGELOG.md Outdated
@ruslandoga ruslandoga merged commit e791326 into master Jun 2, 2026
2 checks passed
@ruslandoga ruslandoga deleted the ruslandoga+conductor/ruslandoga-conductor/native-json-path-changelog branch June 2, 2026 11:35
@ruslandoga
Copy link
Copy Markdown
Collaborator Author

Released as https://hex.pm/packages/ecto_ch/0.10.0

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.

1 participant