I’m trying to figure out how to translate an existing database field from a Rails model that has a binary format. It is used for storing uploaded file contents. I don’t see :binary as an option in https://hexdocs.pm/postgrex/readme.html#Data-representation. Would ‘bytea’ be a suitable alternative?
In a recent project, I had the chance to use JSON in Ecto. Although Ecto does not currently support JSON, it does provide us with the capability to define custom types. In this blog post, we’ll go through how we can use the JSON type in Ecto. Did I mention JSON enough already?