parser

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented      = errors.New("not implemented")
	ErrRelationEmpty       = errors.New("relation cannot be empty")
	ErrInvalidTableMapping = errors.New("invalid table mapping")
)

Functions

This section is empty.

Types

type Column

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

func ParseColumn

func ParseColumn(tokens ...string) (Column, error)

func (Column) Table

func (c Column) Table() string

type Columns

type Columns []Column

func (Columns) ListNames

func (c Columns) ListNames() []string

type DeleteVec

type DeleteVec struct {
	Tbl    string
	Target []string
	Filter []string
}

func (*DeleteVec) Columns

func (s *DeleteVec) Columns() []string

type InsertVec

type InsertVec struct {
	Tbl    string
	Target []string
}

func (*InsertVec) Columns

func (s *InsertVec) Columns() []string

type SelectVec

type SelectVec struct {
	Tbl    string
	Target []string
	Filter []string
	Group  []string
	Sort   []string
}

func (*SelectVec) Columns

func (s *SelectVec) Columns() []string

type Tables

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

func NewTables added in v0.16.1

func NewTables(defaultSchema string) *Tables

func (*Tables) Finalize

func (t *Tables) Finalize() error

Finalize will check the collected tables and in case of only one table exists - creates a new Empty mapping.

func (*Tables) Get

func (t *Tables) Get(name string) (string, bool)

func (*Tables) GetAll

func (t *Tables) GetAll() ([]string, error)

func (*Tables) HasMapping added in v0.16.1

func (t *Tables) HasMapping(name string) bool

HasMapping returns true if a direct mapping exists for the given name (for testing).

func (*Tables) Len

func (t *Tables) Len() (int, error)

func (*Tables) Put

func (t *Tables) Put(catalog, schema, relation, alias string) (string, error)

func (*Tables) SetMapping added in v0.16.1

func (t *Tables) SetMapping(name, target string)

SetMapping sets a direct mapping for testing purposes.

type UpdateVec

type UpdateVec struct {
	Tbl    string
	Target []string
	Filter []string
}

func (*UpdateVec) Columns

func (s *UpdateVec) Columns() []string

type Vector

type Vector interface {
	// contains filtered or unexported methods
}

func Parse

func Parse(query string) ([]Vector, error)

Jump to

Keyboard shortcuts

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