sqlguard

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(sql string) (string, error)

func NormalizedHash

func NormalizedHash(sql string) (string, error)

func RequiresConfirmation

func RequiresConfirmation(statement Statement) bool

Types

type Statement

type Statement struct {
	Class                 StatementClass
	Kind                  string
	TargetSchemas         []string
	HasUnqualifiedTargets bool
	HasBroadMutation      bool
	Reason                string
}

func ParseAndClassify

func ParseAndClassify(sql string) (Statement, error)

type StatementClass

type StatementClass string
const (
	StatementClassReadOnly          StatementClass = "read_only"
	StatementClassMutating          StatementClass = "mutating"
	StatementClassAdministrative    StatementClass = "administrative"
	StatementClassDestructive       StatementClass = "destructive"
	StatementClassPrivilegeChanging StatementClass = "privilege_changing"
	StatementClassSessionChanging   StatementClass = "session_changing"
	StatementClassUnsupported       StatementClass = "unsupported"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL