elixir-ecto / db_connection

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

Add start_option/0 and option/0 types #188

Closed wojtekmach closed 5 years ago

wojtekmach commented 5 years ago

See https://github.com/elixir-ecto/myxql/pull/41/files for how it can be used. When this is merged, I'll perform similar changes in Postgrex.

Latest versions on Hex are db_connection 2.0.5 and postgrex 0.14.1. Say we release these types on 2.0.6 and 0.14.2, respectively. If users update to Postgrex 0.14.2 but keeps db_connection < 2.0.6, they will get a Dialyzer error:

Unknown type: DBConnection.start_option/0

We could bump Postgrex's dependency requirement but that seems too much? Perhaps having this comment here should be enough to unblock folks if they run into it.

josevalim commented 5 years ago

Folks running dialyzer can jump to the latest, yeah.

wojtekmach commented 5 years ago

@fishcakez done. I've also took a stab at documenting this option in one of the functions, if this looks good I think we should repeat it in other functions as we do for :timeout - let me know.