Skip to content

Fix(mssql): Properly quote table and views when dropping in mssql#4773

Merged
themisvaltinos merged 3 commits intomainfrom
themis/destroymssql
Jun 20, 2025
Merged

Fix(mssql): Properly quote table and views when dropping in mssql#4773
themisvaltinos merged 3 commits intomainfrom
themis/destroymssql

Conversation

@themisvaltinos
Copy link
Copy Markdown
Collaborator

@themisvaltinos themisvaltinos commented Jun 20, 2025

This update fixes quoting in mssql's drop_schema to correctly handle table and view names containing spaces or special characters. closes #4633

While this won't be an issue in recent sqlglot versions, the change fool proofs by adding proper square bracket quoting for schema and object names. Also since _drop_object does not account for dialect when using to_table it is addressed in drop_schema and it is passed as a table there.

@themisvaltinos themisvaltinos marked this pull request as ready for review June 20, 2025 10:43
@themisvaltinos themisvaltinos requested review from a team, VaggelisD and georgesittas June 20, 2025 10:44
Comment thread sqlmesh/core/engine_adapter/mssql.py Outdated
themisvaltinos and others added 2 commits June 20, 2025 15:29
Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
@themisvaltinos themisvaltinos merged commit c3a4362 into main Jun 20, 2025
25 checks passed
@themisvaltinos themisvaltinos deleted the themis/destroymssql branch June 20, 2025 12:52
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.

sqlmesh destroy fails because it's not properly qualifying names

2 participants