Simplify the NoSQL implementation with more default behavior

We can simplify the surface that an implementation has to deal with
by combining some actions through the atomicUpdate() method, and
just exposing more of the internal bits of GenericAccess in case the
implementor wants to roll more of their own logic for per-row edits,
but still wants our standard schema layout inside of the key space.

Single row lookup can be approximated by a scan over the primary
key, which we need to support anyway for certain types of queries.

We can drop the key IndexFunction and simplify the code by using
primaryKey(T) to obtain the primary key of an object, then encode
it using the encodePrimaryKey method.

We can avoid creating indexes for queries that fetch all records
in the relation by having those use the primary key index instead.
This should reduce the number of indexes needed for at least some
objects, but the reduction is still incomplete.  We can use the
primary key index in a lot more situations than just an "all" query.

Change-Id: Ifc2896df6dc017c7e8a026dff90a0811f8fcda28
Signed-off-by: Shawn O. Pearce <sop@google.com>
7 files changed