I am writing a wrapper for liblmdb and one thing I was able to do was to store simple integers and floats as the value into the database.  This seems to work pretty well but I am wondering if this is somehow against best practice.

One bad thing about this is that when you are doing a seek or a cursor operation the code does not know what kind of data is at the record. I have some routines to cast them back from the pointers but the user has to know what to cast them to. It would be very handy if the MDB_val struct had a field for metadata, even if it just a byte.

Anyway I am wondering how much trouble I am getting myself with this practice.

Thanks.