Implement Postgres style index creation
Add index creation structure like dbt-postgres through an index configuration statement.
https://docs.getdbt.com/reference/resource-configs/postgres-configs#indexes
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?
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 will look into it