Closed jbavari closed 1 year ago
Using the application environment is a no-no but you can pass this as an option. However, as much as it pains me to say this, this will definitely have further implications in transactions and similar, so the best is to most likely to rescue the exception. :(
As per #260 , we wanted a way to prevent raising errors and instead return error tuples.
I may be missing something - seeking some additional guidance to figure out what's needed to make it return error tuple instead of raising.
db_connection
. Either the configuration would have to be passed down to prevent raising, or have a simpleApplication.get_env
, but keep sane defaults to raise. We do not want to disrupt all consumers of thedb_connection
library.db_connection
would appear to need to adhere to raise vs error tuple, if indeed we did get this change in place.UserApplication.Repo -> Ecto.Repo -> Ecto.Adapters.Postgres -> Ecto.Repo.Schema -> Ecto.Adaptesr.SQL -> Ecto.Adapters.SQL.Connection -> Ecto.Adapters.Postgres.Connection -> DBConnection.execute
Would love any feedback or suggestions the team would have. From where I sit, I would even think just overriding the userspace
Repo.insert
call to try/catch may be an easier fit over all. Happy to explore with the team!