Skip to content

unknown type: :string #246

@jaronoff97

Description

@jaronoff97

Hello i have a schema that looks like this (condensed):

schema "example" do
...
    field :name, :string
    field :description, :string
    field :mappings, {:map, {:array, :string}}
...
  end

with a migration that looks like this

    alter table(:example) do
      add(:mappings, :"Map(String, Array(String))", codec: "ZSTD(1)", nullable: true)
    end

But when im running my code, i get the following error upon casting:

** (ArgumentError) unknown type: `:string`
...

     stacktrace:
       (ecto_ch 0.8.2) lib/ecto/adapters/clickhouse/schema.ex:329: Ecto.Adapters.ClickHouse.Schema.ch_type_hint/1
       (ecto_ch 0.8.2) lib/ecto/adapters/clickhouse/schema.ex:322: Ecto.Adapters.ClickHouse.Schema.ch_type_hint/1
       (ecto_ch 0.8.2) lib/ecto/adapters/clickhouse/schema.ex:324: Ecto.Adapters.ClickHouse.Schema.ch_type_hint/1
       (ecto_ch 0.8.2) lib/ecto/adapters/clickhouse/schema.ex:300: Ecto.Adapters.ClickHouse.Schema.remap_type/4

which tracks given the type is not found in the ch_type_hint code despite it being in the module suggestions in the comment. Is there a reason for the omission? It's especially odd given the name and description mapping works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions