Skip to content

Commit 70b581c

Browse files
committed
Add many,inneJoin,nonResult flags to meta info
1 parent 5cc51a7 commit 70b581c

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

soql/parser/postprocess/normalize.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,14 @@ func (ctx *normalizeQueryContext) normalizeQuery(
291291
}
292292

293293
ctx.viewGraph[q.From[i].ViewId] = SoqlViewGraphLeaf{
294+
Name: q.From[i].Name[len(q.From[i].Name)-1],
294295
ParentViewId: q.From[i].ParentViewId,
295296
QueryId: q.QueryId,
296297
Depth: objDepth,
297298
QueryDepth: queryDepth,
299+
Many: qPlace == soqlQueryPlace_Select && i == 0,
300+
InnerJoin: q.From[i].InnerJoin,
301+
NonResult: qPlace == soqlQueryPlace_ConditionalOperand,
298302
Object: &q.From[i],
299303
Query: q,
300304
}

soql/parser/types/types.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,16 @@ type SoqlForClause struct {
240240
}
241241

242242
type SoqlViewGraphLeaf struct {
243-
ParentViewId int `json:"parentViewId"` // View id of parent object on object graph
244-
QueryId int `json:"queryId"` // Query unique id
245-
Depth int `json:"depth"` // Depth on object graph
246-
QueryDepth int `json:"queryDepth"` // Query depth
247-
Object *SoqlObjectInfo `json:"-"` // Object
248-
Query *SoqlQuery `json:"-"` // Query
243+
Name string `json:"name"` // Name
244+
ParentViewId int `json:"parentViewId"` // View id of parent object on object graph
245+
QueryId int `json:"queryId"` // Query unique id
246+
Depth int `json:"depth"` // Depth on object graph
247+
QueryDepth int `json:"queryDepth"` // Query depth
248+
Many bool `json:"many,omitempty"` // True if it is one-to-many relationship (subquery)
249+
InnerJoin bool `json:"innerJoin,omitempty"` // Inner join to parent view id
250+
NonResult bool `json:"nonResult,omitempty"` // True if it is subquery on conditions (where | having clause)
251+
Object *SoqlObjectInfo `json:"-"` // Object
252+
Query *SoqlQuery `json:"-"` // Query
249253
}
250254

251255
type SoqlQueryGraphLeaf struct {

0 commit comments

Comments
 (0)