Open
Description
Currently, heed is too restrictive on the write transactions and do not permit certain basic operations like writing the content of one database into another as the example shows below.
According to the documentation, write transactions were designed to support this kind of operations on the same database too.
Which means that the following example could even work with the same database.
It would, therefore, be possible for heed replace the places where we use &mut RwTxn
with, a less restrictive, &RwTxn
.
let mut wtxn = env.write_txn()?;
for result in database1.iter(&wtxn)? {
let (k, v) = result?;
database2.put(&mut wtxn, k, v)?; // can't compile &mut and & of the same RwTxn used at the same time
}