elixir-ecto / db_connection

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

Ecto incompatibilities #9

Closed fishcakez closed 8 years ago

fishcakez commented 8 years ago

This issue is to record changes required for Ecto integration.

josevalim commented 8 years ago

I agree with all fixes.

josevalim commented 8 years ago

Pushed fixes for the last two to Ecto.

fishcakez commented 8 years ago

Solution:

[1] Why is it :rollback and not the reason for the rollback?

josevalim commented 8 years ago

We return :rollback only in the case we rollback without an explicit Repo.rollback call. However, we can change it to anything you want as this is meant for Ecto 2.0.

fishcakez commented 8 years ago

I don't mind either way so lets keep the same behaviour. I just wanted to know why :P.

fishcakez commented 8 years ago
fishcakez commented 8 years ago
josevalim commented 8 years ago

I don't mind either way so lets keep the same behaviour. I just wanted to know why :P.

We could include a stacktrace but because we are rolling back only because someone internally called Repo.rollback inside an inner transaction, I am not sure that stacktrace makes sense. :)

fishcakez commented 8 years ago

I've done the DBConnection changes except the transaction rollback change. Down to 7 failing tests in Ecto, 2 of which are due to incorrect rollback behaviour.

fishcakez commented 8 years ago

Transaction rollback behaviour now matches Ecto.

fishcakez commented 8 years ago

The Ecto branch needs a bit more work but is down to 1 failing test: https://github.com/fishcakez/ecto/tree/db_connection