hyperdrive icon indicating copy to clipboard operation
hyperdrive copied to clipboard

Pass though opts parameter to metadata hypertrie

Open fsteff opened this issue 5 years ago • 1 comments

It would be useful to have the ability to pass through the opts parameter of createWriteStream, createReadstream etc. to the metadata db/hypertrie. This e.g. would make it possible to create hidden files by simple passing the hidden: true option.

However, according to @mafintosh this would result in internal clashes, therefore some namespacing is required (obviously, e.g. for the valueEncoding option).

So here's my suggestion for the options namespace:

{
  db: { /* opts passed to the db */ }
}

I'll try to implement it right away and create a pull request once it works ;-)

Discussion on Discord

fsteff avatar Oct 07 '20 14:10 fsteff

Possible limitations - the question here is if there would even be a usecase for it:

  • usages of _update => used by setMetadata/removeMetadata, which don't have the opts parameter at all
  • usages of _upsert (what does that even do?)
  • symlink does not have the opts parameter

fsteff avatar Oct 07 '20 14:10 fsteff