sql

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(str string) string

Types

type Cacheability

type Cacheability int
const (
	Static Cacheability = iota
	Immutable
	Mutable
	UnknownCacheability
)

func (Cacheability) Color

func (c Cacheability) Color(str string) string

func (Cacheability) ColoredString

func (c Cacheability) ColoredString() string

func (Cacheability) String

func (c Cacheability) String() string

type JoinFlatter

type JoinFlatter struct {
	// contains filtered or unexported fields
}

func (*JoinFlatter) Enter

func (v *JoinFlatter) Enter(in ast.Node) (ast.Node, bool)

func (*JoinFlatter) Leave

func (v *JoinFlatter) Leave(in ast.Node) (ast.Node, bool)

type Query

type Query struct {
	Kind            QueryKind
	Raw             string
	MainTable       string
	Tables          []string
	FilterColumnMap map[string]mapset.Set[string]
}

func ParseString

func ParseString(str string) (*Query, bool)

func (*Query) Hash

func (q *Query) Hash() string

func (*Query) String

func (q *Query) String() string

type QueryGroup

type QueryGroup struct {
	List mapset.Set[*Query]
}

func NewQueryGroup

func NewQueryGroup() *QueryGroup

func NewQueryGroupFrom

func NewQueryGroupFrom(queries ...*Query) *QueryGroup

func (*QueryGroup) Queries

func (qg *QueryGroup) Queries() []*Query

type QueryGroups

type QueryGroups []*QueryGroup

func (QueryGroups) AllTableMap

func (qgs QueryGroups) AllTableMap() map[string]*Table

type QueryKind

type QueryKind int
const (
	Unknown QueryKind = iota
	Select
	Insert
	Delete
	Replace
	Update
)

func (QueryKind) CRUD

func (k QueryKind) CRUD() string

func (QueryKind) Color

func (k QueryKind) Color(format string, a ...interface{}) string

func (QueryKind) ColorAttribute

func (k QueryKind) ColorAttribute() color.Attribute

func (QueryKind) ColoredString

func (k QueryKind) ColoredString() string

func (QueryKind) String

func (k QueryKind) String() string

type Table

type Table struct {
	Name string
	// contains filtered or unexported fields
}

func NewTable

func NewTable(name string) *Table

func (*Table) Cacheability

func (t *Table) Cacheability() Cacheability

func (*Table) Kinds

func (t *Table) Kinds() []QueryKind

func (*Table) MaxKind

func (t *Table) MaxKind() QueryKind

func (*Table) PartitionKeys

func (t *Table) PartitionKeys() []string

func (*Table) String

func (t *Table) String() string

Jump to

Keyboard shortcuts

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