-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Adding a wait for sql strategy #122
Adding a wait for sql strategy #122
Conversation
) | ||
|
||
//ForSQL constructs a new waitForSql strategy for the given driver | ||
func ForSQL(port nat.Port, driver string, url func(nat.Port) string) *waitForSql { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about renaming this to ForDB
and waitForDB
? At the end of the day, we are waiting for the database. Using SQL for it seems an implementation detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good point but I assumed it'd be more consistent to point out "sql" because it can only handle sql based databases, if we just call it forDB
the client of this function might not immediately understand it'd not work for say mongodb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree in the sense using SQL distinguish from any other storage type. My only concern was related to my mind directly connecting waitForSQL
to wait for the execution of an SQL sentence
... which on the other hand is true as we use SELECT 1
.
So I'm good with this one :)
could we add tests for this? maybe at least one for every SQL database type we support? could we also add some documentation for this in the README? |
@gianarb what do you think about this PR? |
I would like to get it merged! @ClaytonNorthey92 @mdelapenya thumbs up and I will click the button! |
Thanks a lot @erdemtoraman !! If anybody is up for it |
#121
A simplified sql db waiting strategy without adding any new dependency to the library. An example usage for a postgres container: