syncbase: syncQL: replace t with Type(), remove restrictions on k

t is no longer an identifier, it has been replaced by the Typefunction.
  Simply replace t with Type(v) in any existing queries.
  This allows inquiring about types other than the v object itself
  (e.g., Type(v.Foo))

k the somewhat arbitrary restrictions on k have been removed.  Instead
  of insisting on:
    k <operator> <string_literal>
  one can use k on either side of the comparison expression and, in addition to
  string literals, value fields and functions are supported.
  Examples:
    "abc" <> k
    k = v.Key
    k = k // always true
    k <> k // always false
    k is not nil // always true
    k is nil // always false

This CL also cleans up function errors.  Rather than a single verror of FunctionReturnedError
with a text argument that can't be internationalized, separate verrors are now created.

Also fixed is a number of places where K and V (upppercase) could not be used in place
of k and v (lowercase).

Note: A change to test/integration/test-database.js (t -> Type(v)) is being mailed separately.
      It may be that I break an integration test which gets fixed by immediately submitting the
      js change.  Note: I don't see selection by type in the TODOs app.

MultiPart: 1/2

Change-Id: I1ba777b0575a7966b991e74db39b83eeb1d6cd4e
17 files changed
tree: 5a18428538950199db6b95837251583347936cd4
  1. v23/
  2. x/
  3. .gitignore
  4. AUTHORS
  5. CONTRIBUTORS
  6. LICENSE
  7. PATENTS
  8. VERSION