diff --git a/internal/database/dialect/mariadb.go b/internal/database/dialect/mariadb.go index 2063f445..a3be1494 100644 --- a/internal/database/dialect/mariadb.go +++ b/internal/database/dialect/mariadb.go @@ -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) diff --git a/internal/database/dialect/mongodb.go b/internal/database/dialect/mongodb.go index 0091dafc..726f3273 100644 --- a/internal/database/dialect/mongodb.go +++ b/internal/database/dialect/mongodb.go @@ -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, diff --git a/internal/database/dialect/postgres.go b/internal/database/dialect/postgres.go index b8ffbb20..11fea89a 100644 --- a/internal/database/dialect/postgres.go +++ b/internal/database/dialect/postgres.go @@ -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)