{"action":"created","issue":{"url":"https://api.github.com/repos/analyst-collective/dbt/issues/22","repository_url":"https://api.github.com/repos/analyst-collective/dbt","labels_url":"https://api.github.com/repos/analyst-collective/dbt/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/analyst-collective/dbt/issues/22/comments","events_url":"https://api.github.com/repos/analyst-collective/dbt/issues/22/events","html_url":"https://github.com/analyst-collective/dbt/issues/22","id":148379828,"number":22,"title":"implement hooks","user":{"login":"jthandy","id":2341841,"avatar_url":"https://avatars.githubusercontent.com/u/2341841?v=3","gravatar_id":"","url":"https://api.github.com/users/jthandy","html_url":"https://github.com/jthandy","followers_url":"https://api.github.com/users/jthandy/followers","following_url":"https://api.github.com/users/jthandy/following{/other_user}","gists_url":"https://api.github.com/users/jthandy/gists{/gist_id}","starred_url":"https://api.github.com/users/jthandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthandy/subscriptions","organizations_url":"https://api.github.com/users/jthandy/orgs","repos_url":"https://api.github.com/users/jthandy/repos","events_url":"https://api.github.com/users/jthandy/events{/privacy}","received_events_url":"https://api.github.com/users/jthandy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false},"assignees":[{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-04-14T14:30:01Z","updated_at":"2016-07-27T23:22:28Z","closed_at":null,"body":"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.\r\n\r\nOne 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.\r\n\r\nFor 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.\r\n\r\nIn the future it might make sense to implement hooks for individual models, but I don't see the need to do that today."},"comment":{"url":"https://api.github.com/repos/analyst-collective/dbt/issues/comments/235751372","html_url":"https://github.com/analyst-collective/dbt/issues/22#issuecomment-235751372","issue_url":"https://api.github.com/repos/analyst-collective/dbt/issues/22","id":235751372,"user":{"login":"jthandy","id":2341841,"avatar_url":"https://avatars.githubusercontent.com/u/2341841?v=3","gravatar_id":"","url":"https://api.github.com/users/jthandy","html_url":"https://github.com/jthandy","followers_url":"https://api.github.com/users/jthandy/followers","following_url":"https://api.github.com/users/jthandy/following{/other_user}","gists_url":"https://api.github.com/users/jthandy/gists{/gist_id}","starred_url":"https://api.github.com/users/jthandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthandy/subscriptions","organizations_url":"https://api.github.com/users/jthandy/orgs","repos_url":"https://api.github.com/users/jthandy/repos","events_url":"https://api.github.com/users/jthandy/events{/privacy}","received_events_url":"https://api.github.com/users/jthandy/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T23:22:28Z","updated_at":"2016-07-27T23:22:28Z","body":"Ok I take this back. there is a big problem that I need to use this to fix: `grant` statements! Right now I'm using dbt on one project as a non-admin user, and I need to manually run grant statements on tables every time I do `dbt run`. Ideally, I would be able to configure a post-hook to accomplish this:\r\n\r\n{{config(post-hook=\"grant select on \"+self())}}"}}
{"actor":{"display_login":"jthandy"}}