Skip to content

Is there a way to do sync queries? #43

@retorquere

Description

@retorquere

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions