-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: environment variables interpolation (#604)
Co-authored-by: Mike Fridman <mf192@icloud.com>
- Loading branch information
Showing
41 changed files
with
247 additions
and
22 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
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 @@ | ||
DROP TABLE us_east_post; -- 1st stmt |
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,6 @@ | ||
CREATE TABLE us_east_post ( | ||
id int NOT NULL, | ||
title text, | ||
body text, | ||
PRIMARY KEY(id) | ||
); -- 1st stmt |
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 2; -- 2nd stmt |
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 3; SELECT 3; -- 3rd stmt |
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 4; -- 4th stmt |
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,17 @@ | ||
-- +goose ENVSUB ON | ||
-- +goose Up | ||
CREATE TABLE ${GOOSE_ENV_REGION}post ( | ||
id int NOT NULL, | ||
title text, | ||
body text, | ||
PRIMARY KEY(id) | ||
); -- 1st stmt | ||
|
||
-- comment | ||
SELECT 2; -- 2nd stmt | ||
SELECT 3; SELECT 3; -- 3rd stmt | ||
SELECT 4; -- 4th stmt | ||
|
||
-- +goose Down | ||
-- comment | ||
DROP TABLE ${GOOSE_ENV_REGION}post; -- 1st stmt |
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,8 @@ | ||
CREATE TABLE post ( | ||
id int NOT NULL, | ||
title text, | ||
foo text, | ||
footitle3 text, | ||
defaulttitle4 text, | ||
title5 text, | ||
); |
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,8 @@ | ||
CREATE TABLE post ( | ||
id int NOT NULL, | ||
title text, | ||
$GOOSE_ENV_NAME text, | ||
${GOOSE_ENV_NAME}title3 text, | ||
${ANOTHER_VAR:-default}title4 text, | ||
${GOOSE_ENV_SET_BUT_EMPTY_VALUE-default}title5 text, | ||
); |
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,6 @@ | ||
CREATE OR REPLACE FUNCTION test_func() | ||
RETURNS void AS $$ | ||
BEGIN | ||
RAISE NOTICE 'foo $GOOSE_ENV_NAME $GOOSE_ENV_NAME'; | ||
END; | ||
$$ LANGUAGE plpgsql; |
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,32 @@ | ||
-- +goose Up | ||
|
||
-- +goose ENVSUB ON | ||
CREATE TABLE post ( | ||
id int NOT NULL, | ||
title text, | ||
$GOOSE_ENV_NAME text, | ||
${GOOSE_ENV_NAME}title3 text, | ||
${ANOTHER_VAR:-default}title4 text, | ||
${GOOSE_ENV_SET_BUT_EMPTY_VALUE-default}title5 text, | ||
); | ||
-- +goose ENVSUB OFF | ||
|
||
CREATE TABLE post ( | ||
id int NOT NULL, | ||
title text, | ||
$GOOSE_ENV_NAME text, | ||
${GOOSE_ENV_NAME}title3 text, | ||
${ANOTHER_VAR:-default}title4 text, | ||
${GOOSE_ENV_SET_BUT_EMPTY_VALUE-default}title5 text, | ||
); | ||
|
||
-- +goose StatementBegin | ||
CREATE OR REPLACE FUNCTION test_func() | ||
RETURNS void AS $$ | ||
-- +goose ENVSUB ON | ||
BEGIN | ||
RAISE NOTICE '${GOOSE_ENV_NAME} \$GOOSE_ENV_NAME \$GOOSE_ENV_NAME'; | ||
END; | ||
-- +goose ENVSUB OFF | ||
$$ LANGUAGE plpgsql; | ||
-- +goose StatementEnd |
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,8 @@ | ||
CREATE TABLE post ( | ||
id int NOT NULL, | ||
title text, | ||
$NAME text, | ||
${NAME}title3 text, | ||
${ANOTHER_VAR:-default}title4 text, | ||
${SET_BUT_EMPTY_VALUE-default}title5 text, | ||
); |
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,9 @@ | ||
-- +goose Up | ||
CREATE TABLE post ( | ||
id int NOT NULL, | ||
title text, | ||
$NAME text, | ||
${NAME}title3 text, | ||
${ANOTHER_VAR:-default}title4 text, | ||
${SET_BUT_EMPTY_VALUE-default}title5 text, | ||
); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.