Skip to content

Conversation

miagilepner
Copy link

This PR adds support for passing a context to database drivers. I've added migrate.NewWithContext() and migrate.NewWithSourceContext() which accept a context. For each driver, I've added OpenWithContext and WithInstanceContext which will pass the context to the database during any initial connection. This handles #571.

@coveralls
Copy link

coveralls commented Oct 19, 2021

Pull Request Test Coverage Report for Build 1359990807

  • 228 of 275 (82.91%) changed or added relevant lines in 18 files are covered.
  • 7 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+1.04%) to 58.734%

Changes Missing Coverage Covered Lines Changed/Added Lines %
database/cassandra/cassandra.go 8 10 80.0%
database/firebird/firebird.go 9 11 81.82%
database/mysql/mysql.go 10 12 83.33%
database/spanner/spanner.go 10 12 83.33%
database/sqlserver/sqlserver.go 11 13 84.62%
database/cockroachdb/cockroachdb.go 14 17 82.35%
database/redshift/redshift.go 10 13 76.92%
database/stub/stub.go 11 26 42.31%
migrate.go 32 48 66.67%
Files with Coverage Reduction New Missed Lines %
database/cassandra/cassandra.go 1 47.37%
database/cockroachdb/cockroachdb.go 1 62.98%
database/firebird/firebird.go 1 75.58%
database/mysql/mysql.go 1 64.74%
database/redshift/redshift.go 1 67.86%
database/spanner/spanner.go 1 69.51%
database/sqlserver/sqlserver.go 1 70.08%
Totals Coverage Status
Change from base Build 1346768578: 1.04%
Covered Lines: 3880
Relevant Lines: 6606

💛 - Coveralls

@iwarapter
Copy link

hey i'd love to see this change merged are their any blockers (apart from it being out of date with master)?

@Schartey Schartey mentioned this pull request Nov 17, 2021
@dhui
Copy link
Member

dhui commented Dec 7, 2021

Thanks for the PR!

hey i'd love to see this change merged are their any blockers (apart from it being out of date with master)?

Sorry I need to find time to review this :( I'll try to get to it during the holidays.

@Fontinalis Fontinalis added this to the v4.16.0 milestone Apr 27, 2022
@Fontinalis Fontinalis added the database Updates database drivers label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Updates database drivers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants