ast

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnumReplacer

type EnumReplacer struct {
	// contains filtered or unexported fields
}

EnumReplacer provides AST-based ENUM type reference replacement. It replaces regex-based word boundary matching with accurate AST traversal.

func NewEnumReplacer

func NewEnumReplacer(replacements map[string]string) *EnumReplacer

NewEnumReplacer creates a new ENUM replacer with the given replacement map.

func (*EnumReplacer) GetReplacedCount

func (er *EnumReplacer) GetReplacedCount() int

GetReplacedCount returns the number of ENUM references replaced.

func (*EnumReplacer) ReplaceEnumReferences

func (er *EnumReplacer) ReplaceEnumReferences(sql string) (string, error)

ReplaceEnumReferences replaces ENUM type references in the given SQL using AST traversal. This is much more accurate than regex as it only replaces actual type references, not occurrences in strings, comments, or identifiers.

Jump to

Keyboard shortcuts

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