Ecto has no interpolation capabilities, which for a database library is a good thing. For querying a database interpolating parameters is not needed. That can and should always be done by the database to prevent sql injections. It however also means ecto can only give you the data it knows about, which are the sql for the prepared statements and separately all the parameters. That’s exactly what ecto supplies to the db as well.
It’s not as convenient to copy paste though, which is where an external library like this here can be useful.
The library design is based on guessing the suitable type by the shape of the parameter. This means there is a chance of an incorrect representation of the parameter. Here are a couple of examples:
To get rid of guessing, we need more low-level information about types, like Postgrex.Extensions.UUID, Postgrex.Extensions.JSONB, etc. But even Ecto doesn’t operate these types as the modules mentioned above are not public
Moreover, not all database adapters even have similar type representation.