Versions in this module Expand all Collapse all v0 v0.20.0 Mar 9, 2026 Changes in this version + var ErrDangerousSQL = errors.New("dangerous sql detected") + var ErrSQLParseFailed = errors.New("failed to parse sql") + func IsWhitelisted(ctx context.Context) bool + func WithWhitelist(ctx context.Context) context.Context + type Config struct + Enabled bool + func DefaultConfig() *Config + type DeleteWithoutWhereRule struct + func (*DeleteWithoutWhereRule) Name() string + func (r *DeleteWithoutWhereRule) Check(astNode *ast.AST) *Violation + type DropStatementRule struct + func (*DropStatementRule) Name() string + func (r *DropStatementRule) Check(astNode *ast.AST) *Violation + type Guard struct + func NewGuard(logger log.Logger, rules ...Rule) *Guard + func (g *Guard) Check(sql string) error + type GuardError struct + Err error + SQL string + Violation *Violation + func (e *GuardError) Error() string + func (e *GuardError) Unwrap() error + type Rule interface + Check func(astNode *ast.AST) *Violation + Name func() string + func DefaultRules() []Rule + type TruncateStatementRule struct + func (*TruncateStatementRule) Name() string + func (r *TruncateStatementRule) Check(astNode *ast.AST) *Violation + type Violation struct + Description string + Rule string + Statement string