Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make checkout/3 overridable in adapters #534

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

whatyouhide
Copy link
Contributor

Exandra (a Cassandra/Scylla adapter for Ecto) uses Xandra.Cluster underneath. The issue arises because a Xandra.Cluster process is not a db_connection pool. That's because it has to connect to multiple nodes in a cluster, have a lot of logic to decide which node to execute each query on, and so on. Anyway, this causes issues with Ecto because the default checkout/3 implementation (injected through use Ecto.Adapters.SQL) relies on the db_connection behavior. This PR simply makes that callback overridable, which in our case means that we can use the cluster's logic to check out a connection.

Thoughts? 🙃

cc @vinniefranco

@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@josevalim
Copy link
Member

DBConnection should not be required, so any changes that remove that decoupling is welcome. You will likely need it for in_transaction? as well?

@whatyouhide
Copy link
Contributor Author

We just always return false 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants