elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
309 stars 112 forks source link

Include `after_connect` in synchronous connection #32

Closed fishcakez closed 8 years ago

fishcakez commented 8 years ago

This is awkward so lets have it as a feature :sweat_smile:

fishcakez commented 8 years ago

@josevalim we need to support this because the errors for Ecto.Adapters.Postgrex.storage_up etc are not good now. You can see tests pass for Postgrex with https://github.com/elixir-lang/ecto/tree/jf-db_conn-1_0 but the test is not strict enough to show it.

The message on error looks like:

"shutdown: %Postgrex.Error{connection_id: nil, message: nil, postgres: %{code: :invalid_password, file: \"auth.c\", line: \"285\", message: \"password authentication failed for user \\\"randomuser\\\"\", pg_code: \"28P01\", routine: \"auth_failed\", severity: \"FATAL\"}}"

Instead of just the message from the Postgrex.Error exception.

fishcakez commented 8 years ago

Nevermind :dancer: