Skip to content

Commit

Permalink
build(deps): bump github.com/kunitsucom/util.go from 0.0.60-rc.3 to 0…
Browse files Browse the repository at this point in the history
….0.60-rc.4 (#5)
  • Loading branch information
ginokent authored Jan 3, 2024
2 parents 29ffe07 + abbbfd6 commit 68ccc70
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ sub commands:
version: show version
generate: command "generate" description
diff: command "diff" description
apply: command "apply" description

options:
--trace (env: DDLCTL_TRACE, default: false)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/kunitsucom/ddlctl
go 1.21.5

require (
github.com/kunitsucom/util.go v0.0.60-rc.3
github.com/kunitsucom/util.go v0.0.60-rc.4
github.com/lib/pq v1.10.9
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/kunitsucom/util.go v0.0.60-rc.3 h1:BUP+IyIzdjEq2t2V7hYt4+8dd6nO7d4oZM9Pa1e5hGY=
github.com/kunitsucom/util.go v0.0.60-rc.3/go.mod h1:bYFf2JvRqVF1brBtpdt3xkkTGJBxmYBxZlItrc/lf7Y=
github.com/kunitsucom/util.go v0.0.60-rc.4 h1:TGqi1YeOgfh4dScSfI6C14HDhoX2qCkbWEak5ZIV1Q4=
github.com/kunitsucom/util.go v0.0.60-rc.4/go.mod h1:bYFf2JvRqVF1brBtpdt3xkkTGJBxmYBxZlItrc/lf7Y=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
12 changes: 7 additions & 5 deletions pkg/ddlctl/ddlctl_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ func Apply(ctx context.Context, args []string) error {
return errorz.Errorf("args=%v: %w", args, apperr.ErrTwoArgumentsRequired)
}

left, right, err := resolve(ctx, config.Dialect(), args[0], args[1])
dsn := args[0]
ddlSrc := args[1]

left, right, err := resolve(ctx, config.Dialect(), dsn, ddlSrc)
if err != nil {
return errorz.Errorf("resolve: %w", err)
}
Expand All @@ -36,7 +39,6 @@ func Apply(ctx context.Context, args []string) error {
}

msg := `
ddlctl will exec the following DDL queries:
-- 8< --
Expand All @@ -45,7 +47,7 @@ ddlctl will exec the following DDL queries:
-- >8 --
Do you want to apply these DDL?
Do you want to apply these DDL queries?
ddlctl will exec the DDL queries described above.
Only 'yes' will be accepted to approve.
Expand All @@ -67,7 +69,7 @@ Enter a value: `

os.Stdout.WriteString("\nexecuting...\n")

db, err := sqlz.OpenContext(ctx, _postgres, args[0])
db, err := sqlz.OpenContext(ctx, _postgres, dsn)
if err != nil {
return errorz.Errorf("sqlz.OpenContext: %w", err)
}
Expand All @@ -88,7 +90,7 @@ func prompt() error {
userInput := scanner.Text()

switch userInput {
case "yes", "YES":
case "yes":
return nil
default:
return errorz.Errorf("userInput=%s: %w", userInput, apperr.ErrUserCanceled)
Expand Down

0 comments on commit 68ccc70

Please sign in to comment.