dbt-sqlserver
dbt-sqlserver copied to clipboard
535 implement postgres style index creation
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, andSQLServerIndexTypeto handle index configurations and their validations (dbt/adapters/sqlserver/relation_configs/index.py). - Updated the
__init__.pyfile to include the new index configuration classes (dbt/adapters/sqlserver/relation_configs/__init__.py). [1] [2]
Adapter Updates:
- Introduced
SQLServerConfigsto manage adapter-specific configurations, including indexes (dbt/adapters/sqlserver/sqlserver_configs.py). - Added a method to parse index configurations in the
SQLServerAdapterclass (dbt/adapters/sqlserver/sqlserver_adapter.py). - Included the new
SQLServerConfigsin theSQLServerAdapterclass (dbt/adapters/sqlserver/sqlserver_adapter.py).
Macro and Test Updates:
- Added a new macro
sqlserver__get_create_index_sqlto 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.
Thanks @axellpadilla. Will set some time aside this week to review.
Hi @cody-scott , just checking how is it going