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

Allow external db instance #12

Open
Azarattum opened this issue Dec 3, 2022 · 1 comment
Open

Allow external db instance #12

Azarattum opened this issue Dec 3, 2022 · 1 comment
Assignees

Comments

@Azarattum
Copy link

Azarattum commented Dec 3, 2022

Is your feature request related to a problem? Please describe.
Currently y-leveldb takes a level constructor but not a db instance. Therefore there's currently no way to pass an initialized database to it.

Describe the solution you'd like
Add {db: ...} in options to pass a database.

Describe alternatives you've considered
If this is technically not possible (because of the encoders, etc). It would be nice if the external database could be exposed. So, it's possible to query it/apply plugins directly.

Additional context
In general I'm looking for a way to do full-text searches in my yjs documents which are stored in leveldb. Therefore I want to use an indexing plugin like search-index. Not sure if that's the right approach though. If there are better ways to index yjs docs, please let me know.

@beorn
Copy link

beorn commented Nov 23, 2023

Agreed - see also #17
Instead of passing a level creator and options you can just pass a level instance (abstract-level compatible) that's been pre-created with the right options.

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

3 participants