-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 hooks #22
Comments
This is a good idea |
@jthandy is this still something you think we should queue up? |
I'd rather make progress on testing for the moment than implement this. This is cool but I don't think it's extremely pressing... |
I don't feel nearly as much need for this as I once did. The core dbt workflow is clean and getting cleaner. There doesn't seem to be some gaping hole at the moment that could be filled by hooks. We can take this up again in the future if there's a clear need for it. |
Ok I take this back. there is a big problem that I need to use this to fix: {{config(post-hook="grant select on "+self())}} |
/cc @drewbanin just reopened this. this is being mildly annoying working with contactually right now and querying the views in looker. would be great to resolve this as a part of 0.2.5.0 if at all possible. |
Can I run multiple SQL statements in an SQL post hook? In addition to granting full access of the table, I also want to log an entry to an audit table in Redshift for logging process start and end times. |
Yes, hooks can accept a list of SQL statements (docs) |
We need to create "hooks" for the core dbt tasks. Hooks would simply offer the opportunity to write sql-based scripts that would execute before and after the various stages in the dbt commands.
One example use for a hook would be setting grants for a schema and all tables in it to certain users after that schema is created. There's no need for dbt to set those grants itself, this is a generic way to allow users to do this or many other tasks associated with dbt processes.
For now, I could imagine pre and post hooks for dbt run. Since the other commands don't actually interface with the database, I'm not sure that the concept makes as much sense there. If anyone can imagine a use, I'd be open to it though.
In the future it might make sense to implement hooks for individual models, but I don't see the need to do that today.
The text was updated successfully, but these errors were encountered: