function

package
v0.14.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParseBlob is returned when the blob can't be parsed with bblfsh.
	ErrParseBlob = errors.NewKind("unable to parse the given blob using bblfsh: %s")
)
View Source
var Functions = sql.Functions{
	"is_tag":     sql.Function1(NewIsTag),
	"is_remote":  sql.Function1(NewIsRemote),
	"language":   sql.FunctionN(NewLanguage),
	"uast":       sql.FunctionN(NewUAST),
	"uast_xpath": sql.Function2(NewUASTXPath),
}

Functions for gitbase queries.

Functions

func NewIsRemote

func NewIsRemote(e sql.Expression) sql.Expression

NewIsRemote creates a new IsRemote function.

func NewIsTag

func NewIsTag(e sql.Expression) sql.Expression

NewIsTag creates a new IsTag function.

func NewLanguage added in v0.11.0

func NewLanguage(args ...sql.Expression) (sql.Expression, error)

NewLanguage creates a new Language UDF.

func NewUAST added in v0.11.0

func NewUAST(args ...sql.Expression) (sql.Expression, error)

NewUAST creates a new UAST UDF.

func NewUASTXPath added in v0.11.0

func NewUASTXPath(uast, xpath sql.Expression) sql.Expression

NewUASTXPath creates a new UASTXPath UDF.

Types

type IsRemote

type IsRemote struct {
	expression.UnaryExpression
}

IsRemote checks the given string is a remote reference.

func (*IsRemote) Eval

func (f *IsRemote) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the expression interface.

func (IsRemote) String

func (f IsRemote) String() string

func (IsRemote) TransformUp

func (f IsRemote) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Expression interface.

func (IsRemote) Type

func (IsRemote) Type() sql.Type

Type implements the Expression interface.

type IsTag

type IsTag struct {
	expression.UnaryExpression
}

IsTag checks the given string is a tag name.

func (*IsTag) Eval

func (f *IsTag) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the expression interface.

func (IsTag) String

func (f IsTag) String() string

func (IsTag) TransformUp

func (f IsTag) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Expression interface.

func (IsTag) Type

func (IsTag) Type() sql.Type

Type implements the Expression interface.

type Language added in v0.11.0

type Language struct {
	Left  sql.Expression
	Right sql.Expression
}

Language gets the language of a file given its path and the optional content of the file.

func (*Language) Children added in v0.11.0

func (f *Language) Children() []sql.Expression

Children implements the Expression interface.

func (*Language) Eval added in v0.11.0

func (f *Language) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (*Language) IsNullable added in v0.11.0

func (f *Language) IsNullable() bool

IsNullable implements the Expression interface.

func (*Language) Resolved added in v0.11.0

func (f *Language) Resolved() bool

Resolved implements the Expression interface.

func (*Language) String added in v0.11.0

func (f *Language) String() string

func (*Language) TransformUp added in v0.11.0

func (f *Language) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Expression interface.

func (Language) Type added in v0.11.0

func (Language) Type() sql.Type

Type implements the Expression interface.

type UAST added in v0.11.0

type UAST struct {
	Blob  sql.Expression
	Lang  sql.Expression
	XPath sql.Expression
}

UAST returns an array of UAST nodes as blobs.

func (UAST) Children added in v0.11.0

func (f UAST) Children() []sql.Expression

Children implements the Expression interface.

func (UAST) Eval added in v0.11.0

func (f UAST) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (UAST) IsNullable added in v0.11.0

func (f UAST) IsNullable() bool

IsNullable implements the Expression interface.

func (UAST) Resolved added in v0.11.0

func (f UAST) Resolved() bool

Resolved implements the Expression interface.

func (UAST) String added in v0.11.0

func (f UAST) String() string

func (UAST) TransformUp added in v0.11.0

func (f UAST) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Expression interface.

func (UAST) Type added in v0.11.0

func (f UAST) Type() sql.Type

Type implements the Expression interface.

type UASTXPath added in v0.11.0

type UASTXPath struct {
	expression.BinaryExpression
}

UASTXPath performs an XPath query over the given UAST nodes.

func (*UASTXPath) Eval added in v0.11.0

func (f *UASTXPath) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the Expression interface.

func (UASTXPath) String added in v0.11.0

func (f UASTXPath) String() string

func (UASTXPath) TransformUp added in v0.11.0

func (f UASTXPath) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Expression interface.

func (UASTXPath) Type added in v0.11.0

func (UASTXPath) Type() sql.Type

Type implements the Expression interface.

Jump to

Keyboard shortcuts

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