query_util.go ×7

Frontier kind: Code frontier

unlabeled · c_f458507bd0c1

2247 tests · 1935 LOC · 85 files · introduces 0 tests · 13 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges13 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
288 ranges1935 lines · 85 files · Browse complete extent
All tests (intent)
2247 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 13 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/query_util.go 13 introduced LOC · 7 ranges

Open complete file

121 case sqlBeginKeyword[0]:
122 if hasWordAt(contentStr, sqlBeginKeyword, j) {
123 > st = append(st, sqlBeginKeyword[0]) query_util.go
124 > j += len(sqlBeginKeyword) - 1
125 > }
126
127 case sqlEndKeyword[0]:
129 continue
130 }
131 > if ok, after := hasWordAfter(contentStr, sqlIfKeyword, j+len(sqlEndKeyword)); ok { query_util.go
132 if len(st) == 0 || st[len(st)-1] != sqlIfKeyword[0] {
133 return nil, errors.New("error reading contents: unmatched `END IF` keyword")
135 st = st[:len(st)-1]
136 j = after + len(sqlIfKeyword) - 1
137 > } else if ok, after := hasWordAfter(contentStr, sqlLoopKeyword, j+len(sqlEndKeyword)); ok { query_util.go
138 //nolint:revive
139 if len(st) == 0 || st[len(st)-1] != sqlLoopKeyword[0] {
142 st = st[:len(st)-1]
143 j = after + len(sqlLoopKeyword) - 1
144 > } else { query_util.go
145 > if len(st) == 0 || st[len(st)-1] != sqlBeginKeyword[0] {
146 return nil, errors.New("error reading contents: unmatched `END` keyword")
147 }
148 > st = st[:len(st)-1] query_util.go
149 > j += len(sqlEndKeyword) - 1
150 }
151
214 // hasWordAfter checks if the given word appears after position pos in s,
215 // separated by at least one space, and is a whole word.
216 > func hasWordAfter(s, word string, pos int) (bool, int) { query_util.go
217 > after := pos
218 > for after < len(s) && unicode.IsSpace(rune(s[after])) {
219 after++
220 }
221 > if after == pos { query_util.go
222 return false, after
223 }