MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / mustAnalyze

Function mustAnalyze

pkg/advisor/optimizer_test.go:27–34  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Helper to run AnalyzeSQL and fail on error ---------------------------------------------------------------------------

(t *testing.T, opt *Optimizer, sql string)

Source from the content-addressed store, hash-verified

25// ---------------------------------------------------------------------------
26
27func mustAnalyze(t *testing.T, opt *Optimizer, sql string) *OptimizationResult {
28 t.Helper()
29 result, err := opt.AnalyzeSQL(sql)
30 if err != nil {
31 t.Fatalf("AnalyzeSQL(%q) returned unexpected error: %v", sql, err)
32 }
33 return result
34}
35
36func hasSuggestion(result *OptimizationResult, ruleID string) bool {
37 for _, s := range result.Suggestions {

Callers 7

TestSelectStarRuleFunction · 0.85
TestMissingWhereRuleFunction · 0.85
TestCartesianProductRuleFunction · 0.85
TestDistinctOveruseRuleFunction · 0.85
TestCleanQueriesFunction · 0.85
TestNewWithCustomRulesFunction · 0.85

Calls 3

AnalyzeSQLMethod · 0.80
HelperMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected