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

Doesn't work with the latest version of clickhousex #22

Open
khaskelberg opened this issue Nov 5, 2020 · 0 comments
Open

Doesn't work with the latest version of clickhousex #22

khaskelberg opened this issue Nov 5, 2020 · 0 comments

Comments

@khaskelberg
Copy link

Hello. Latest clickhouse_ecto version doesn't work with ecto 3

** (FunctionClauseError) no function clause matching in Ecto.Repo.Queryable.struct_load!/6    
    
    The following arguments were given to Ecto.Repo.Queryable.struct_load!/6:
    
        # 1
        [timestamp: :utc_datetime, device_id: :integer, message: :string]
    
        # 2
        {~N[2020-11-02 18:27:28], 2, "2020/11/02 21:27:28 Random test info"}
    
        # 3
        []
    
        # 4
        false
    
        # 5
        %Click.Log{
          __meta__: #Ecto.Schema.Metadata<:loaded, "logs">,
          device_id: nil,
          message: nil,
          timestamp: nil
        }
    
        # 6
        ClickhouseEcto
    
    Attempted function clauses (showing 3 out of 3):
    
        def struct_load!([{field, type} | types], [value | values], acc, all_nil?, struct, adapter)
        def struct_load!([], values, _acc, true, _struct, _adapter)
        def struct_load!([], values, acc, false, struct, _adapter)
    
    (ecto 3.5.4) lib/ecto/repo/queryable.ex:186: Ecto.Repo.Queryable.struct_load!/6
    (ecto 3.5.4) lib/ecto/repo/queryable.ex:245: anonymous fn/5 in Ecto.Repo.Queryable.preprocessor/3
    (elixir 1.11.2) lib/enum.ex:1399: Enum."-map/2-lists^map/1-0-"/2
    (ecto 3.5.4) lib/ecto/repo/queryable.ex:236: Ecto.Repo.Queryable.execute/4
    (ecto 3.5.4) lib/ecto/repo/queryable.ex:17: Ecto.Repo.Queryable.all/3

As you can see Ecto expected single row to be a List but Clickhousex returns a tuple.

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

No branches or pull requests

1 participant