Ecto :time and :decimal types throw error on load from Database

Hello,

I have very fundamental problem with Ecto, I cannot load any records with field of type :decimal or :time. Also I use still-in-early-development-stage driver for RavenDB called Ravix-Ecto (if it would cause errors).

One of my logs:

** (ArgumentError) cannot load `"10000"` as type :decimal for field :test_decimal in %MesEmployee.Person.Schema{__meta__: #Ecto.Schema.Metadata<:loaded, "employee_people">, test_decimal: nil} `
    (ecto 3.7.2) lib/ecto/repo/queryable.ex:409: Ecto.Repo.Queryable.struct_load!/6
    (ecto 3.7.2) lib/ecto/repo/queryable.ex:233: anonymous fn/5 in Ecto.Repo.Queryable.preprocessor/3
    (elixir 1.13.0) lib/enum.ex:1593: Enum."-map/2-lists^map/1-0-"/2
    (ecto 3.7.2) lib/ecto/repo/queryable.ex:224: Ecto.Repo.Queryable.execute/4
    (ecto 3.7.2) lib/ecto/repo/queryable.ex:19: Ecto.Repo.Queryable.all/3
    (mes_store 0.1.0) lib/mes_store/event_adapter.ex:41: MesStore.EventAdapter.handle_event/3
    (mes 0.1.0) lib/mes/event/adapter.ex:22: Mes.Event.Adapter.handle_info/3
    (stdlib 3.17) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.17) gen_server.erl:771: :gen_server.handle_msg/6
    (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Does anyone know what’s wrong? Thanks for any help!

Seems like that Ravix Ecto library is trying to load a string as a decimal and lacks the code to convert it?

The double-quotes around that value ("10000") seem kind of suspect - they would definitely break decimal parsing:

iex(1)> Decimal.parse("10000")
{#Decimal<10000>, ""}

iex(2)> Decimal.parse("\"10000\"")
:error
1 Like