When decoding a document from the disk, fields of type TEXT are not copied on purpose to avoid doing unnecessary copies.
However, when the data reaches the upper layers, usually when it's about to get scanned (i.e. document.Scan, document.StructScan), strings must always get deep cloned before being returned to the user.
All new error handling code now rely on internal/errors package
which provides a compilation time toggle that enables to capture
stacktraces for easier debugging while developing.
It also comes with a new testutil/assert package which replaces the require
package when it comes to checking or comparing errors and printing the
stack traces if needed.
Finally, the test target of the Makefile uses the debug build tag by default.
A testnodebug target is also provided for convenience and to make sure no
tests are broken due to not having used the internal/errors or testutil/assert package.
See #431 for more details
This replaces the Value struct by an interface to allow us to override some
values behavior in the future.
It also introduces a new package types, which contains type definitions, comparison,
and arithmetics.
Concerning encoding, Genji now only uses on type of encoding for values. This simplifies
indexing logic as well as table access in general.
Previously, expressions and params were evaluated
during the planning phase. This change builds the query
plan without evaluating params and expressions
which are then evaluated only during the execution phase.