Versions in this module Expand all Collapse all v0 v0.11.0 Sep 9, 2026 Changes in this version + func Register(plugin Plugin) error + type BaseConsolidator struct + func NewBaseConsolidator(name string) *BaseConsolidator + type BasePlugin struct + func NewBasePlugin(name string, priority int) *BasePlugin + func (bp *BasePlugin) DetectAuthPattern(stmt *types.Statement) string + func (bp *BasePlugin) DetectPatterns(sql string) []Pattern + func (bp *BasePlugin) EnrichStatement(ctx context.Context, stmt *types.Statement) error + func (bp *BasePlugin) FixFunctionVolatility(ctx context.Context, functionSQL string) (string, error) + func (bp *BasePlugin) GetConflictingPlugins() []string + func (bp *BasePlugin) GetConsolidationRules() []ConsolidationRule + func (bp *BasePlugin) GetRequiredExtensions() []string + func (bp *BasePlugin) InjectCompatibilityLayer(ctx context.Context) string + func (bp *BasePlugin) Name() string + func (bp *BasePlugin) Priority() int + func (bp *BasePlugin) ShouldPreserve(stmt *types.Statement) bool + func (bp *BasePlugin) TransformSQL(ctx context.Context, sql string) (string, error) + func (bp *BasePlugin) ValidateSchema(ctx context.Context, db *sql.DB) error + type ConsolidationRule struct + AuthPattern types.AuthPatternType + CanMerge func([]*types.Statement) bool + Conflicts []string + Merge func([]*types.Statement) *types.Statement + Name string + ObjectType types.ObjectType + Priority int + type FunctionConsolidator struct + func NewFunctionConsolidator(name string) *FunctionConsolidator + func (fc *FunctionConsolidator) AllSameFunctionSignature(statements []*types.Statement) bool + type Location struct + EndColumn int + EndLine int + StartColumn int + StartLine int + type Pattern struct + Location Location + Metadata map[string]string + Name string + Severity PatternSeverity + Type PatternType + type PatternSeverity string + const SeverityCritical + const SeverityHigh + const SeverityLow + const SeverityMedium + type PatternType string + const PatternTypeAuth + const PatternTypeExtension + const PatternTypeFunction + const PatternTypeORM + const PatternTypePolicy + const PatternTypeSchema + const PatternTypeStorage + const PatternTypeTrigger + type Plugin interface + Detect func(migrations []*types.Migration) bool + DetectAuthPattern func(stmt *types.Statement) string + DetectPatterns func(sql string) []Pattern + EnrichStatement func(ctx context.Context, stmt *types.Statement) error + FixFunctionVolatility func(ctx context.Context, functionSQL string) (string, error) + GetConflictingPlugins func() []string + GetConsolidationRules func() []ConsolidationRule + GetRequiredExtensions func() []string + Initialize func(ctx context.Context, config any) error + InjectCompatibilityLayer func(ctx context.Context) string + Name func() string + Priority func() int + ShouldPreserve func(stmt *types.Statement) bool + TransformSQL func(ctx context.Context, sql string) (string, error) + ValidateSchema func(ctx context.Context, db *sql.DB) error + func ResolveConflicts(candidates []Plugin) []Plugin + type PolicyConsolidator struct + func NewPolicyConsolidator(name string) *PolicyConsolidator + func (pc *PolicyConsolidator) AllClausesIdentical(clauses []string) bool + func (pc *PolicyConsolidator) AllSameObjectName(statements []*types.Statement) bool + func (pc *PolicyConsolidator) AllSameObjectType(statements []*types.Statement, objectType types.ObjectType) bool + func (pc *PolicyConsolidator) AllSameTargetTable(statements []*types.Statement) bool + func (pc *PolicyConsolidator) ExtractPolicyClauses(statements []*types.Statement) ([]string, []string) + func (pc *PolicyConsolidator) HaveSamePolicyLogic(statements []*types.Statement) bool + type Registry struct + func GlobalRegistry() *Registry + func NewRegistry() *Registry + func (r *Registry) ActivePlugins() []Plugin + func (r *Registry) DiscoverAndInitialize(ctx context.Context, migrations []*types.Migration, config map[string]any) error + func (r *Registry) EnrichStatement(ctx context.Context, stmt *types.Statement) error + func (r *Registry) GetConsolidationRules() []ConsolidationRule + func (r *Registry) GetPlugin(name string) (Plugin, bool) + func (r *Registry) GetRequiredExtensions() []string + func (r *Registry) InjectCompatibilityLayer(ctx context.Context) string + func (r *Registry) IsActive(name string) bool + func (r *Registry) Register(plugin Plugin) error + func (r *Registry) Reset() + func (r *Registry) ShouldPreserve(stmt *types.Statement) bool + func (r *Registry) TransformSQL(ctx context.Context, sql string) (string, error) + func (r *Registry) ValidateSchema(ctx context.Context, db *sql.DB) error + type TableConsolidator struct + func NewTableConsolidator(name string) *TableConsolidator + func (tc *TableConsolidator) AllSameTable(statements []*types.Statement) bool + func (tc *TableConsolidator) ConservativeMerge(statements []*types.Statement) *types.Statement + func (tc *TableConsolidator) ContainsKeyword(statements []*types.Statement, keyword string) bool + func (tc *TableConsolidator) FilterByOperation(statements []*types.Statement, op types.Operation) []*types.Statement + func (tc *TableConsolidator) HasCreateOperation(statements []*types.Statement) bool