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

Implement Postgres style index creation

Open cody-scott opened this issue 1 year ago • 3 comments

Add index creation structure like dbt-postgres through an index configuration statement.

https://docs.getdbt.com/reference/resource-configs/postgres-configs#indexes

cody-scott avatar Sep 03 '24 19:09 cody-scott

Hi @cody-scott , I can work into implementing a first version of this, do you have any suggestions about the development, branching and pull request that are not on the contributing guidelines?

axellpadilla avatar Sep 23 '24 14:09 axellpadilla

hi @axellpadilla thanks for offering!

The way they manage indexes is a bit different. Instead of embedding the macros as hooks like we do, they have them as keys in the config. https://docs.getdbt.com/reference/resource-configs/postgres-configs

I think this would be the starting point to look from. Not sure exactly what it will look like to implement. https://github.com/dbt-labs/dbt-postgres/blob/2fc6561620e3c6f6c103ce8bb886442f7a27a33a/dbt/adapters/postgres/relation.py#L78

In terms of contributing, would be looking for tests for the behaviour you add. Something like this https://github.com/dbt-labs/dbt-postgres/blob/2fc6561620e3c6f6c103ce8bb886442f7a27a33a/tests/functional/postgres/test_indexes.py#L21. If there is a standard test in the test suite, then it would go under the /tests/functional/adapter/dbt folder; if its specific to MSSQL it would go under the /tests/functional/adapter/mssql folder. This would likely go under the other folder. I think this would be an "in addition" to the existing syntax, as to not break existing implementations.

https://github.com/dbt-labs/dbt-postgres/blob/2fc6561620e3c6f6c103ce8bb886442f7a27a33a/dbt/adapters/postgres/relation.py#L78

https://github.com/dbt-labs/dbt-postgres/blob/2fc6561620e3c6f6c103ce8bb886442f7a27a33a/dbt/adapters/postgres/impl.py#L33

https://github.com/dbt-labs/dbt-postgres/blob/2fc6561620e3c6f6c103ce8bb886442f7a27a33a/dbt/adapters/postgres/relation_configs/index.py#L16

cody-scott avatar Sep 26 '24 15:09 cody-scott

@cody-scott will look into it

axellpadilla avatar Sep 27 '24 03:09 axellpadilla