Skip to content

Flag for memory adapter to use in isolation when creating a PouchDB #9115

@enigma1

Description

@enigma1

It would be nice to have a switch to control the behavior of the memory adapter with respect to isolation during deletion. Currently destroy() Doesn't Always Fully Isolate. destroy() does delete the data, but not the underlying memory reference when you reuse the same DB name. The memory adapter caches DBs by name (internally in PouchDB), so re-instantiating a DB with the same name can lead to stale or conflicting state, even after calling destroy(). So an isolate flag would be useful to cover this edge case

new PouchDB('myDb', { adapter: 'memory', isolate: true // or disableCache: true });
So if the isolate flag is enabled to remove the memory references too. At the moment I use different database names to get around the issue

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