...
This meant that the returned result could be of two potential data types: plain V
or ValueAndTimestamp<V>
. This was a source of inconsistency. For instance, querying a kv-store
with KeyQuery
would return a V
type, but querying a ts-kv-store
would yield a ValueAndTimestamp<V>
. This behavior is unintuitive and potentially confusing for developers.
To address this inconsistencyensure consistency, we propose suggest that KeyQuery should be restricted to querying kv-stores
only, ensuring that it always returns a plain V
type, making the behavior of the aforementioned code more predictable. Similarly, RangeQuery
should be dedicated to querying kv-stores
, consistently returning only the plain V
always return the plain V type, enhancing the predictability of the mentioned code. Likewise, RangeQuery should uniformly return the plain V KeyValueIterator.
For those requiring timestamped values from a ts-kv-store
, we recommend introducing a new query type: TimestampedKeyQuery
. This new query will specifically target ts-kv-stores
and will return ValueAndTimestamp<V>
. Furthermore, to complement this, TimestampedRangeQuery
should be introduced to query ranges in ts-kv-stores
, ensuring that the returned value always includes timestamps.
...