Skip to content

Enhance setup_dbs.py with mssql-tools version check#1581

Merged
jahnvi480 merged 1 commit intodevfrom
david/setup_dbs_fix
Mar 3, 2026
Merged

Enhance setup_dbs.py with mssql-tools version check#1581
jahnvi480 merged 1 commit intodevfrom
david/setup_dbs_fix

Conversation

@David-Engel
Copy link
Copy Markdown
Collaborator

This pull request improves compatibility with newer versions of mssql-tools (version 18 and above) by detecting the installed version and conditionally adding encryption-related flags to sqlcmd and bcp commands. This ensures that database setup scripts work correctly with servers that do not have valid TLS certificates, especially when using self-signed certificates.

Compatibility improvements for mssql-tools v18+:

  • Added a helper function _is_mssqltools_v18() to detect if mssql-tools version 18 or higher is installed, which enforces mandatory encryption by default.
  • Introduced conditional variables _encrypt_opt_sqlcmd and _encrypt_opt_bcp to append appropriate encryption flags (-Yo -C for sqlcmd, -Yo -u for bcp) only when required by the tool version.

Command construction updates:

  • Modified the construction of bcp command in executeBulkCopy to include encryption flags when necessary, ensuring bulk copy operations work with self-signed certificates.
  • Updated the connection options used in setupAE to append the correct encryption flags for sqlcmd, improving reliability with ODBC 18 and above encryption.

@David-Engel David-Engel marked this pull request as ready for review February 27, 2026 23:53
@jahnvi480 jahnvi480 merged commit 5bb1ea2 into dev Mar 3, 2026
8 checks passed
@David-Engel David-Engel deleted the david/setup_dbs_fix branch March 3, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants