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

Support Postgres role scope #2137

Merged
merged 2 commits into from
Feb 15, 2020
Merged

Support Postgres role scope #2137

merged 2 commits into from
Feb 15, 2020

Conversation

shooka
Copy link
Contributor

@shooka shooka commented Feb 14, 2020

First of all, I'm super happy with DBT.

It's a great tool and it rids my team and I from the tedious and error-prone flow that we used to have before switching.

Since we're multiple people working on the same project, we need to align the access rights before creating new objects in our Postgres schemas.

Our current solution is to set two pre-hooks (one for models and one for seeds) that look like this:

set role data_engineer

This works ok, but your documentation states that it's possible to set a role in the dbt profile for Snowflake connections. I would like to be able to do that in Postgres as well.

This PR partially fixes #1955 as I haven't implemented the Redshift part of the issue. I'll do that when I get more familiar with Redshift if no one beats me to it.

@cla-bot
Copy link

cla-bot bot commented Feb 14, 2020

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @shooka

@shooka
Copy link
Contributor Author

shooka commented Feb 14, 2020

I've just signed the CLA.

@drewbanin
Copy link
Contributor

Thanks for opening this PR @shooka! @cla-bot check

This change looks good to me. I think Redshift supports groups instead of roles, so I'm unsure if any action is actually required on this front for Redshift? Let me know if you think differently.

I'm going to kick off the rest of the test suite here! Will follow up when those tests have finished running :)

@cla-bot cla-bot bot added the cla:yes label Feb 14, 2020
@cla-bot
Copy link

cla-bot bot commented Feb 14, 2020

The cla-bot has been summoned, and re-checked this pull request!

@shooka
Copy link
Contributor Author

shooka commented Feb 15, 2020

I'm unsure if any action is actually required on this front for Redshift?

This might be the case 👍 I don't know Redshift well enough to say.

Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! Nice work @shooka :)

Closing #1955 as no Redshift action is required here

@drewbanin drewbanin merged commit 3265825 into dbt-labs:dev/barbara-gittings Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add role for postgres profile
2 participants