ejdb
ejdb copied to clipboard
EJDB2 Rust binding
Are you need a help with it?
Sure! Some work was done by one of our contributor https://gitlab.com/bemyak/ejdb2-rs But we are still finding good ways to start. So any contributions are appreciated, especially for Rust, since it has quite high learning curve for me to start write good code in few days from scratch.
here is the rust binding I created,
https://crates.io/crates/ejdb2
it is mostly working (the current missing function is the http server). Sorry I didn't know about the above project before starting. but I just checked, it appears to be empty other that the lower-level binding?
I'm also interested in making one for python.
I'm not happy about the exec function in my implementation. initially I wanted it to be like C which accepts a callback as input. But I ran into issues when passing a rust lambda to the ejdb callback. It crashes.
My current version takes a vector as the input instead. The vector will be filled with results. I know other bindings implement a document stream or a cursor / iterator. I can do that too. I'm thinking of running exec in a separate thread and immediately returns an iterator to the caller. The iterator and the exec form a consumer-producer. But I don't know the benefit of this vs. my current naive implementation as the producer-consumer will likely introduce extra data copies.
I also find it inconvenient that EJDB doesn't support operators on the primary key other than '=', for example /* > 32 is invalid. This is a common way for implementing fast pagination with mongodb (https://www.codementor.io/@arpitbhayani/fast-and-efficient-pagination-in-mongodb-9095flbqr), not sure if this optimization makes sense for EJDB though .
Thank you so much! I will respond to your comment and set ref to your bind in few days
@adamansky What is the status of this issue?
I'm sorry for the long delay (= I've listed this binding in the project README.
I also find it inconvenient that EJDB doesn't support operators on the primary key other than '=', for example /* > 32 is invalid. I think it is quite easy to implement will try to do it next month.