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

Separate cmd package for easier importing #11

Merged
merged 1 commit into from May 5, 2017
Merged

Conversation

amacneil
Copy link
Owner

Refactors dbmate into a package which can be imported, and a separate command which uses that package. Based on #10, main changes are:

  • Kept package files in root directory so that it can be imported as github.com/amacneil/dbmate (also means you can use the commands as dbmate.Foo instead of pkg.Foo)
  • Refactored package & tests so that they have no dependency on urfave/cli
  • Added dbmate.DB object which can be used to call high level functions

Example of using this package:

u, _ := url.Parse("postgres://foo")
db := dbmate.NewDB(u)
db.Migrate()

@amacneil amacneil merged commit e393f38 into master May 5, 2017
@amacneil amacneil deleted the refactor-packages branch May 5, 2017 03:58
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.

None yet

1 participant