Add bundle reader abstraction
Created by: efritz
Create an abstraction between the bundle manager database and the storage layer. This makes a solid interface that we can use to later abstract out the storage layer if we find something that works better.
The worker will have a symmetric interface for writing to a storage layer. The serialization package was also added to help us deal with migration between serialized data versions.
Major changes:
- Wrote the
sqliteReader
and the serialization package in internal/codeintel - The bundle manager's
Database
is nowdatabaseImpl
, andDatabase
is now an interface - The
databaseImpl
SQLite-specific code now delegates to the newsqliteReader
This partially implements https://github.com/sourcegraph/sourcegraph/issues/9965.