Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
CouchRest wraps CouchDB's HTTP API using persistent connections with the HTTPClient gem managing servers, databases, and JSON document serialization using CouchDB's API endpoints so you don't have to.
CouchRest is designed to provide a simple base for application and framework-specific object oriented APIs. CouchRest is Object-Mapper agnostic, the JSON objects provided by CouchDB are parsed and returned as Document objects providing a simple Hash-like interface.
For more complete modelling support based on ActiveModel, please checkout CouchRest's sister project: CouchRest Model.
Tested on latest stable release (1.6.X), but should work on older versions above 1.0. Also known to work on Cloudant.
When connecting to a CouchDB 1.X server from a Linux system, you may see a big drop in performance due to the change in library to HTTPClient using persistent connections. The issue is caused by the NOWAIT TCP configuration option causing sockets to hang as they wait for more information. The fix is a simple configuration change:
curl -X PUT "http://localhost:5984/_config/httpd/socket_options" -d '"[{nodelay, true}]"'
$ sudo gem install couchrest
Getting started with CouchRest is easy. You can send requests directly to a URL using a RestClient-like interface:
CouchRest.put("http://localhost:5984/testdb/doc", 'name' => 'test', 'date' => Date.current)
Or use the lean server and database orientated API to take advantage of persistent and reusable connections:
server = CouchRest.new # assumes localhost by default!
db = server.database!('testdb') # create db if it doesn't already exist
# Save a document, with ID
db.save_doc('_id' => 'doc', 'name' => 'test', 'date' => Date.current)
# Fetch doc
doc = db.get('doc')
doc.inspect # #<CouchRest::Document _id: "doc", _rev: "1-defa304b36f9b3ef3ed606cc45d02fe2", name: "test", date: "2015-07-13">
# Delete
db.delete_doc(doc)
The most complete documentation is the spec/ directory. To validate your CouchRest install, from the project root directory use bundler to install the dependencies and then run the tests:
$ bundle install
$ bundle exec rake
To date, the couchrest specs have been shown to run on:
See the Travis Build status for more details.
Changes history: history.txt
API: http://rdoc.info/projects/couchrest/couchrest
Check the wiki for documentation and examples http://wiki.github.com/couchrest/couchrest
Please post bugs, suggestions and patches to the bug tracker at http://github.com/couchrest/couchrest/issues.
Follow us on Twitter: http://twitter.com/couchrest
Also, check https://twitter.com/search?q=couchrest
FAQs
Unknown package
We found that couchrest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.