Turns out I lied. We can use arena allocation and opaque keys as database handles. Doing so allows us to preserve the copy and equality trait requirements on "databases" (as users see them).
This patch does the following:
Re-enables copy and equality trait requirements on databases.
Returns database handles instead of database instances to consumers, in situations such as calling open_db or create_db on environments, or when dealing with transactions.
Derives copy and equality traits on single/multi database helpers.
This ends up simplifying things quite a lot, removes an entire class of errors, removes a layer of smart pointer indirection, and prevents all the copy/eq regressions from #158.
In https://github.com/mozilla/rkv/pull/158#issuecomment-548693019 I've explained why dropping the requirement for
Copy
andEq
traits was necessary for database instances.Turns out I lied. We can use arena allocation and opaque keys as database handles. Doing so allows us to preserve the copy and equality trait requirements on "databases" (as users see them).
This patch does the following:
open_db
orcreate_db
on environments, or when dealing with transactions.This ends up simplifying things quite a lot, removes an entire class of errors, removes a layer of smart pointer indirection, and prevents all the copy/eq regressions from #158.
Depends on https://github.com/mozilla/rkv/pull/159.