Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

535 implement postgres style index creation #573

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

axellpadilla
Copy link

@axellpadilla axellpadilla commented Oct 22, 2024

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.

@cody-scott
Copy link
Collaborator

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

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.

Implement Postgres style index creation
2 participants