walk

package
v0.0.0-...-13a6da0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllColsContained

func AllColsContained(set ReferredCols, cols []string) bool

Types

type AstWalker

type AstWalker struct {
	UnknownNodes []interface{}
	Fn           func(ctx interface{}, node interface{}) (stop bool)
}

func (*AstWalker) Walk

func (w *AstWalker) Walk(stmts parser.Statements, ctx interface{}) (ok bool, err error)

type ReferredCols

type ReferredCols map[string]int

func ColNamesInSelect

func ColNamesInSelect(sql string) (referredCols ReferredCols, err error)

ColNamesInSelect finds all referred variables in a Select Statement. (variables = sub-expressions, placeholders, indexed vars, etc.) Implementation limits:

  1. Table with AS is not normalized.
  2. Columns referred from outer query are not translated.

func (ReferredCols) ToList

func (rc ReferredCols) ToList() []string

Jump to

Keyboard shortcuts

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