In order to support alternative database systems, we need to have a generic Batch
class. This PR adds a DatabaseBatch
abstract class which is implemented by BerkeleyBatch
. DatabaseBatch
is now the class that is used by WalletBatch
to interact with the database. To be able to get the correct type of DatabaseBatch
, BerkeleyDatabase
now has a MakeBatch
function which returns a newly constructed std::unique_ptr<DatabaseBatch>
. For BerkeleyDatabase
, that will be std::unique_ptr<BerkeleyBatch>
.
The Read
, Write
, Erase
, and Exists
template functions are moved from BerkeleyBatch
.
Part of #18971