v.io: v.io/v23/query/engine/internal Index | Files | Directories

package internal

import "v.io/v23/query/engine/internal"

Package internal implements Exec, executing SQL-like queries on a given database.


Package Files

doc.go eval.go query.go result_streams.go

func ComposeProjection Uses

func ComposeProjection(db ds.Database, k string, v *vdl.Value, s *queryparser.SelectClause) []*vom.RawBytes

Given a key, a value and a SelectClause, return the projection. This function is only called if Eval returned true on the WhereClause expression.

func Create Uses

func Create(db ds.Database) public.QueryEngine

func Eval Uses

func Eval(db ds.Database, k string, v *vdl.Value, e *queryparser.Expression) bool

func Exec Uses

func Exec(db ds.Database, q string) ([]string, syncql.ResultStream, error)

func ExecSelectSingleRow Uses

func ExecSelectSingleRow(db ds.Database, k string, v *vdl.Value, s *queryparser.SelectStatement) []*vom.RawBytes

For testing purposes, given a SelectStatement, k and v; return nil if row not selected, else return the projection (type []*vdl.Value). Note: limit and offset clauses are ignored for this function as they make no sense for a single row.

func ResolveField Uses

func ResolveField(db ds.Database, k string, v *vdl.Value, f *queryparser.Field) *vdl.Value

Resolve a field.

type EvalWithKeyResult Uses

type EvalWithKeyResult int

EvalWhereUsingOnlyKey return type. See that function for details.

const (
    Include EvalWithKeyResult = iota

func EvalWhereUsingOnlyKey Uses

func EvalWhereUsingOnlyKey(db ds.Database, w *queryparser.WhereClause, k string) EvalWithKeyResult

Evaluate the where clause to determine if the row should be selected, but do so using only the key. Possible returns are: Include: the row should Included in the results Exclude: the row should NOT be Included FetchValue: the value and/or type of the value are required to determine if row should be Included. The above decision is accomplished by evaluating all expressions which compare the key with a string literal and substituing false for all other expressions. If the result is true, Include is returned. If the result is false, but no other expressions were encountered, Exclude is returned; else, FetchValue is returned indicating the value must be fetched in order to determine if the row should be Included in the results.


querycheckerPackage querychecker performs a semantic check on an AST produced by the queryparser package.
queryfunctionsPackage queryfunctions describes SyncQL's built-in functions.
queryparserPackage queryparser is a parser to parse a simplified select statement (a la SQL) for the Vanadium key value store (a.k.a., syncbase).
testPackage query_test contains tests for the query package.

Package internal imports 13 packages (graph) and is imported by 9 packages. Updated 2020-10-15. Refresh now. Tools for package owners.