I wish to use leveldb in my pure C# project.
I have googled for a C# version of leveldb, but got no lucky.
Any one can tell me where I can find a C# version of leveldb?
Thanks
I wish to use leveldb in my pure C# project.
I have googled for a C# version of leveldb, but got no lucky.
Any one can tell me where I can find a C# version of leveldb?
Thanks
I haven't used it, but I see leveldb-sharp.
I don't know the story here, but there's this project at Microsoft's official Rx-Js page here.
As much as I can see you could also use LMDB (lightning memory mapped database, http://symas.com/mdb/ ) which seems quite similar to LevelDB and also comes with a .Net wrapper (https://github.com/ilyalukyanov/Lightning.NET) Dont know how well it works though, haven't used it yet...
Not that I know of, but I've been using it in my C# project. If you're familiar with C++, then you can make your own CLI wrapper (shouldn't be that much trouble), build it as a DLL and then you can load that DLL in your C# project like any other assembly reference.
There is a windows port for leveldb and it's a little tricky to get it into Visual Studio, but if you're having trouble I can upload my Visual Studio 2010 solution (which is 75% of the battle) with the whole thing set-up and ready to build (except the CLI wrapper). I can put it up on github or something, which I'm actually planning on doing anyway, but I'll expedite it for you.
Like I said, I've been using that approach for my C# project and it works great. However, if you have really high performance requirements, then I would recommend batching up "work" in order to reduce the P/Invokes.
Example
Please note that I have not compiled this code, but I'm just posting it as an example. Your header file might look like this:
Your cpp file is going to be along the lines of:
This should get you in the right direction.
Get Example
OK, Get will look like this:
The source is along the lines:
Note that different data may have different encoding, so I feel like the safest way to pass data between your unmanaged and managed code is to use pointers and an
UnmanagedMemoryStream
. Here is how you would get the data associated with a key in C#:Again, I have not compiled or run the code, but it should get you on the right track.