Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Interface consistency with random-access-memory #6
Moving a project from using random-access-memory to random-access-idb should involve simply changing the require statement (the random-access-storage group states that the projects share the same interface).
Instead, currently you also have to instantiate the database with a name.
const storage = require('random-access-memory') const db = hyperdb((filename) => storage(filename), …)
const _storage = require('random-access-idb') const storage = _storage('my-lovely-database-name') const db = hyperdb((filename) => storage(filename), …)
This confused me when going from random-access-memory to random-access-idb in my latest spike.
We should either:
I suggest we go with the latter. Not sure where’s best to document it. Here or in the hypercore/db/drive examples or the getting starts docs? (I’m assuming that starting with random-access-memory for prototyping and moving to *-idb and *-file is a common use case.)