This puts caching in mentat_db, adds a reverse lookup capability for
unique attributes, and populates bidirectional caches with a single
SQL cursor walk.
Differentiate between begin_read and begin_uncached_read.
Note that we still allow toggling within InProgress, because there might be
transient local state that makes starting a new transaction impossible.
* Pre: make FindQuery, FindSpec, and Element non-Clone.
* Pre: make query translator return a Result.
* Pre: make projection return a Result.
* Pre: refactor query parser in preparation for parsing aggregates.
* Pre: rename PredicateFn -> QueryFunction.
* Pre: expose more about bound variables from CC.
* Pre: move ValueTypeSet to core.
This commit lifts some logic out of the scalar ground handler to apply
elsewhere.
When a new value binding is encountered for a variable to which column
bindings have already been established, we do two things:
- We apply a new constraint to the primary column. This ensures that the
behavior for ground-first and ground-second is equivalent.
- We eliminate any existing column type extraction: it won't be
necessary now that a constant value and constant type are known.