MCPcopy Index your code
hub / github.com/bytebase/bytebase / oracleNodeLoc

Function oracleNodeLoc

backend/plugin/parser/plsql/backup.go:354–375  ·  view source on GitHub ↗
(node oracleast.Node)

Source from the content-addressed store, hash-verified

352}
353
354func oracleNodeLoc(node oracleast.Node) (oracleast.Loc, bool) {
355 if node == nil {
356 return oracleast.Loc{}, false
357 }
358 value := reflect.ValueOf(node)
359 if value.Kind() != reflect.Pointer || value.IsNil() {
360 return oracleast.Loc{}, false
361 }
362 elem := value.Elem()
363 if elem.Kind() != reflect.Struct {
364 return oracleast.Loc{}, false
365 }
366 field := elem.FieldByName("Loc")
367 if !field.IsValid() || field.Type() != reflect.TypeOf(oracleast.Loc{}) {
368 return oracleast.Loc{}, false
369 }
370 loc, ok := field.Interface().(oracleast.Loc)
371 if !ok || loc.End <= loc.Start {
372 return oracleast.Loc{}, false
373 }
374 return loc, true
375}
376
377func oracleLocText(sql string, start, end int) string {
378 if start < 0 {

Callers 2

oracleListTextFunction · 0.85
oracleWhereSuffixFunction · 0.85

Calls 1

TypeMethod · 0.45

Tested by

no test coverage detected