advisor

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package advisor analyzes a SQLite database for performance problems that hurt in production — especially the ones AI-generated schemas ship by default: foreign keys with no index (a full scan on every join), redundant indexes, and, when queries are supplied, full table scans via EXPLAIN QUERY PLAN.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	Rule       string `json:"rule"`     // fk-no-index | redundant-index | full-scan
	Severity   string `json:"severity"` // warning | info
	Table      string `json:"table,omitempty"`
	Detail     string `json:"detail"`
	Suggestion string `json:"suggestion,omitempty"` // runnable SQL or guidance
}

Finding is one performance issue with a concrete suggestion.

type Report

type Report struct {
	Path     string    `json:"path"`
	Findings []Finding `json:"findings"`
}

Report is the advisor's output for one database.

func Analyze

func Analyze(path string, queries []string) (*Report, error)

Analyze inspects the schema for index problems and, for any supplied queries, flags full table scans. queries may be nil.

Jump to

Keyboard shortcuts

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