Moein-Abbasi

Moein-Abbasi

Issue with EctoNetwork - (DBConnection.EncodeError) Postgrex expected a binary, got %Postgrex.INET

I have little problem with EctoNetwork:

my schema:

 schema "test" do
    field(:req_ip, EctoNetwork.INET)
end

my migration:

create table(:test) do
  add(:req_ip, :inet)
end

It seems ok and it woks when I run the project.
But in the test mode I face with this issue.

** (DBConnection.EncodeError) Postgrex expected a binary, got %Postgrex.INET{address: {127, 0, 0, 1}, netmask: 32}. Please make sure the value you are passing matches the definition in your table or in your query or convert the value accordingly.

Any idea ?

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Can you show the code that you’re running that causes this error?

Last Post!

Moein-Abbasi

Moein-Abbasi

Thanks so much.

I Tried MIX_ENV=test ecto.drop ecto.setup and it goes away.
seems I have issue on my sandbox db.

FYI:
DB: record: req_ip -> 127.0.0.1, datatype: inet

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New

We're in Beta

About us Mission Statement