Versions in this module Expand all Collapse all v1 v1.0.1 Nov 23, 2024 v1.0.0 Nov 23, 2024 Changes in this version + func ExtractAliased(parsed ast.TokenList) []ast.Node + func ExtractAliasedIdentifier(parsed ast.TokenList) []ast.Node + func ExtractIdenfiers(parsed ast.TokenList, pos token.Pos) ([]ast.Node, error) + func ExtractInsertColumns(parsed ast.TokenList) []ast.Node + func ExtractInsertValues(parsed ast.TokenList, pos token.Pos) []ast.Node + func ExtractSelectExpr(parsed ast.TokenList) []ast.Node + func ExtractTableFactor(parsed ast.TokenList) []ast.Node + func ExtractTableReference(parsed ast.TokenList) []ast.Node + func ExtractTableReferences(parsed ast.TokenList) []ast.Node + func ExtractWhereCondition(parsed ast.TokenList) []ast.Node + type Insert struct + Columns []*ast.IdentifierList + Tables []*TableInfo + Values []*ast.IdentifierList + func ExtractInsert(parsed ast.TokenList, pos token.Pos) (*Insert, error) + func (i *Insert) Enable() bool + func (i *Insert) GetColumns() *ast.IdentifierList + func (i *Insert) GetTable() *TableInfo + func (i *Insert) GetValues() *ast.IdentifierList + type NodeWalker struct + Index int + Paths []*astutil.NodeReader + func NewNodeWalker(root ast.TokenList, pos token.Pos) *NodeWalker + func (nw *NodeWalker) CurNodeBottomMatched(matcher astutil.NodeMatcher) ast.Node + func (nw *NodeWalker) CurNodeDepth(matcher astutil.NodeMatcher) (int, bool) + func (nw *NodeWalker) CurNodeIs(matcher astutil.NodeMatcher) bool + func (nw *NodeWalker) CurNodeMatches(matcher astutil.NodeMatcher) []ast.Node + func (nw *NodeWalker) CurNodeTopMatched(matcher astutil.NodeMatcher) ast.Node + func (nw *NodeWalker) CurNodes() []ast.Node + func (nw *NodeWalker) PrevNodes(ignoreWitespace bool) []ast.Node + func (nw *NodeWalker) PrevNodesIs(ignoreWitespace bool, matcher astutil.NodeMatcher) bool + func (nw *NodeWalker) PrevNodesIsWithDepth(ignoreWitespace bool, matcher astutil.NodeMatcher, depth int) bool + type SubQueryColumn struct + AliasName string + ColumnName string + ParentName string + ParentTable *TableInfo + func (sc *SubQueryColumn) DisplayName() string + type SubQueryInfo struct + Name string + Views []*SubQueryView + func ExtractSubQueryViews(parsed ast.TokenList, pos token.Pos) ([]*SubQueryInfo, error) + type SubQueryView struct + SubQueryColumns []*SubQueryColumn + type SyntaxPosition string + const AliasName + const CaseValue + const ColName + const InsertColumn + const InsertValue + const JoinClause + const JoinOn + const SelectExpr + const TableReference + const Unknown + const WhereCondition + func CheckSyntaxPosition(nw *NodeWalker) SyntaxPosition + type TableInfo struct + Alias string + DatabaseSchema string + Name string + SubQueryColumns []*SubQueryColumn + func ExtractLastTable(parsed ast.TokenList, pos token.Pos) (*TableInfo, error) + func ExtractPrevTables(parsed ast.TokenList, pos token.Pos) ([]*TableInfo, error) + func ExtractTable(parsed ast.TokenList, pos token.Pos) ([]*TableInfo, error)