Package internal implements Exec, executing SQL-like queries on a given database.
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 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.
Resolve a field.
EvalWhereUsingOnlyKey return type. See that function for details.
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.
|querychecker||Package querychecker performs a semantic check on an AST produced by the queryparser package.|
|queryfunctions||Package queryfunctions describes SyncQL's built-in functions.|
|queryparser||Package queryparser is a parser to parse a simplified select statement (a la SQL) for the Vanadium key value store (a.k.a., syncbase).|
|test||Package query_test contains tests for the query package.|