Various Datastore implementations are available.

Implementations

Example: BaseDatastore

An base store is made available to make implementing your own datastore easier:

import { BaseDatastore } from 'datastore-core'

class MyDatastore extends BaseDatastore {
constructor () {
super()
}

async put (key, val) {
// your implementation here
}

async get (key) {
// your implementation here
}

// etc...
}

See the MemoryDatastore for an example of how it is used.

Example: Wrapping Stores

import { Key } from 'interface-datastore'
import {
MemoryStore,
MountStore
} from 'datastore-core'

const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()})

Example: BlackHoleDatastore

A datastore that does not store any data.

import { BlackHoleDatastore } from 'datastore-core/black-hole'

const store = new BlackHoleDatastore()

References

Re-exports BaseDatastore
Re-exports KeyTransformDatastore
Re-exports MemoryDatastore
Re-exports MountDatastore
Re-exports NamespaceDatastore
Re-exports ShardingDatastore
Re-exports TieredDatastore
Re-exports shard