Documentation
¶
Overview ¶
Package mysql provides a MySQL dialect parser using vitess/sqlparser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseViewSQL ¶
ParseViewSQL parses a CREATE VIEW statement using vitess/sqlparser and extracts the view name, SELECT column metadata, and FROM clause table aliases.
func QualifyFilterIdentifiers ¶
QualifyFilterIdentifiers rewrites every bare column reference inside expr to be qualified with alias. Already-qualified refs (table.column) are left untouched. The expression is parsed as a MySQL WHERE clause and re-emitted via vitess/sqlparser, so backtick-quoted identifiers, dialect operators (e.g. `:=`), CAST/CASE/function-call expressions, and string-literal contents are all handled by the upstream parser.
It performs the codegen-time qualification of sub-categorized o2o `filter:` predicates.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser implements the parser.Parser interface for MySQL DDL. It uses vitess/sqlparser (pure Go) to parse MySQL SQL statements.
func (*Parser) Parse ¶
Parse parses MySQL DDL from sql. It can be called multiple times with different files; results accumulate.