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

How to get collections and buckets names? #271

Open
ghost opened this issue Dec 16, 2021 · 3 comments
Open

How to get collections and buckets names? #271

ghost opened this issue Dec 16, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 16, 2021

Is there a way to get a list of collections and buckets directly from Sonic?

My use case is that I want to build buckets based on some data that I might not know in advance. In the search UI, I would like to be able to specify a drop box to search those specific buckets but I do not know what those are so I would need to query Sonic to ask. Does that make sense?

@valeriansaliou
Copy link
Owner

No, unfortunately as per https://github.com/valeriansaliou/sonic/blob/master/PROTOCOL.md#3%EF%B8%8F⃣-sonic-channel-search-mode its not yet possible to enumerate collections & buckets. You'd need to store them in a separate DB.

@ghost
Copy link
Author

ghost commented Dec 17, 2021

Merci.

Is this a feature you would be willing to add?

Is this something that would make a good PR for me to do? I know nothing of Rust and have almost no time but … 😀

@valeriansaliou
Copy link
Owner

That’s something that would be interesting yes, although I also have no time to build it, so open to PRs. Note that unfortunately this would require breaking changes on the Sonic DB format, as you’d need to add an index listing all collections and buckets. So a migration would be needed on existing Sonic installations.

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

1 participant