-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
create sublevels from client #25
Comments
@dominictarr I need your feedback on this one |
I agree on this. Creating sublevels in the client will open many doors in the client API development. |
it's not like I yet had a use cases where I couldn't do something because of this behavior, it's more like it's just annoying to keep updating manifest files al the time. |
yup I'll do this |
I suspect that this is related dominictarr/level-sublevel#19 |
👍 |
you would need this: dominictarr/level-sublevel#38 |
@dominictarr if you create a sublevel on the client, does the server even need to know about it, and vice versa? i.e. if they could be isolated locally, then any 'leak' would be contained. |
I think if you are creating sublevels dynamically then we are better off with a different solution. |
@dominictarr I'd like to get a pattern working where I can get a key, and the value is a stream. Ignoring existing apis, it might look something like: db.get('key').pipe(out) but an approximation of this using sublevels works: db.sublevel('key').createReadStream().pipe(out) The problem is you can't use this pattern with multilevel if you don't know the names of the sublevels when you generate the manifest. Usecase: I have directories /keyed/by/paths/ which contain files, which have meta info. My original implementation has a single sublevel for all the data. The directory is a key, its files + metadata as the value. My new thought is to use a sublevel for the directory, e.g. Goal is to live-stream the sublevel, getting an up-to-date stream of the files + meatdata contained in the directory. |
ahah, right. I see this is related to your the other issues you have posted on resuming? I gotta go eat right now, find me on irc later and we should discuss this |
okay, I've changed my mind about this. |
mind to share your discoveries? |
I think it came down to handling the prefixes differently, so you could just make the key an array, and that will write to sublevels. that is discussed in the linked issue. |
Currently clients cannot create sublevels that aren't part of the manifest. I find that to be cumbersome as I have to recreate manifests etc. for every new sublevel I want to use.
Of course clients shouldn't be able to go above their current sublevel in their hirarchy, but in the sublevel they're in right now they should be able to do whatever they want.
@dominictarr
The text was updated successfully, but these errors were encountered: