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

Is there a way to do sync queries? #43

Open
retorquere opened this issue Sep 9, 2024 · 0 comments
Open

Is there a way to do sync queries? #43

retorquere opened this issue Sep 9, 2024 · 0 comments

Comments

@retorquere
Copy link
Contributor

continuation of #26, which was closed as completed without resolution on 2023-10-08:

@retorquere wrote:

The async methods all seems to consist of wrapping the result of what are essentially sync functions in a Promise.resolve. Is there a way to skip this? There are parts of my application where I cannot run async code.

@maradotwebp wrote:

For now, although the API is internal, you can keep using const { internalInsertMany } = require('blinkdb/dist/core/insertMany') to import the synchronous methods. Do note that these internal functions will not trigger registered hooks, and are considered unstable.

In the future (after v1.0), I will extract the entire synchronous database into a @blinkdb/core module, which will make it easier if you just want to use the underlying synchronous DB implementation without any hooks.

@retorquere wrote:

internalInsertMany and `internalUpsertMany still return promises though.

Any timeline on a fix for this?

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