-
Notifications
You must be signed in to change notification settings - Fork 1
Improve diff output #41
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
Conversation
b86ab59 to
64eab20
Compare
provokateurin
left a comment
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.
Nice!
internal/diff.go
Outdated
| fromDB := stdlib.OpenDB(*migrateConn.Config()) | ||
| fromDB.SetMaxOpenConns(diffMaxOpenConns) | ||
| defer fromDB.Close() | ||
| err := fromDB.Ping() | ||
| err := fromDB.PingContext(ctx) | ||
| if err != nil { | ||
| return "", fmt.Errorf("failed to open 'from database' connection: %w", err) | ||
| } | ||
|
|
||
| toDB := stdlib.OpenDB(*migrateConn.Config()) | ||
| toDB := stdlib.OpenDB(*targetConn.Config()) |
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.
Maybe name them fromConn and toConn to avoid mistakes in the future and also make it easier to understand?
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 originally named them like this to match their names elsewhere in trek (e.g. generate.go)
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.
But I guess from and to makes more sense from the perspective of the Diff function; it has no knowledge of the origin of target and migrate.
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.
But I guess from and to makes more sense from the perspective of the Diff function; it has no knowledge of the origin of target and migrate.
mise.toml
Outdated
| @@ -0,0 +1,2 @@ | |||
| [tools] | |||
| golangci-lint = "2.6.1" | |||
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.
CI uses 2.7.2 already (which currently is the latest release):
trek/.github/workflows/main.yaml
Line 22 in be4f3bf
| version: v2.7.2 |
64eab20 to
69254f5
Compare
Fixed #39