Skip to content
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

Change default SQL Server database command to sqlcmd #28918

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

gabrielcorado
Copy link
Contributor

Given mssql-cli is being deprecated in favor of sqlcmd, we're switching it to be the default command, with fallback to mssql-cli when it is not present on PATH.

Note: Both, Golang and ODBC-based implementations are supported.

@@ -568,6 +578,10 @@ func (c *CLICommandBuilder) getSQLServerCommand() *exec.Cmd {
args = append(args, "-d", c.db.Database)
}

if c.isSqlcmdAvailable() {
return exec.Command(sqlcmdBin, args...)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it support exactly the same arguments as mssql-cli?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and since we're always using a tunneled proxy, there is no need to have additional flags.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, adding a comment to that effect might be helpful here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a comment on the function godoc.

@gabrielcorado gabrielcorado added this pull request to the merge queue Jul 11, 2023
Merged via the queue into master with commit caacc54 Jul 11, 2023
24 checks passed
@gabrielcorado gabrielcorado deleted the gabrielcorado/support-sqlcmd-dbcmd branch July 11, 2023 13:01
@public-teleport-github-review-bot

@gabrielcorado See the table below for backport results.

Branch Result
branch/v11 Create PR
branch/v12 Create PR
branch/v13 Create PR

@greedy52
Copy link
Contributor

we may want to fallback to sqlcmd if both sqlcmd and mssql-cli are not available. We've recently done it for mongo for a similar situation: #28115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants