-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
klarysz
committed
Jul 25, 2023
1 parent
6e5caa5
commit be8f5ad
Showing
24 changed files
with
260 additions
and
101 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
This file was deleted.
Oops, something went wrong.
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
15 changes: 15 additions & 0 deletions
15
e2e/local/regression/cases/063_external_parameters/custom_predicate.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,15 @@ | ||
/* { | ||
"URI":"vendors-custom-predicate", | ||
"Method": "GET", | ||
"Include": ["./parameters.sql"] | ||
} */ | ||
|
||
|
||
SELECT vendor.* | ||
FROM (SELECT * | ||
FROM VENDOR t | ||
WHERE 1 = 1 ${predicate.Builder().CombineOr( | ||
$predicate.Ctx(0, "AND"), | ||
$predicate.Ctx(1, "OR" ) | ||
).Build("AND")} | ||
) vendor |
6 changes: 6 additions & 0 deletions
6
e2e/local/regression/cases/063_external_parameters/expect.json
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 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "Vendor 1" | ||
} | ||
] |
1 change: 1 addition & 0 deletions
1
e2e/local/regression/cases/063_external_parameters/expect2.json
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 @@ | ||
[] |
7 changes: 7 additions & 0 deletions
7
e2e/local/regression/cases/063_external_parameters/expect3.json
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,7 @@ | ||
[ | ||
{ | ||
"id": 2, | ||
"name": "Vendor 2", | ||
"userUpdated": 0 | ||
} | ||
] |
17 changes: 17 additions & 0 deletions
17
e2e/local/regression/cases/063_external_parameters/expect4.json
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 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "Vendor 1", | ||
"accountId": 100 | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Vendor 2", | ||
"accountId": 101 | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "Vendor 3", | ||
"accountId": 100 | ||
} | ||
] |
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 @@ | ||
{ | ||
"Name": "$tagId", | ||
"URL": "$path/custom_predicate.sql", | ||
"Args": "" | ||
} |
4 changes: 4 additions & 0 deletions
4
e2e/local/regression/cases/063_external_parameters/parameters.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,4 @@ | ||
#set($_ = $ID<int>(query/ID).WithPredicate(0, "equal", "t", "ID").Optional()) | ||
#set($_ = $UserCreated<int>(query/UserCreated).WithPredicate(0, "equal", "t", "USER_CREATED").Optional()) | ||
#set($_ = $Name<string>(query/Name).WithPredicate(1, "equal", "t", "NAME").Optional()) | ||
#set($_ = $AccountID<int>(query/AccountID).WithPredicate(1, "equal", "t", "ACCOUNT_ID").Optional()) |
31 changes: 31 additions & 0 deletions
31
e2e/local/regression/cases/063_external_parameters/test.yaml
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,31 @@ | ||
init: | ||
parentPath: $parent.path | ||
pipeline: | ||
|
||
test: | ||
action: http/runner:send | ||
requests: | ||
- Method: GET | ||
URL: http://127.0.0.1:8080/v1/api/dev/vendors-custom-predicate?ID=1 | ||
Expect: | ||
Code: 200 | ||
JSONBody: $LoadJSON('${parentPath}/expect.json') | ||
|
||
- Method: GET | ||
URL: http://127.0.0.1:8080/v1/api/dev/vendors-custom-predicate?ID=1&UserCreated=19273 | ||
Expect: | ||
Code: 200 | ||
JSONBody: $LoadJSON('${parentPath}/expect2.json') | ||
|
||
|
||
- Method: GET | ||
URL: http://127.0.0.1:8080/v1/api/dev/vendors-custom-predicate?ID=1&UserCreated=19273&Name=Vendor%202 | ||
Expect: | ||
Code: 200 | ||
JSONBody: $LoadJSON('${parentPath}/expect3.json') | ||
|
||
- Method: GET | ||
URL: http://127.0.0.1:8080/v1/api/dev/vendors-custom-predicate?ID=1&UserCreated=19273&Name=Vendor%202&AccountID=100 | ||
Expect: | ||
Code: 200 | ||
JSONBody: $LoadJSON('${parentPath}/expect4.json') |
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
Oops, something went wrong.