dbt-sqlserver icon indicating copy to clipboard operation
dbt-sqlserver copied to clipboard

535 implement postgres style index creation

Open axellpadilla opened this issue 1 year ago • 2 comments

This pull request introduces enhancements to the SQL Server adapter in the dbt project, primarily focusing on adding support for index configurations based on the postgresql adapter implementation. The changes include new classes for index configuration, updates to the SQL Server adapter to handle these configurations, and corresponding test updates. Closes #535 .

Index Configuration Enhancements:

  • Added new classes SQLServerIndexConfig, SQLServerIndexConfigChange, and SQLServerIndexType to handle index configurations and their validations (dbt/adapters/sqlserver/relation_configs/index.py).
  • Updated the __init__.py file to include the new index configuration classes (dbt/adapters/sqlserver/relation_configs/__init__.py). [1] [2]

Adapter Updates:

  • Introduced SQLServerConfigs to manage adapter-specific configurations, including indexes (dbt/adapters/sqlserver/sqlserver_configs.py).
  • Added a method to parse index configurations in the SQLServerAdapter class (dbt/adapters/sqlserver/sqlserver_adapter.py).
  • Included the new SQLServerConfigs in the SQLServerAdapter class (dbt/adapters/sqlserver/sqlserver_adapter.py).

Macro and Test Updates:

  • Added a new macro sqlserver__get_create_index_sql to generate SQL for creating indexes based on the new configurations (dbt/include/sqlserver/macros/adapter/indexes.sql).
  • Updated and expanded tests to cover the new index configuration functionality (tests/functional/adapter/mssql/test_index_macros.py). [1] [2] [3] [4] [5]
  • Added unit test for index config classes. [1]

Still pending:

  • Testing for index config changes and fixing/implementing the config changed procedure.

axellpadilla avatar Oct 22 '24 05:10 axellpadilla

Thanks @axellpadilla. Will set some time aside this week to review.

cody-scott avatar Oct 28 '24 15:10 cody-scott

Hi @cody-scott , just checking how is it going

axellpadilla avatar Dec 05 '24 22:12 axellpadilla