node-red / node-red/node-red-nodes

leveldb: prepend user dir to relative db path?

Open
#403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
13h 57m
Merged PRs (30d)
3

Description

When the leveldb node is given a relative path, e.g. my-dir/my-db, perhaps it should prepend RED.settings.userDir to this path. This is the behavior that I'd expect, anyhow.

Otherwise, leveldown appears to want to use the filesystem root, and will throw an exception if NR is not running as superuser. If NR is running privileged, then the behavior is likely undesirable anyhow.

This should not affect absolute paths such as /home/me/.node-red/my-db. That's a little tedious to type, as well. 😉

I can send a PR if this would be desirable--but it is a breaking change.

(Alternatively, maybe just add some docs to the info pane.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the leveldb node's path handling and how it uses RED.settings.userDir and leveldown. Compare the current behavior for relative and absolute paths, then determine whether the expected result is a path change or documentation in the info pane; done requires an agreed approach and coverage of the selected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.