Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flyway variables support via placeholder templater (#4026)
* adding new style for supporting flyway placeholder variables in sql * add fixture for flyway style placeholder templating * adding placeholder test for flyway_var style * mandate flyway_var pattern be enclosed in curly brakcets always * adding test__config__load_placeholder_cfg Co-authored-by: Barry Hart <barrywhart@yahoo.com>
- Loading branch information
1 parent
29faf04
commit 4d2a83c
Showing
6 changed files
with
58 additions
and
1 deletion.
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
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
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,10 @@ | ||
[sqlfluff] | ||
testing_val=foobar | ||
testing_int=4 | ||
|
||
[sqlfluff:bar] | ||
foo=barbar | ||
|
||
[sqlfluff:templater:placeholder] | ||
param_style = flyway_var | ||
flyway:database = test_db |
5 changes: 5 additions & 0 deletions
5
test/fixtures/templater/placeholder_flyway_var/placeholder_flyway_var_a.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,5 @@ | ||
USE ${flyway:database}.test_schema; | ||
|
||
CREATE OR REPLACE STAGE stg_data_export_${env_name} | ||
URL = 's3://${s3_data_lake_bucket}/${env_name}/exports/stg_data_export' | ||
STORAGE_INTEGRATION = s3_integ_main; |