Skip to content

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

Description

@khaskelberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions