Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for next version of DBConnection once released #15

Open
shdblowers opened this issue Aug 20, 2017 · 3 comments
Open

Support for next version of DBConnection once released #15

shdblowers opened this issue Aug 20, 2017 · 3 comments
Assignees

Comments

@shdblowers
Copy link
Collaborator

Information on what needs to be done from @fishcakez via slack:

fishcakez
[10:28 PM]
elixir-ecto/postgrex#321 … is PR for postgrex
GitHub
Update to latest DBConnection by fishcakez · Pull Request #321 · elixir-ecto/postgrex
WIP: awaiting DBConnection release Adds support for non-stream cursors Adds support for advance transaction handling

[10:30]
IIRC neither supports cursors? So dont need to change cursors/streams

[10:33]
For handle_begin/commit/rollback it is expected to return {:idle | :transaction | :error, state} if the driver can know (based on database responses) that a begin/rollback/commit can not work because of the transaction status. I think :error is only relevant to postgres, so :idle means can not rollback/commit because not in transaction and :transaction means can not begin because in transaction. OFC with savepoints one might been :idle for begin (can not begin savepoint outside transaction). Please also make sure to :disconnect (instead : error) on those callbacks, to be safe.

[10:33]
there is also handle_status/2 callback, which would return {:idle | :transaction | :error, state}. This is for nested transactions so we can check that transaction is open at start and end, because begin/rollback/commit are not called.

@fishcakez
Copy link

Hi @shdblowers if you could look at this shortly, or check that it is feasible that would be very much appreciated. If we need to make changes, would rather do those sooner than later. Ideally it would be possible to get the transaction status as part of each queries response but it doesn't look like that happens.

@shdblowers shdblowers self-assigned this Aug 22, 2017
@shdblowers
Copy link
Collaborator Author

@fishcakez getting errors when I'm trying out new version of DBConnection because the arity of DBConnection.transaction has changed, opened up potential fix here: elixir-ecto/db_connection#93

@shdblowers
Copy link
Collaborator Author

shdblowers commented Aug 22, 2017

Have started work in this branch: dbconnection_update_2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants