-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a parse pass for model hooks, parse them like models Attach the hook refs as if they were on the model Add a test exercising refs
- Loading branch information
Jacob Beck
committed
Dec 25, 2019
1 parent
1235b3f
commit 22db36c
Showing
5 changed files
with
85 additions
and
3 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
21 changes: 21 additions & 0 deletions
21
test/integration/014_hook_tests/ref-hook-models/hooked.sql
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,21 @@ | ||
{{ | ||
config({ | ||
"pre_hook": "\ | ||
insert into {{this.schema}}.on_model_hook select | ||
state, | ||
'{{ target.dbname }}' as \"target.dbname\",\ | ||
'{{ target.host }}' as \"target.host\",\ | ||
'{{ target.name }}' as \"target.name\",\ | ||
'{{ target.schema }}' as \"target.schema\",\ | ||
'{{ target.type }}' as \"target.type\",\ | ||
'{{ target.user }}' as \"target.user\",\ | ||
'{{ target.get(\"pass\", \"\") }}' as \"target.pass\",\ | ||
{{ target.port }} as \"target.port\",\ | ||
{{ target.threads }} as \"target.threads\",\ | ||
'{{ run_started_at }}' as \"run_started_at\",\ | ||
'{{ invocation_id }}' as \"invocation_id\"\ | ||
from {{ ref('pre') }}\ | ||
" | ||
}) | ||
}} | ||
select 1 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
select 'end' as state |
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 @@ | ||
select 'start' as state |
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