A Data port adapter that uses PouchDB in the hyper service framework
hyper.config.js
import { default as pouchdb } from 'https://x.nest.land/hyper-adapter-pouchdb@VERSION/mod.js'
export default {
app: opine,
adapter: [
{ port: 'data', plugins: [pouchdb()] },
],
}This adapter can use either memory, idb (IndexedDB polyfill), or indexeddb (IndexedDB BETA.
See distinction here) for PouchDB storage.
You may choose which storage to use by passing the storage option to the adapter:
import {
default as pouchdb,
PouchDbAdapterTypes,
} from 'https://x.nest.land/hyper-adapter-pouchdb@VERSION/mod.js'
pouchdb({ storage: PouchDbAdapterTypes.memory })
// OR use IndexedDB for persistence
pouchdb({ storage: PouchDbAdapterTypes.idb })The default storage option is idb
When using the idb (IndexedDB polyfill), you can specify where .sqlite files used by indexeddb
are placed by providing a dir option:
import { default as pouchdb } from 'https://x.nest.land/hyper-adapter-pouchdb@VERSION/mod.js'
pouchdb({ dir: '/tmp' })The default directory is the cwd
This is a Deno module available to import from nest.land
deps.js
export { default as pouchdb } from 'https://x.nest.land/hyper-adapter-pouchdb@VERSION/mod.js'- Create a
PouchDBdatastore - Remove a
PouchDBdatastore - Create a document in a
PouchDBdatastore - Retrieve a document in a
PouchDBdatastore - Update a document in a
PouchDBdatastore - Remove a document from a
PouchDBdatastore - List documents in a
PouchDBdatastore - Query documents in a
PouchDBdatastore - Index documents in a
PouchDBdatastore - Bulk create documents in a
PouchDBdatastore
This adapter fully implements the Data port and can be used as the hyper Data service adapter
See the full port here
Contributions are welcome! See the hyper contribution guide
./scripts/test.sh
To lint, check formatting, and run unit tests
Apache-2.0