Versions in this module Expand all Collapse all v1 v1.7.1 Feb 22, 2024 v1.2.0 Feb 22, 2024 Changes in this version + var ErrQueryArgTODO = errors.New("TODO: support this type") + var ErrQueryArgUnsafe = errors.New("potentially unsafe query string") + var ErrQueryArgUnsupportedType = errors.New("unexpected query arg type") + func AddQueryParam(target *[]QueryParam, param QueryParam) + func AddQueryParams(target *[]QueryParam, params []QueryParam) + func DebugQuery(q string) + type ColumnUsed struct + Column string + Location int32 + Table string + type MatchedSqlFunc struct + QueryArgPos int + SSA *ssa.Function + type ParseResult struct + Columns []ColumnUsed + Params []QueryParam + PostponedNodes *PostponedNodes + Tables []TableUsed + type PostponedNodes struct + RangeSubselectNodes []*pg_query.RangeSubselect + func (p *PostponedNodes) Append(other *PostponedNodes) + func (p *PostponedNodes) Parse(ctx VetContext, parseRe *ParseResult) (err error) + type QueryParam struct + Number int32 + func ValidateSqlQuery(ctx VetContext, queryStr string) ([]QueryParam, error) + type QuerySite struct + Called string + Err error + ParameterArgCount int + Position token.Position + Query string + func CheckDir(ctx VetContext, dir, buildFlags string, extraMatchers []SqlFuncMatcher) ([]*QuerySite, error) + type Schema struct + Tables map[string]schema.Table + type SqlFuncMatchRule struct + FuncName string + QueryArgName string + QueryArgPos int + type SqlFuncMatcher struct + PkgPath string + Rules []SqlFuncMatchRule + func (s *SqlFuncMatcher) IterPackageExportedFuncs(cb func(*types.Func)) + func (s *SqlFuncMatcher) MatchSqlFuncs(prog *ssa.Program) []MatchedSqlFunc + func (s *SqlFuncMatcher) PackageImported() bool + func (s *SqlFuncMatcher) SetGoPackage(p *packages.Package) + type SqlVetAnnotation struct + Ignore bool + func ParseComment(comment string) (SqlVetAnnotation, error) + type TableUsed struct + Alias string + Name string + type VetContext struct + InnerSchema Schema + Schema Schema + UsedTables []TableUsed + func NewContext(tables map[string]schema.Table) VetContext