For example, LevelDB doesn't support multi-statement transactions. I read somewhere that you would have to deal with those in a "transactional layer".
What would this layer have to do to add transaction support to a lower-level library that doesn't support transactions?
There are various ways to define transactions and there are various ways to implement them. A common property of a transaction is that it's ACID:
A transaction may have several states:
LevelDB does not support transactions, however it does have some of the ACID properties:
So... back to your question:
Q:
A: It depends on how you define a transaction. If you define a transaction with the above-mentioned properties and if you want your transactions to be ACID, then you'd have to figure out if that's possible with LevelDB (most of the ACID properties are integrated) and then you'd have to write a wrapper around LevelDB which ensures that the states of the transactions are maintained properly. However, I'm not entirely sure that a wrapper alone would do it, so you may have to actually take the source code and modify it to truly support transactions.