Documentation ¶
Index ¶
- func CheckIfTargetFunction(_ context.Context, call *ssa.CallCommon, opt *Option) (ssa.Value, bool)
- func Walk(cg *CallGraph, in *Node, fn func(node *Node) bool)
- type AnalyzeMode
- type CallGraph
- type Edge
- type FilterExpr
- type Node
- type NodeWithPackage
- type Option
- type QueryResult
- type QueryResults
- func Analyze(ctx context.Context, dir, pattern string, opt *Option) (QueryResults, map[string]*CallGraph, error)
- func AnalyzeFunc(ctx context.Context, fn *ssa.Function, opt *Option) QueryResults
- func ExtractQuery(ctx context.Context, ssaProg *buildssa.SSA, files []*ast.File, opt *Option) (QueryResults, error)
- type SqlValue
- type TargetCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfTargetFunction ¶
Types ¶
type AnalyzeMode ¶
type AnalyzeMode int
type CallGraph ¶
func BuildCallGraph ¶
func BuildCallGraph(pkg *ssa.Package, qrs []*QueryResult) (*CallGraph, error)
func (*CallGraph) AddFuncCallEdge ¶
type Edge ¶
func (*Edge) IsFuncCall ¶
type FilterExpr ¶ added in v1.1.0
type FilterExpr struct {
// contains filtered or unexported fields
}
func NewFilterExpr ¶ added in v1.1.0
func NewFilterExpr(code string) (*FilterExpr, error)
type Node ¶
func TopologicalSort ¶
type Option ¶
type Option struct { Code string AdditionalFuncs []string // contains filtered or unexported fields }
func (*Option) AdditionalFuncSlice ¶
func (o *Option) AdditionalFuncSlice() []TargetCall
type QueryResult ¶
type QueryResult struct { *sql.QueryGroup Posx *ssautil.Posx FromComment bool }
func NewQueryResult ¶
func NewQueryResult(pos *ssautil.Posx) *QueryResult
func (*QueryResult) Append ¶
func (qr *QueryResult) Append(qs ...*sql.Query)
func (*QueryResult) Compare ¶
func (qr *QueryResult) Compare(other *QueryResult) int
type QueryResults ¶
type QueryResults []*QueryResult
func AnalyzeFunc ¶
func ExtractQuery ¶
func ExtractQuery(ctx context.Context, ssaProg *buildssa.SSA, files []*ast.File, opt *Option) (QueryResults, error)
ExtractQuery extracts queries from the given package.
func (QueryResults) AllTableNames ¶
func (qrs QueryResults) AllTableNames() []string
func (QueryResults) AllTables ¶
func (qrs QueryResults) AllTables() []*sql.Table
type TargetCall ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.