Skip to content

Commit

Permalink
feat(exec): Add exec to the beginning of db client commands
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 5, 2023
1 parent 956f9da commit c294064
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/database/dialect/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (db MariaDB) PasswordEnvNames(c config.Global) []string {
func (MariaDB) ExecCommand(conf config.Exec) *command.Builder {
cmd := command.NewBuilder(
command.NewEnv("MYSQL_PWD", conf.Password),
"mysql", "--host="+conf.Host, "--user="+conf.Username,
"exec", "mysql", "--host="+conf.Host, "--user="+conf.Username,
)
if conf.Database != "" {
cmd.Push("--database=" + conf.Database)
Expand Down
2 changes: 1 addition & 1 deletion internal/database/dialect/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (db MongoDB) AuthenticationDatabase(c config.Global) string {

func (db MongoDB) ExecCommand(conf config.Exec) *command.Builder {
cmd := command.NewBuilder(
command.Raw(`"$(which mongosh || which mongo)"`),
"exec", command.Raw(`"$(which mongosh || which mongo)"`),
"--host="+conf.Host,
"--username="+conf.Username,
"--password="+conf.Password,
Expand Down
2 changes: 1 addition & 1 deletion internal/database/dialect/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (db Postgres) PasswordEnvNames(c config.Global) []string {
func (Postgres) ExecCommand(conf config.Exec) *command.Builder {
cmd := command.NewBuilder(
command.NewEnv("PGPASSWORD", conf.Password),
"psql", "--host="+conf.Host, "--username="+conf.Username,
"exec", "psql", "--host="+conf.Host, "--username="+conf.Username,
)
if conf.Database != "" {
cmd.Push("--dbname=" + conf.Database)
Expand Down

0 comments on commit c294064

Please sign in to comment.