
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
= ♚ Throne
The king is here - on his couch, covered in rubies.
Simple library for working with CouchDB
== Caution!
This code is in heavy development, in conjunction with a few development projects. This means the API can and probably will change substantially over the next few releases as we work out what fits best. You have been warned.
== API documentation
can be found at http://rdoc.info/projects/lstoll/throne
== Basic Usage
Create a database object to work with. Will create the DB if it doesn't exist
@db = Throne::Database.new('http://localhost:5984/throne-test')
# if you don't want to create the DB if it doesn't exist:
@db = Throne::Database.new('http://localhost:5984/throne-test', false)
Save a new document
id = @db.save({:document_title => 'New Document', :documents => 'are just a hash')
id_of_document_saved = id
revision_of_document_saved = id.revision
Get a document
doc = @db.get(document_id)
# with revision
doc = @db.get(document_id, revision)
Save an existing document
id = @db.save(existing_document_loaded_from_db)
new_revision = id.revision
Delete a document
@db.delete(document_id_or_document_object)
Run a design document/function
res = @db.function('_design/DesignDoc/_view/viewname')
res
=> An array of documents
res.offset
=> couchdb offset data
# with parameters
@db.function('_design/DD/_list/listname/viewname', :key => ab..fg, :xyz => 7)
=> An array of documents
# Iterator Method
@db.function('_design/DesignDoc/_view/viewname') do |doc|
#invoked for each document
p doc
end
# All documents
@db.function('_all_docs')
=> All docs in the database
Delete the database
@db.delete_database
Create the database
@db.create_database
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2009 Lincoln Stoll, Ben Schwarz. See LICENSE for details.
FAQs
Unknown package
We found that throne demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.