Phase 1 of NSIncrementalStore work

We can fetch, store, update and delete
BUG:
  - if we make a change in a relation, the next time we run, nothing loads?
TODO:
  - Come up with a better way for uniqueID
  - queries, and others..
  - relations are straight forward and simple
  - all _very_ naive and inefficient, I'm sure
  - Sync with backend

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
SUCK! Caches, get out of sync over runs somehow, so we delete them.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Create a dot graph, helpful for debugging.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Change encoding so that values for predicate and sort are off the top level.

This requires us to split metatdata from data, it's not so bad.
However, The CDT docs do state that there is a way to control where
the value comes from the index but it is poorly explained (at least to
me) and will likely slow stuff down.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Add support for sort descriptors

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
First IncrementalStore Unit Test

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
fixup: unitTest: proper attribution

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
More fields for Entry for testing

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Unit test for `countForFetchRequest`

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
More Code Selectors

1. Verify backingstore document survives JSON serialization
2. Update the DOT graph on every save

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Enable Logging

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
UNTESTED attempt at predicates

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
oops cleanup

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Deal with JSON double limitations.

JSON cannot handle the full range of double so we store
two values:
1. `long long` "image" so we can store accurately
  > This could be a problematic when replicating to other arches
2. A JSON range value so predicates and sort order can work

Right now the JSON conversion is to just make it a float.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Sort descriptors need to know the index type

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Add fetch constraints

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Unit test for sort order and test constraints

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Nits!

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Don't fail if we try to remove the database and it is not there

Usually happens when you run the first time

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Support all available predicates

Cause an exception when others are used
Includes Unit Tests

Signed-off-by: Jimi Xenidis <jimix@pobox.com>