MCPcopy Create free account
hub / github.com/bytebase/bytebase / mustParseSelect

Function mustParseSelect

backend/plugin/parser/pg/query_span_loader_poc_test.go:548–559  ·  view source on GitHub ↗
(t *testing.T, sql string)

Source from the content-addressed store, hash-verified

546}
547
548func mustParseSelect(t *testing.T, sql string) *ast.SelectStmt {
549 t.Helper()
550 stmts, err := ParsePg(sql)
551 if err != nil {
552 t.Fatalf("parse %q: %v", sql, err)
553 }
554 sel, ok := stmts[0].AST.(*ast.SelectStmt)
555 if !ok {
556 t.Fatalf("expected SelectStmt, got %T", stmts[0].AST)
557 }
558 return sel
559}
560
561// ---------- Risk scenario 9: typeNameFromString with quoted/reserved identifier ----------
562

Calls 2

ParsePgFunction · 0.85
FatalfMethod · 0.80

Tested by

no test coverage detected