Sha256: 472e54b9aca483d3525f2c9c77f7829da3961546f7d5bccd77e0a91d58d85d8d
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
# opal-pouchdb: A PouchDB Wrapper for Opal [![Build Status](https://travis-ci.org/dodecaphonic/opal-pouchdb.svg?branch=master)](https://travis-ci.org/dodecaphonic/opal-pouchdb) [![Code Climate](https://codeclimate.com/github/dodecaphonic/opal-pouchdb/badges/gpa.svg)](https://codeclimate.com/github/dodecaphonic/opal-pouchdb) opal-pouchdb allows [PouchDB][pouchdb] databases to be used with a nice Ruby API. ## Usage Basic usage follows [PouchDB's API][pouchdb-api] very closely. The major difference is that, in JavaScript, a developer may decide if she wishes get the results of her interactions with the database via callbacks or promises. In opal-pouchdb, everything returns an [Opal Promise][opal-promise], allowing your async code to be as composable as that abstraction allows. ``` ruby db = PouchDB::Database.new("my_database") db.put(_id: "doc-1", summary: "Awesome", text: "Cake").then db.get("doc-1") end.then do |db_record| puts db_record # => { "_id" => "doc-1", "_rev" => "some-large-string", "summary" => "Awesome", "text" => "Cake" } end ``` Every single CRUD operation is supported right now: - put - post - get - delete - all_docs - bulk_docs ## TODO - Attachments - Querying - Views - Database info - Compaction - Revision diff - Events - Plugins - Debug mode [pouchdb]: http://pouchdb.com [pouchdb-api]: http://pouchdb.com/api.html [opal-promise]: http://opalrb.org/docs/promises/
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
opal-pouchdb-0.1.1 | README.md |