-
Notifications
You must be signed in to change notification settings - Fork 17
update Ch to add JSON support #233
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
Conversation
|
Hey! Thanks for the work on this PR. In the repo settings I have: Schema is: Error is happening when I try to insert deeply nested json, here is the query log: Any ideas why this happens? |
|
👋 Thank you for trying it out! I added this insert as a test in 38eb62f and it seems to pass (including with |
|
Hey! Thanks for the quick reply. Here is the code that fails missing_tokens = [
%{mint: "123", data: %{"name" => "Test", "nested" => %{"name" => "Test", "arr" => ["abc", "b=deb"]}}, created_at: NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)},
%{mint: "325", data: %{"name" => "Test", "nested" => %{"name" => "Test", "arr" => ["abc", "b=deb"]}}, created_at: NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)}
]}
{inserted_count, _} = Repo.insert_all(TokenInfoSchema, missing_tokens)with error: |
|
Hm. Something else might be different, since that snippet also seems to work: 05e5dbc |
|
Ah, I was able to reproduce it by commenting out Application.put_env(:ecto_ch, TestRepo,
adapter: Ecto.Adapters.ClickHouse,
database: "ecto_ch_test",
show_sensitive_data_on_connection_error: true,
settings: [
enable_json_type: 1
# output_format_binary_write_json_as_string: 1,
# input_format_binary_read_json_as_string: 1
]
)It resulted in the same error: It seems like the |
|
Hm, thanks for the finding. I run ecto in a different way, I added these settings to the startup of the repo (instead of code definition file) and everything works! |
Ecto part of plausible/ch#262