mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-09 10:38:10 -06:00
This patch is the first step in moving all reading and writing to the DataStore API, so that we can validate data commited to Noms. The big change here is that types.ReadValue() no longer exists and is replaced with a ReadValue() method on DataStore. A similar WriteValue() method deprecates types.WriteValue(), but fully removing that is left for a later patch. Since a lot of code in the types package needs to read and write values, but cannot import the datas package without creating an import cycle, the types package exports ValueReader and ValueWriter interfaces, which DataStore implements. Thus, a DataStore can be passed to anything in the types package which needs to read or write values (e.g. a collection constructor or typed-ref) Relatedly, this patch also introduces the DataSink interface, so that some public-facing apis no longer need to provide a ChunkSink. Towards #654