Skip to content

fix(mssql): update SQL keywords to uppercase for consistency#4795

Merged
izeigerman merged 3 commits intoSQLMesh:mainfrom
mattiasthalen:fix/mssql-information-schema
Jun 24, 2025
Merged

fix(mssql): update SQL keywords to uppercase for consistency#4795
izeigerman merged 3 commits intoSQLMesh:mainfrom
mattiasthalen:fix/mssql-information-schema

Conversation

@mattiasthalen
Copy link
Copy Markdown
Contributor

@mattiasthalen mattiasthalen commented Jun 23, 2025

This pull request updates SQL queries in the MSSQL engine adapter and its corresponding tests to use uppercase identifiers for schema objects (INFORMATION_SCHEMA, TABLES, COLUMNS, etc.) to align with SQL standards and improve consistency. The changes span both the core implementation and the test suite.

NOTE: This is done to enable the fabric engine adaptor without having to override functions from the MSSQL engine adaptor.

Core MSSQL Engine Updates:

  • Updated columns method in sqlmesh/core/engine_adapter/mssql.py to use uppercase identifiers for schema objects (COLUMN_NAME, DATA_TYPE, etc.) and table-related keywords (TABLE_NAME, TABLE_SCHEMA).
  • Updated table_exists method in sqlmesh/core/engine_adapter/mssql.py to use uppercase identifiers for INFORMATION_SCHEMA.TABLES and table-related keywords (TABLE_NAME, TABLE_SCHEMA).

Test Updates for MSSQL Engine:

  • Adjusted SQL queries in tests/core/engine_adapter/test_mssql.py to match the updated uppercase schema object identifiers in tests for columns, table_exists, and various table operations such as CREATE TABLE, MERGE, and INSERT.

@mattiasthalen mattiasthalen marked this pull request as ready for review June 23, 2025 22:06
@mattiasthalen mattiasthalen force-pushed the fix/mssql-information-schema branch from eb2cac6 to 53c07ab Compare June 24, 2025 06:35
@mattiasthalen mattiasthalen force-pushed the fix/mssql-information-schema branch from a26ce7f to 24bf21f Compare June 24, 2025 08:45
@izeigerman izeigerman merged commit 186f0ed into SQLMesh:main Jun 24, 2025
21 checks passed
@mattiasthalen mattiasthalen deleted the fix/mssql-information-schema branch June 25, 2025 06:58
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.

3 participants