Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get-val converts everything to tuple #15

Open
piranha opened this issue Jun 21, 2018 · 1 comment
Open

get-val converts everything to tuple #15

piranha opened this issue Jun 21, 2018 · 1 comment

Comments

@piranha
Copy link

piranha commented Jun 21, 2018

When you do (get-val tr "test") it's the same as (get-val tr ["test"]). I'm pretty sure that's what you intended, but from the point of view of somebody who is just learning how to use FoundationDB, it's really surprising.

I'd say it would be nice to convert only sequences to tuples, and leave strings as just bytes.

@tirkarthi
Copy link
Owner

Hi @piranha ,

Thanks for the issue. It's the intended action. I started this project while learning about FoundationDB using the Java client which used Tuples and I assumed tuples to be the only way to store the data. Later I came to realize that the client just needs bytes while looking at the Python docs and not everything has to be tuple. I can do the change but the problems was that while de-serializing I don't know whether it was stored as a simple byte or as a tuple encoded one and I thought to encode everything as a Tuple to ease the implementation. I felt the implementation and API to be more easy to use when the user has to pass only the string or vector and I encode and decode them with tuple layer without them worrying about the underlying encoding and decoding.

I agree it's a limitation from my side and this also involves doing tuple encoding for everything that has a slight performance impact. I would encourage you to look at https://github.com/vedang/clj_fdb/ for an alternate implementation which is more composable and low-level where you have more control over the serialization. Maybe I will add a note on this in the README or docs about this implementation detail.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants