Documentation ¶
Index ¶
- func ExtractAliased(parsed ast.TokenList) []ast.Node
- func ExtractAliasedIdentifer(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
- type NodeWalker
- func (nw *NodeWalker) CurNodeButtomMatched(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
- type SubQueryInfo
- type SubQueryView
- type SyntaxPosition
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractIdenfiers ¶
Types ¶
type Insert ¶
type Insert struct { Tables []*TableInfo Columns []*ast.IdentiferList Values []*ast.IdentiferList }
func (*Insert) GetColumns ¶
func (i *Insert) GetColumns() *ast.IdentiferList
func (*Insert) GetValues ¶
func (i *Insert) GetValues() *ast.IdentiferList
type NodeWalker ¶
type NodeWalker struct { Paths []*astutil.NodeReader Index int }
func NewNodeWalker ¶
func NewNodeWalker(root ast.TokenList, pos token.Pos) *NodeWalker
func (*NodeWalker) CurNodeButtomMatched ¶
func (nw *NodeWalker) CurNodeButtomMatched(matcher astutil.NodeMatcher) ast.Node
func (*NodeWalker) CurNodeDepth ¶
func (nw *NodeWalker) CurNodeDepth(matcher astutil.NodeMatcher) (int, bool)
func (*NodeWalker) CurNodeIs ¶
func (nw *NodeWalker) CurNodeIs(matcher astutil.NodeMatcher) bool
func (*NodeWalker) CurNodeMatches ¶
func (nw *NodeWalker) CurNodeMatches(matcher astutil.NodeMatcher) []ast.Node
func (*NodeWalker) CurNodeTopMatched ¶
func (nw *NodeWalker) CurNodeTopMatched(matcher astutil.NodeMatcher) ast.Node
func (*NodeWalker) CurNodes ¶
func (nw *NodeWalker) CurNodes() []ast.Node
func (*NodeWalker) PrevNodesIs ¶
func (nw *NodeWalker) PrevNodesIs(ignoreWitespace bool, matcher astutil.NodeMatcher) bool
func (*NodeWalker) PrevNodesIsWithDepth ¶
func (nw *NodeWalker) PrevNodesIsWithDepth(ignoreWitespace bool, matcher astutil.NodeMatcher, depth int) bool
type SubQueryColumn ¶
type SubQueryColumn struct { ParentTable *TableInfo ParentName string ColumnName string AliasName string }
func (*SubQueryColumn) DisplayName ¶
func (sc *SubQueryColumn) DisplayName() string
type SubQueryInfo ¶
type SubQueryInfo struct { Name string Views []*SubQueryView }
func ExtractSubQueryViews ¶
type SubQueryView ¶
type SubQueryView struct {
SubQueryColumns []*SubQueryColumn
}
type SyntaxPosition ¶
type SyntaxPosition string
const ( ColName SyntaxPosition = "col_name" SelectExpr SyntaxPosition = "select_expr" AliasName SyntaxPosition = "alias_name" WhereCondition SyntaxPosition = "where_conditon" CaseValue SyntaxPosition = "case_value" TableReference SyntaxPosition = "table_reference" InsertColumn SyntaxPosition = "insert_column" InsertValue SyntaxPosition = "insert_value" JoinClause SyntaxPosition = "join_clause" JoinOn SyntaxPosition = "join_on" Unknown SyntaxPosition = "unknown" )
func CheckSyntaxPosition ¶
func CheckSyntaxPosition(nw *NodeWalker) SyntaxPosition
type TableInfo ¶
type TableInfo struct { DatabaseSchema string Name string Alias string SubQueryColumns []*SubQueryColumn }
func ExtractLastTable ¶
func ExtractPrevTables ¶
Click to show internal directories.
Click to hide internal directories.