You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the PR! It'd take me some time to get to review it though, since I'm actually in the process of evaluating dropping db_connection ... But we still would be able to support Ecto sandbox and these transactions, I think. Ecto sandbox owns a connection because that's Postgres' transactions connection-local, but in ClickHouse we "just" need to pass session_id in the query string, so it might be even easier. We can do that with any HTTP connection from the pool, so we would have the normal pool (so the nimble_pool Ch version wouldn't need to change to support Ecto sandboxes) with something extra (probably a custom sandbox module in ecto_ch) to track session_ids + test pids ownership.
The CI is failing for unrelated reasons, I'll check it later as well.
Hey @ruslandoga
Thanks a lot 🙏🏼. No rush with this one. On our side, not being able to use transactions in our tests got a bit annoying, so I thought I'd take the lead in changing that so that we can run our tests in parallel. Let me know if I can help in any way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: plausible/ch#310
Summary
Ecto.Adapter.Transactionfor the ClickHouse adaptertransaction/3,in_transaction?/1, androllback/2toEcto.Adapters.SQLWhy
This is the adapter half of an experimental ClickHouse transaction spike for Ecto SQL sandbox support.
Validation
mix test test/ecto/adapters/clickhouse_test.exs