Documentation ¶
Index ¶
- Variables
- func NewIsRemote(e sql.Expression) sql.Expression
- func NewIsTag(e sql.Expression) sql.Expression
- func NewLanguage(args ...sql.Expression) (sql.Expression, error)
- func NewUAST(args ...sql.Expression) (sql.Expression, error)
- func NewUASTChildren(uast sql.Expression) sql.Expression
- func NewUASTExtract(uast, key sql.Expression) sql.Expression
- func NewUASTMode(mode, blob, lang sql.Expression) sql.Expression
- func NewUASTXPath(uast, xpath sql.Expression) sql.Expression
- type IsRemote
- type IsTag
- type Language
- func (f *Language) Children() []sql.Expression
- func (f *Language) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f *Language) IsNullable() bool
- func (f *Language) Resolved() bool
- func (f *Language) String() string
- func (f *Language) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (Language) Type() sql.Type
- type UAST
- func (u UAST) Children() []sql.Expression
- func (u UAST) Eval(ctx *sql.Context, row sql.Row) (out interface{}, err error)
- func (u UAST) IsNullable() bool
- func (u UAST) Resolved() bool
- func (u *UAST) String() string
- func (u *UAST) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (u UAST) Type() sql.Type
- type UASTChildren
- type UASTExtract
- type UASTMode
- func (u UASTMode) Children() []sql.Expression
- func (u UASTMode) Eval(ctx *sql.Context, row sql.Row) (out interface{}, err error)
- func (u UASTMode) IsNullable() bool
- func (u UASTMode) Resolved() bool
- func (u *UASTMode) String() string
- func (u *UASTMode) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (u UASTMode) Type() sql.Type
- type UASTXPath
Constants ¶
This section is empty.
Variables ¶
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") // ErrUnmarshalUAST is returned when an error arises unmarshaling UASTs. ErrUnmarshalUAST = errors.NewKind("error unmarshaling UAST: %s") // ErrMarshalUAST is returned when an error arises marshaling UASTs. ErrMarshalUAST = errors.NewKind("error marshaling uast node: %s") )
var Functions = sql.Functions{ "is_tag": sql.Function1(NewIsTag), "is_remote": sql.Function1(NewIsRemote), "language": sql.FunctionN(NewLanguage), "uast": sql.FunctionN(NewUAST), "uast_mode": sql.Function3(NewUASTMode), "uast_xpath": sql.Function2(NewUASTXPath), "uast_extract": sql.Function2(NewUASTExtract), "uast_children": sql.Function1(NewUASTChildren), }
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 NewUASTChildren ¶ added in v0.17.0
func NewUASTChildren(uast sql.Expression) sql.Expression
NewUASTChildren creates a new UASTExtract UDF.
func NewUASTExtract ¶ added in v0.17.0
func NewUASTExtract(uast, key sql.Expression) sql.Expression
NewUASTExtract creates a new UASTExtract UDF.
func NewUASTMode ¶ added in v0.16.0
func NewUASTMode(mode, blob, lang sql.Expression) sql.Expression
NewUASTMode creates a new UASTMode 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) TransformUp ¶
func (f IsRemote) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type IsTag ¶
type IsTag struct {
expression.UnaryExpression
}
IsTag checks the given string is a tag name.
func (IsTag) TransformUp ¶
func (f IsTag) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp 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) IsNullable ¶ added in v0.11.0
IsNullable implements the Expression interface.
func (*Language) TransformUp ¶ added in v0.11.0
func (f *Language) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type UAST ¶ added in v0.11.0
type UAST struct {
// contains filtered or unexported fields
}
UAST returns an array of UAST nodes as blobs.
func (UAST) Children ¶ added in v0.11.0
func (u UAST) Children() []sql.Expression
Children implements the Expression interface.
func (UAST) IsNullable ¶ added in v0.11.0
func (u UAST) IsNullable() bool
IsNullable implements the Expression interface.
func (UAST) Resolved ¶ added in v0.11.0
func (u UAST) Resolved() bool
Resolved implements the Expression interface.
func (*UAST) TransformUp ¶ added in v0.11.0
func (u *UAST) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
type UASTChildren ¶ added in v0.17.0
type UASTChildren struct {
expression.UnaryExpression
}
UASTChildren returns children from UAST nodes.
func (*UASTChildren) String ¶ added in v0.17.0
func (u *UASTChildren) String() string
String implements the fmt.Stringer interface.
func (*UASTChildren) TransformUp ¶ added in v0.17.0
func (u *UASTChildren) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the sql.Expression interface.
func (*UASTChildren) Type ¶ added in v0.17.0
func (u *UASTChildren) Type() sql.Type
Type implements the sql.Expression interface.
type UASTExtract ¶ added in v0.17.0
type UASTExtract struct {
expression.BinaryExpression
}
UASTExtract extracts keys from an UAST.
func (*UASTExtract) String ¶ added in v0.17.0
func (u *UASTExtract) String() string
String implements the fmt.Stringer interface.
func (*UASTExtract) TransformUp ¶ added in v0.17.0
func (u *UASTExtract) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the sql.Expression interface.
func (*UASTExtract) Type ¶ added in v0.17.0
func (u *UASTExtract) Type() sql.Type
Type implements the sql.Expression interface.
type UASTMode ¶ added in v0.16.0
type UASTMode struct {
// contains filtered or unexported fields
}
UASTMode returns an array of UAST nodes as blobs.
func (UASTMode) Children ¶ added in v0.16.0
func (u UASTMode) Children() []sql.Expression
Children implements the Expression interface.
func (UASTMode) IsNullable ¶ added in v0.16.0
func (u UASTMode) IsNullable() bool
IsNullable implements the Expression interface.
func (UASTMode) Resolved ¶ added in v0.16.0
func (u UASTMode) Resolved() bool
Resolved implements the Expression interface.
func (*UASTMode) TransformUp ¶ added in v0.16.0
func (u *UASTMode) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp 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) TransformUp ¶ added in v0.11.0
func (f UASTXPath) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.