query

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name   string
	Getter func(interface{}) (value interface{}, isNull bool)
}

type Fn added in v0.3.1

type Fn = func([]interface{}) interface{}

type Processor

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

func NewProcessor

func NewProcessor(db Queryable) Processor

func (*Processor) Build

func (p *Processor) Build(query string) (*Query, error)

func (*Processor) RegisterFn added in v0.3.1

func (p *Processor) RegisterFn(name string, arity int, fn Fn)

type Query

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

func (Query) Run

func (q Query) Run() []interface{}

func (Query) RunWithLimit added in v0.3.0

func (q Query) RunWithLimit(n int) []interface{}

func (Query) Stream added in v0.2.0

func (q Query) Stream(f StreamFunc)

type Queryable

type Queryable interface {
	Fields() []Field
	Iter() iter.Iter
}

type StreamFunc added in v0.2.0

type StreamFunc = func(interface{}) bool

Directories

Path Synopsis
Package iter implements an iterator interface as used by query.
Package iter implements an iterator interface as used by query.

Jump to

Keyboard shortcuts

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