Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Recursive directory-creation within database creation #135

@19h

Description

@19h

We should be aware of a case where a database is located in a location which is not existing in the first place.

Considering, we're trying to open a database:

root = require("levelup")("./db/root.db");

whereas ./db/ is not existing.

A dubious error is thrown, but does not explain the allocation is invalid because the directory itself is not existing:

OpenError: IO error: ./db/root.db/LOCK: No such file or directory
    at [..]/levelup.js:113:25

I propose a reverse-lookup of the directory-path (cherry-picking ftw) and either an error being thrown explaining the problem further or the directories to the target path being created recursively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions