MCPcopy
hub / github.com/dosco/graphjin / codeSQLSelectedTableRefs

Function codeSQLSelectedTableRefs

core/cache_fragment.go:149–167  ·  view source on GitHub ↗
(dbName string, qc *qcode.QCode)

Source from the content-addressed store, hash-verified

147}
148
149func codeSQLSelectedTableRefs(dbName string, qc *qcode.QCode) []RowRef {
150 if qc == nil {
151 return nil
152 }
153 refs := make([]RowRef, 0, len(qc.Selects))
154 for i := range qc.Selects {
155 sel := &qc.Selects[i]
156 if sel.Table == "" || sel.SkipRender == qcode.SkipTypeRemote {
157 continue
158 }
159 refs = append(refs, RowRef{
160 Source: CacheSourceCodeSQL,
161 Scope: dbName,
162 Kind: CacheKindTable,
163 Table: sel.Table,
164 })
165 }
166 return refs
167}
168
169func appendUniqueCacheRefs(refs []RowRef, more ...RowRef) []RowRef {
170 if len(more) == 0 {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected