Documentation
¶
Index ¶
- Variables
- func NewCommitHasBlob(commitHash, blob sql.Expression) sql.Expression
- func NewCommitHasTree(commit, tree sql.Expression) sql.Expression
- func NewHistoryIdx(start, target sql.Expression) sql.Expression
- 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 NewUASTXPath(uast, xpath sql.Expression) sql.Expression
- type CommitHasBlob
- func (f CommitHasBlob) Children() []sql.Expression
- func (f *CommitHasBlob) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f CommitHasBlob) IsNullable() bool
- func (f CommitHasBlob) Resolved() bool
- func (f CommitHasBlob) String() string
- func (f CommitHasBlob) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (CommitHasBlob) Type() sql.Type
- type CommitHasTree
- type HistoryIdx
- 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 (f UAST) Children() []sql.Expression
- func (f UAST) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (f UAST) IsNullable() bool
- func (f UAST) Resolved() bool
- func (f UAST) String() string
- func (f UAST) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
- func (f UAST) 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") )
var Functions = sql.Functions{ "is_tag": sql.Function1(NewIsTag), "is_remote": sql.Function1(NewIsRemote), "commit_has_blob": sql.Function2(NewCommitHasBlob), "history_idx": sql.Function2(NewHistoryIdx), "commit_has_tree": sql.Function2(NewCommitHasTree), "language": sql.FunctionN(NewLanguage), "uast": sql.FunctionN(NewUAST), "uast_xpath": sql.Function2(NewUASTXPath), }
Functions for gitbase queries.
Functions ¶
func NewCommitHasBlob ¶
func NewCommitHasBlob(commitHash, blob sql.Expression) sql.Expression
NewCommitHasBlob creates a new commit_has_blob function.
func NewCommitHasTree ¶
func NewCommitHasTree(commit, tree sql.Expression) sql.Expression
NewCommitHasTree creates a new CommitHasTree function.
func NewHistoryIdx ¶
func NewHistoryIdx(start, target sql.Expression) sql.Expression
NewHistoryIdx creates a new HistoryIdx udf.
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 CommitHasBlob ¶
type CommitHasBlob struct { expression.BinaryExpression // contains filtered or unexported fields }
CommitHasBlob is a function that checks whether a blob is in a commit.
func (CommitHasBlob) Children ¶ added in v0.11.0
func (f CommitHasBlob) Children() []sql.Expression
Children implements the Expression interface.
func (CommitHasBlob) IsNullable ¶
func (f CommitHasBlob) IsNullable() bool
IsNullable implements the Expression interface.
func (CommitHasBlob) Resolved ¶
func (f CommitHasBlob) Resolved() bool
Resolved implements the Expression interface.
func (CommitHasBlob) String ¶
func (f CommitHasBlob) String() string
func (CommitHasBlob) TransformUp ¶
func (f CommitHasBlob) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
func (CommitHasBlob) Type ¶
func (CommitHasBlob) Type() sql.Type
Type implements the Expression interface.
type CommitHasTree ¶
type CommitHasTree struct { expression.BinaryExpression // contains filtered or unexported fields }
CommitHasTree is a function that checks whether a tree is part of a commit or not.
func (CommitHasTree) String ¶
func (f CommitHasTree) String() string
func (*CommitHasTree) TransformUp ¶
func (f *CommitHasTree) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
func (CommitHasTree) Type ¶
func (CommitHasTree) Type() sql.Type
Type implements the Expression interface.
type HistoryIdx ¶
type HistoryIdx struct { expression.BinaryExpression // contains filtered or unexported fields }
HistoryIdx is a function that returns the index of a commit in the history of another commit.
func (HistoryIdx) String ¶
func (f HistoryIdx) String() string
func (*HistoryIdx) TransformUp ¶
func (f *HistoryIdx) TransformUp(fn sql.TransformExprFunc) (sql.Expression, error)
TransformUp implements the Expression interface.
func (HistoryIdx) Type ¶
func (HistoryIdx) Type() sql.Type
Type implements the Expression interface.
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 { 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) IsNullable ¶ added in v0.11.0
IsNullable implements the Expression interface.
func (UAST) TransformUp ¶ added in v0.11.0
func (f UAST) 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.