-
Notifications
You must be signed in to change notification settings - Fork 623
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
Allow implementing ExecutableQuery
interface
#1759
Comments
Why can't these policies be implemented outside the package at the moment? |
As far as I remember they actually can, but we can't properly test them because there is |
Ok then we should change the title and description of the issue |
ExecutableQuery
interface
Yes, it makes sense since it touches the implementation side, but it is misleading in understanding the problem. I changed the title and described in detail what the actual problem is. |
Hmm with this title I don't think it's related to #1754 anymore is it? |
I think so, it can be closed for now... |
There are also other options how to achieve testability of HostSelectionPolicy implementations outside of the gocql package. If this gets changed in a major version, the Also, passing a struct instead of interface would allow for new fields to be added in backwards compatible way without the users needing to type-check everything. By the way, is it possible to type cast the Another option would be to provide a mock |
It sounds like a good idea to me. It will allow us to append new useful info (if any) without any breaking changes. Also, it will enable users to easily test their implementations of
On the current codebase yes, it is. |
This is also an issue for CASSGO-22, the current proposal (comment here) is to add a @martin-sucha can you provide feedback on that ticket (CASSGO-22)? It's potentially a significant change of the API so it would be nice to get as much feedback as possible. CASSGO-22 changes will impact what happens with this current issue as well. It would be great to improve this part of the API before the 2.0 release. |
The driver allows users to provide their implementations of
HostSelectionPolicy
. However, it containsPick()
method that requires an arg of theExecutableQuery
type. TheExecutableQuery
interface can't be implemented outside the pkg because it consists of private methods such asexecute()
,attempt()
, etc.The driver should allow users to implement
ExecutableQuery
to allow them to test their custom implementations of anything that requiresExecutableQuery
.The text was updated successfully, but these errors were encountered: