bmatsuo / lmdb-go

Bindings for the LMDB C library
BSD 3-Clause "New" or "Revised" License
156 stars 58 forks source link

Support for unsigned integer values #99

Open bmatsuo opened 7 years ago

bmatsuo commented 7 years ago

Closes #11

I am opening this now because it is close to done. But it is probably not done right now. It is a rather large change though. So I am letting it bake a here for a little bit.

The one thing that differs from the discussion in #11 is that the interface here is called Data, not Value. The word "value" was too overloaded already. Data is pretty precise, and shorter by one character. So I have opted to use it.

edit: The only unfortunate thing about the use of the word Data is its appearance near the beginning of the function index generated by go doc. This is fairly minor, but it does bug me with the number of conversion functions I had to define for working with the output of Txn.GetData and Cursor.GetData.

edit: I have actually stopped using an interface. The base code is the same and I can reintroduce an interface if needed in the future. But the API felt unwieldy and even without the new interfaces the API change is not negligible. But I think the result is quite clean now, and it's a few ns faster than the version that used interfaces.