Drup / ocaml-lmdb

Ocaml bindings for lmdb.
https://drup.github.io/ocaml-lmdb/dev/
MIT License
48 stars 3 forks source link

1. Remove Cursor.abort 2. flexible return type for abort #31

Closed madroach closed 4 years ago

madroach commented 4 years ago

This PR has two changes that should be reviewed separately:

  1. Remove Cursor.abort, because it is only safe if the transaction was created by Cursor.abort. We already error out if a cursor with custom transaction is aborted. I believe it is better to require explicit creation of a transaction when the user wants to abort a transaction. Transactions and Cursors are different things with different scopes. Don't pretend otherwise.
  2. Since Txn.abort doesn't return, make the return type flexible. This matches the behaviour of raise and assert false.
madroach commented 4 years ago

@Drup: Are you ok with this api change ?