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

Possible to get Webpacked level to store data as plain old Strings or JSON objects? #7

Closed
fergiemcdowall opened this issue Nov 13, 2020 · 4 comments

Comments

@fergiemcdowall
Copy link
Contributor

fergiemcdowall commented Nov 13, 2020

When running this project, level seems to store text ('beep' and 'boop') as some kind of buffer. Is it possible to get Webpacked level to store data as plain old Strings or JSON objects? (I have experienced this behavior in other projects as well)

Screenshot 2020-11-13 at 19 33 52

@vweevers
Copy link
Member

Storing data as binary was a conscious decision in order to solve various issues: Level/memdown#186.

@fergiemcdowall
Copy link
Contributor Author

Fair enough- I can see that that makes sorting better for dbs with dynamically typed keys.

If a webpacked level db uses String keys and Object values, what is the best way to examine the contents of that db in a web browser? Is it possible to do so?

@vweevers
Copy link
Member

Inspecting it with javascript is the only way, because the browser doesn't know what the binary data represents, same as with leveldb in node. I suppose you could write a devtools extension 🙃

@fergiemcdowall
Copy link
Contributor Author

I suppose you could write a devtools extension

I'm almost, almost tempted to do so 😉

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