-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Writing custom adapters
Thaina Yu edited this page Nov 29, 2020
·
7 revisions
[Background: I/@natevw am writing a new PouchDB adapter called PeerPouch, I'm starting this page as my notes along the way in the hopes it can be made more thorough in the future or at least help someone else get started quicker next time. Please don't consider it authoritative, I don't even know if the customApi is/will-ever-be considered stable…]
TBD: basic notes on e.g. how to register and how/when adapter gets initialized, e.g https://github.com/natevw/PeerPouch/blob/master/pouch.webrtc.js#L12 and https://github.com/natevw/PeerPouch/blob/master/pouch.webrtc.js#L118
[preliminary]
- destroy
- valid
[this list is basically copy-pasta grepping for "customApi." in https://github.com/daleharvey/pouchdb/blob/master/packages/pouchdb-core/src/adapter.js right now]
- bulkDocs
- _getRevisionTree
- _doCompaction
- _get
- _getAttachment
- _allDocs
- _changes
- _close
- _info
- _id
- _type [optional]