-
Notifications
You must be signed in to change notification settings - Fork 8
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 passing a handle instead of url connection string #2
Comments
We probably have two viable options:
We could make methods like
Most likely any one project using migrate are using just one type of driver. I don't think many projects exists where you would have e.g. migrations for postgres and cassandra in the same project. They would probably be separate. So we might get away with not going through migrate as a registry to reach the driver but to just talk to the driver directly which in turn uses common functionality from the migrate library. So we would expose the driver to the developer and have migrate as a dependency to the driver instead of the other way around. |
Thanks for clarifying this! I agree 100% on point 2. So to sum up:
Are we on the same page? |
Well, that also seems like a good solution but api wise I meant something different. What I meant was: Instead of having For the cli either way works fine as this is not exposed to the user. However, if they are using the library, a sample open & migrate snippet might look like so: migrate:
|
Obviously with your api, we could also introduce a
|
In any case, since we are reworking the API, I have some more issues with it that we could consider:
|
All the points here are very valid. I addressed some in the ticket that was referenced above.
v3 passes in an Logger interface. @danilobuerger |
That's a lot of subjects in the same issue :) I'm fine with the changes you're proposing.
Thanks for your help! |
Alright, I hope I can get some work done on the weekend. |
Hi guys! Any progress on this (on issue subject, and anything discussed above) ? |
Also, maybe I've missed something, but I don't see any rationale behind "async" functions and "piping". |
Hi, the async and piping things were coming from the original mattes/migrate code. |
Forking, updating and opening PRs for each driver repo separately sucks (when you edit all of them at the same time 😄 ) |
As discussed in https://github.com/gemnasium/migrate/issues/24 we should have the ability to pass a handle instead of an url connection string. However, we can not just assume
*sql.DB
as we have other nosql drivers like cassandra and bash.The text was updated successfully, but these errors were encountered: