analysisreport

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package analysisreport assembles reports from engine-owned computation facts.

Index

Constants

View Source
const MaxDetailReportBytes = 2 << 20

MaxDetailReportBytes bounds serialized observation detail. Caller SQL and core issues/advice cannot be discarded to meet a budget; overflow is explicit.

Variables

This section is empty.

Functions

func ApplyDetailBudget

func ApplyDetailBudget(r *analysis.AnalyzeResult, catalog *sqli18n.Catalog)

ApplyDetailBudget sheds optional detail without changing analysis decisions. Referenced identities and minimal candidate definitions are never removed.

func Build

Build projects existing engine facts. Missing instrumentation is declared, never inferred from the absence of issues or selected recommendations.

func CanonicalSuggestions

func CanonicalSuggestions(issueID string, suggestions []*analysisinput.Suggestion) []*analysisinput.Suggestion

CanonicalSuggestions selects the same deterministic representatives used by Build, allowing dialect adapters to retain matching legacy guidance without reintroducing duplicates. Neither suggestions nor their payloads are mutated.

func Decision

func Decision(id, kind, stage, outcome, code string, msg analysis.Message) analysis.DecisionRecord

Decision builds a uniquely scoped final or intermediate decision.

func Finalize

func Finalize(r *analysis.AnalyzeResult, observed ...map[string]int)

Finalize derives counts from observed business facts and normalizes ordering.

func FromRef

func FromRef(catalog *sqli18n.Catalog, lang string, ref *analysis.MessageRef, fallbackID, english string) analysis.Message

FromRef copies message arguments without redacting engine-provided values.

func IssueID

func IssueID(i *analysisinput.Issue) string

IssueID deliberately excludes localized strings and process-scoped IDs.

func Message

func Message(catalog *sqli18n.Catalog, lang, id, english string, args map[string]any) analysis.Message

Message renders a controlled template reference with an English fallback.

func New

New initializes one report without constructing intermediate engine results.

func Notice

func Notice(catalog *sqli18n.Catalog, lang, code, english string) analysis.Notice

Notice creates a stable, localizable gap without exposing raw engine errors.

func ProjectProposalBenefits

func ProjectProposalBenefits(r *analysis.AnalyzeResult, catalog *sqli18n.Catalog, selectedEvaluationID string, canPublish func(*analysis.EvaluationReport) bool)

ProjectProposalBenefits groups only recorded exact scenarios, then copies comparisons. It never searches for combinations or executes an estimator or database operation. canPublish optionally limits benefit attribution without discarding a comparison.

func ProjectRewrites

func ProjectRewrites(r *analysis.AnalyzeResult, report *analysis.LogicalRewriteReport, executable bool, catalog *sqli18n.Catalog)

ProjectRewrites projects actionable rewrite attempts as candidates and keeps no-op attempts in diagnostics when detailed recording was requested.

func Proposal

func Proposal(c analysis.CandidateReport, score int, title analysis.Message, reason *analysis.Message, lang string, catalog *sqli18n.Catalog) analysis.Recommendation

Proposal projects recorded candidate facts without approving new SQL or evaluating costs.

func RecordComparison

func RecordComparison(e *analysis.EvaluationReport)

RecordComparison freezes display metrics once from the recorded paired estimates. Cost percentages come from the engine comparator; reporting does not bypass its guards.

func Render

func Render(catalog *sqli18n.Catalog, lang string, ref analysis.MessageRef) string

Render renders a persisted message without executing analysis.

func ScenarioIndexProposal

func ScenarioIndexProposal(r *analysis.AnalyzeResult, e *analysis.EvaluationReport, actions []analysis.ActionDefinition,
	issueIDs, rules []string, score int, title, reason analysis.Message, catalog *sqli18n.Catalog) analysis.Recommendation

ScenarioIndexProposal builds one advisory proposal from the exact index actions and provenance of a comparable physical-design scenario.

func SuggestionCandidateID

func SuggestionCandidateID(issueID string, s *analysisinput.Suggestion) string

SuggestionCandidateID returns the legacy identity of one producer suggestion. Use SuggestionCandidateIDs when projecting a complete Issue's suggestions so distinct payloads sharing this legacy identity can be disambiguated.

func SuggestionCandidateIDs

func SuggestionCandidateIDs(issueID string, suggestions []*analysisinput.Suggestion) map[*analysisinput.Suggestion]string

SuggestionCandidateIDs preserves unambiguous legacy identities and separates conflicting payloads deterministically. Message references use their ID and arguments, never their localized rendering. Text is a last-resort identity only when otherwise indistinguishable suggestions have no message reference.

func UncollectedTable

func UncollectedTable(engine analysis.Engine, schema, name string) analysis.TableSnapshot

UncollectedTable is identity-only; it never claims an empty physical catalog.

func Validate

func Validate(r *analysis.AnalyzeResult) error

Validate turns programming errors in report assembly into explicit errors.

func WhatIfEvaluationID

func WhatIfEvaluationID(reportIdentity, alternativeID, analysisIdentity string) string

WhatIfEvaluationID identifies a recorded alternative in the public report.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL