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

A way to update a existing item in a binn obj? #9

Open
matt-jones-spacemicro-com opened this issue Apr 27, 2017 · 5 comments
Open

A way to update a existing item in a binn obj? #9

matt-jones-spacemicro-com opened this issue Apr 27, 2017 · 5 comments

Comments

@matt-jones-spacemicro-com

Hello binn developers ;)

I am really liking the work you have done on this project. I have been using your binn for logging purposes. I now would like to use it to keep track of, update, and record system variables used in my project. The issue I have hit upon is that I would like to update items that already exist in a binn object. Replace a binn value within a object with a new value, or free the value within the object that has the same key I am using and drop the new one into the object. Is this possible with the current state of binn - it didn't look like it is from looking at the source but I could be wrong? Has anyone else developed an addition of this nature to binn that I could use? Or should I look into doing this myself?

Thank you,
Matt

@kroggen
Copy link
Collaborator

kroggen commented Apr 28, 2017

Hi Matt!

Unfortunately the current code does not support updating values inside a binn.

The library is focused on creating serialized data.

Do you plan to save the binn data? Where? Or do you plan to send over some connection? Or just keep the values on memory?

@matt-jones-spacemicro-com
Copy link
Author

@kroggen
Copy link
Collaborator

kroggen commented Apr 28, 2017

I agree.

Modifying binn will not be so easy, mainly when we have a container inside another, ie, when we want to update an object that is inside a list (or the opposite).

In your case it would be better to load the data to some structure on memory and modify it when needed.

At the time to save the data it can be serialized again and saved to the file.

For objects you can use a hash table (check uthash).

If I had enough time I could implement something on top of binn.

@kroggen
Copy link
Collaborator

kroggen commented Apr 28, 2017

Oh, your idea of using an array of structures is good.

You can also take a look at SQLite, if it fits on your device.

@matt-jones-spacemicro-com
Copy link
Author

Ok great I'll take a look. Thank you very much for getting back to me I very much appreciate it ;)

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

No branches or pull requests

2 participants