PouchDB Snippets
PouchDB snippets for Sublime Text
Details
Installs
- Total 337
- Win 197
- Mac 81
- Linux 59
Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | Jun 23 | Jun 22 | Jun 21 | Jun 20 | Jun 19 | Jun 18 | Jun 17 | Jun 16 | Jun 15 | Jun 14 | Jun 13 | Jun 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
PouchDB Sublime snippets ![Build Status](/readmes/img/d1795a53478f7ca50c1d8b8808ef8f78be4333a7.svg)
PouchDB snippets for Sublime Text.
PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser. Was created to help web developers build applications that work as well offline as they do online.
To install through Package Control, search for PouchDB. If you still don't have Package Control in Sublime Text, go get it. If you insist to not install it, you can download the package and put it manually inside your Pacakages directory. It should work but will not update automatically.
Snippets
To trigger a snippet just put a pdb- followed by it's name, like so:
Create a database
trigger: pdb-new⇥
var db = new PouchDB('dbName', options);
Delete a database
trigger: pdb-destroy⇥
db.destroy('dbName', function(err, res) {
// your code goes here
});
Create a new document or update an existing document
trigger: pdb-put⇥
db.put(doc, function(err, res) {
// your code goes here
});
Create a new document and let PouchDB generate an _id
for it
trigger: pdb-post⇥
db.post(doc, function(err, res) {
// your code goes here
});
Fetch a document
trigger: pdb-get⇥
db.get('doc', function(err, res) {
// your code goes here
});
Delete a document
trigger: pdb-remove⇥
db.remove('doc', function(err, res) {
// your code goes here
});
Create/update a batch of documents
trigger: pdb-bulkDocs⇥
db.bulkDocs(docs, function(err, res) {
// your code goes here
});
Fetch multiple documents
trigger: pdb-allDocs⇥
db.allDocs(options, function(err, res) {
// your code goes here
});
Listen to database changes
trigger: pdb-changes⇥
db.changes(options);
Replicate a database
trigger: pdb-replicate⇥
db.replicate.type(remoteDB, options);
Sync a database
trigger: pdb-sync⇥
var sync = PouchDB.sync(src, target, options);
Save an attachment
trigger: pdb-putAttachment⇥
db.putAttachment(docId, attachmentId, rev, doc, type, function(err, res) {
// your code goes here
});
Get an attachment
trigger: pdb-getAttachment⇥
db.getAttachment(docId, attachmentId, options, function(err, res) {
// your code goes here
});
Delete an attachment
trigger: pdb-removeAttachment⇥
db.removeAttachment(docId, attachmentId, rev, function(err, res) {
// your code goes here
});
Query the database
trigger: pdb-query⇥
db.query(fun, options, function(err, res) {
// your code goes here
});
Get database information
trigger: pdb-info⇥
db.info(function(err, res) {
// your code goes here
});
Compact the database
trigger: pdb-compact⇥
db.compact(options, function(err, res) {
// your code goes here
});
Document revisions diff
trigger: pdb-revsDiff⇥
db.revsDiff(diff, function(err, res) {
// your code goes here
});
Events
trigger: pdb-event⇥
PouchDB.on('event', function(dbName) {
// your code goes here
});
Plugins
trigger: pdb-plugin⇥
PouchDB.plugin({
methodName: myFunction
});
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :)
English is the universal language nowadays, so please don't create or comment on issues using another language.
History
For detailed changelog, see Releases.
License
MIT License © Breno Polanski