tql

package module
v0.0.0-...-bf2ba7a Latest Latest
Warning

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

Go to latest
Published: May 11, 2014 License: MIT Imports: 5 Imported by: 0

README

tql

Tql, Simple SQL-Like query language

Documentation

Index

Constants

View Source
const (
	ValString = iota
	ValInt
	ValFloat
	ValQuoteString
	ValBool
	ValNull
	ValReference
	ValList
)

Variables

View Source
var ErrFieldNotExists = errors.New("field not exists")
View Source
var ErrNotImplement = errors.New("feature not implement yet")
View Source
var ErrTypeNotMatch = errors.New("type not match")
View Source
var ErrUnknown = errors.New("unknown error")

Functions

This section is empty.

Types

type Cond

type Cond struct {
	Identifier string
	Op         string
	Value      Val
}

func (*Cond) Match

func (c *Cond) Match(r map[string]interface{}) (bool, error)

type Row

type Row map[string]interface{}

type Tql

type Tql struct {

	// export
	Props   []string
	From    string
	Conds   []Cond
	Limit   int64
	Offset  int64
	OrderBy string
	Order   int
	// contains filtered or unexported fields
}

func NewTql

func NewTql(query string) *Tql

func (*Tql) Match

func (t *Tql) Match(v Row) (bool, error)

type Val

type Val struct {
	ValType int
	V       interface{}
}

func (Val) EQ

func (v Val) EQ(v1 interface{}) (bool, error)

func (Val) GT

func (v Val) GT(v1 interface{}) (bool, error)

func (Val) GTE

func (v Val) GTE(v1 interface{}) (bool, error)

func (Val) LT

func (v Val) LT(v1 interface{}) (bool, error)

func (Val) LTE

func (v Val) LTE(v1 interface{}) (bool, error)

func (Val) NOTEQ

func (v Val) NOTEQ(v1 interface{}) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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