Skip to content

Commit

Permalink
Fix child look-up
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jun 2, 2024
1 parent 9ad6aa8 commit 0df69dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dbs/children.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ func (a *API) GetChild() error {
if err != nil {
return Error(err, LoadErrorCode, "", "dbs.children.GetChild")
}
if val, ok := a.Params["did"]; ok {
if val != "" {
conds, args = AddParam("did", "PDS.did", a.Params, conds, args)
}
}

stm = WhereClause(stm, conds)

Expand Down
6 changes: 6 additions & 0 deletions static/sql/select_child.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
D.did CHILD_DID,
PDS.did
FROM DATASETS D
LEFT OUTER JOIN PARENTS DSP ON DSP.DATASET_ID = D.DATASET_ID
LEFT OUTER JOIN DATASETS PDS ON PDS.DATASET_ID = DSP.PARENT_ID

0 comments on commit 0df69dc

Please sign in to comment.