validator

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadQuery         = errors.New("bad query")
	ErrComplicatedQuery = errors.New("complicated query")
	ErrAccessDenied     = errors.New("access denied")
	ErrUnknownTable     = errors.New("unknown table")
	ErrUnknownColumn    = errors.New("unknown column")
)

Functions

func GetColumnNames

func GetColumnNames(req tree.NodeFormatter) ([]string, error)

GetColumnNames will return all mentioned columns from query. Note: It will have unexpected behavior for queries that have a subquery.

func IsAllowed

func IsAllowed(tables []config.TargetTable, acls []config.ACL, query string) error

func Walk

func Walk(collect ICollect, statements ...tree.NodeFormatter) error

Types

type ICollect added in v0.5.0

type ICollect func(tree.NodeFormatter)

func CollectAll added in v0.5.0

func CollectAll(funcs ...ICollect) ICollect

type TypeCollector added in v0.5.0

type TypeCollector[T tree.NodeFormatter] struct {
	// contains filtered or unexported fields
}

func CollectType added in v0.5.0

func CollectType[T tree.NodeFormatter]() *TypeCollector[T]

func (*TypeCollector[T]) Collect added in v0.5.0

func (c *TypeCollector[T]) Collect(node tree.NodeFormatter)

func (*TypeCollector[T]) Res added in v0.5.0

func (c *TypeCollector[T]) Res() []T

type Vec added in v0.5.0

type Vec struct {
	Op   config.Op
	Tbl  string
	Cols []string
}

func MakeSelectVec

func MakeSelectVec(req *tree.Select) (*Vec, error)

func (Vec) String added in v0.5.0

func (v Vec) String() string

Jump to

Keyboard shortcuts

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