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

Function GetQuerySpan

backend/plugin/parser/tsql/query_span.go:16–25  ·  view source on GitHub ↗

GetQuerySpan returns the query span for the given statement. Runs on the omni AST extractor.

(
	ctx context.Context,
	gCtx base.GetQuerySpanContext,
	stmt base.Statement,
	database, schema string,
	ignoreCaseSensitive bool,
)

Source from the content-addressed store, hash-verified

14// GetQuerySpan returns the query span for the given statement.
15// Runs on the omni AST extractor.
16func GetQuerySpan(
17 ctx context.Context,
18 gCtx base.GetQuerySpanContext,
19 stmt base.Statement,
20 database, schema string,
21 ignoreCaseSensitive bool,
22) (*base.QuerySpan, error) {
23 q := newOmniQuerySpanExtractor(database, schema, gCtx, ignoreCaseSensitive)
24 return q.getOmniQuerySpan(ctx, stmt.Text)
25}

Callers 5

getViewDependenciesFunction · 0.92
TestGetQuerySpanFunction · 0.70

Calls 2

getOmniQuerySpanMethod · 0.45

Tested by 2

TestGetQuerySpanFunction · 0.56