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
PouchDB
datastore - Remove a
PouchDB
datastore - Create a document in a
PouchDB
datastore - Retrieve a document in a
PouchDB
datastore - Update a document in a
PouchDB
datastore - Remove a document from a
PouchDB
datastore - List documents in a
PouchDB
datastore - Query documents in a
PouchDB
datastore - Index documents in a
PouchDB
datastore - Bulk create documents in a
PouchDB
datastore
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