Documentation
¶
Overview ¶
Package mysql provides direct lineage analysis for MySQL queries.
This implementation is built on github.com/bytebase/omni's MySQL parser and typed AST. It replaces the legacy ANTLR implementation, which was parity-verified against it over the golden corpus and then removed.
Known gaps and their intended resolution are tracked in .agents/docs/lineage-semantics.md; defects in omni itself are recorded in .agents/docs/omni-upstream-defects.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Registration ¶
func Registration() lineage.EngineRegistration
Registration binds MySQL to the analyzer this package provides. The process assembles the registered engines where it is built, so this package does not register itself into package state.
MariaDB and TiDB live in their own packages and provide their own analyzers. OceanBase is deliberately unsupported: the runner records a per-object skip for it.
func SplitStatements ¶
SplitStatements splits a script into its individual statements, dropping the ones that carry no SQL. The caller feeds them to Analyze one at a time: this analyzer is defined for exactly one statement.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer performs direct lineage analysis on MySQL queries.
func NewAnalyzer ¶
NewAnalyzer creates a new MySQL lineage analyzer.
func (*Analyzer) AnalyzeRelations ¶
func (a *Analyzer) AnalyzeRelations() ([]model.ColumnRelation, error)
AnalyzeRelations parses the SQL and returns column relations.
Parsing is strict: a statement omni cannot parse is an error, never a partial result. Multi-statement input is rejected because the analyzer is defined for exactly one statement; the caller splits a script and analyzes it statement by statement. A statement shape the analyzer cannot represent is reported as a gap beside the edges it found, never as a silent empty result.