Skip to content

Commit

Permalink
Add dataset_access_type join to datasets api
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Dec 6, 2020
1 parent f97738f commit 60a05d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbs/datasets.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ func (API) Datasets(params Record) []Record {
if isValid == "" {
isValid = "1"
}
// parse dataset_id argument
dataset_access_type := getSingleValue(params, "dataset_access_type")
if dataset_access_type == "" {
dataset_access_type = "VALID"
}
where += fmt.Sprintf("D.IS_DATASET_VALID = %s", placeholder("is_dataset_valid"))
where += fmt.Sprintf("AND DP.DATASET_ACCESS_TYPE = %s", placeholder("dataset_access_type"))
args = append(args, isValid)

// parse dataset argument
Expand Down
1 change: 1 addition & 0 deletions static/sql/datasets_short.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SELECT
D.DATASET
FROM {{.Owner}}.DATASETS D
JOIN {{.Owner}}.DATASET_ACCESS_TYPES DP on DP.DATASET_ACCESS_TYPE_ID= D.DATASET_ACCESS_TYPE_ID

0 comments on commit 60a05d7

Please sign in to comment.