-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pre_hook/post_hook kwargs to config, add tests
- Loading branch information
Jacob Beck
committed
Nov 21, 2018
1 parent
029ef17
commit e543dc4
Showing
3 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
{{ | ||
config( | ||
pre_hook="\ | ||
insert into {{this.schema}}.on_model_hook (\ | ||
\"state\",\ | ||
\"target.dbname\",\ | ||
\"target.host\",\ | ||
\"target.name\",\ | ||
\"target.schema\",\ | ||
\"target.type\",\ | ||
\"target.user\",\ | ||
\"target.pass\",\ | ||
\"target.port\",\ | ||
\"target.threads\",\ | ||
\"run_started_at\",\ | ||
\"invocation_id\"\ | ||
) VALUES (\ | ||
'start',\ | ||
'{{ target.dbname }}',\ | ||
'{{ target.host }}',\ | ||
'{{ target.name }}',\ | ||
'{{ target.schema }}',\ | ||
'{{ target.type }}',\ | ||
'{{ target.user }}',\ | ||
'{{ target.pass }}',\ | ||
{{ target.port }},\ | ||
{{ target.threads }},\ | ||
'{{ run_started_at }}',\ | ||
'{{ invocation_id }}'\ | ||
)", | ||
post_hook="\ | ||
insert into {{this.schema}}.on_model_hook (\ | ||
\"state\",\ | ||
\"target.dbname\",\ | ||
\"target.host\",\ | ||
\"target.name\",\ | ||
\"target.schema\",\ | ||
\"target.type\",\ | ||
\"target.user\",\ | ||
\"target.pass\",\ | ||
\"target.port\",\ | ||
\"target.threads\",\ | ||
\"run_started_at\",\ | ||
\"invocation_id\"\ | ||
) VALUES (\ | ||
'end',\ | ||
'{{ target.dbname }}',\ | ||
'{{ target.host }}',\ | ||
'{{ target.name }}',\ | ||
'{{ target.schema }}',\ | ||
'{{ target.type }}',\ | ||
'{{ target.user }}',\ | ||
'{{ target.pass }}',\ | ||
{{ target.port }},\ | ||
{{ target.threads }},\ | ||
'{{ run_started_at }}',\ | ||
'{{ invocation_id }}'\ | ||
)" | ||
) | ||
}} | ||
|
||
select 3 as id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters