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

Implement Postgres style index creation #535

Open
cody-scott opened this issue Sep 3, 2024 · 3 comments · May be fixed by #573
Open

Implement Postgres style index creation #535

cody-scott opened this issue Sep 3, 2024 · 3 comments · May be fixed by #573
Labels
enhancement New feature or request

Comments

@cody-scott
Copy link
Collaborator

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

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

@cody-scott cody-scott added the enhancement New feature or request label Sep 3, 2024
@cody-scott cody-scott changed the title Implement Postgres style indexes Implement Postgres style indexes creation Sep 3, 2024
@cody-scott cody-scott changed the title Implement Postgres style indexes creation Implement Postgres style index creation Sep 3, 2024
@axellpadilla
Copy link

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?

@cody-scott
Copy link
Collaborator Author

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

@axellpadilla
Copy link

@cody-scott will look into it

@axellpadilla axellpadilla linked a pull request Oct 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants