0.0
No commit activity in last 3 years
No release in over 3 years
An Opal bridge to the PouchDB database library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.4.0
>= 0
>= 0

Runtime

< 0.9.0, >= 0.7.0
 Project Readme

opal-pouchdb: A PouchDB Wrapper for Opal

Build Status Code Climate

opal-pouchdb allows PouchDB databases to be used with a nice Ruby API.

Usage

Basic usage follows PouchDB's 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, allowing your async code to be as composable as that abstraction allows.

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
  • Plugins
  • Debug mode