{"id":18832685,"url":"https://github.com/datto/cassava","last_synced_at":"2025-07-15T04:34:22.454Z","repository":{"id":79939790,"uuid":"48003986","full_name":"datto/cassava","owner":"datto","description":"An un-opinionated Cassandra client built on top of the Datastax Cassandra Driver.","archived":false,"fork":false,"pushed_at":"2015-12-14T22:07:57.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T17:33:10.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-14T22:07:04.000Z","updated_at":"2024-11-28T16:32:02.000Z","dependencies_parsed_at":"2023-03-12T09:29:28.922Z","dependency_job_id":null,"html_url":"https://github.com/datto/cassava","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/datto/cassava","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fcassava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fcassava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fcassava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fcassava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datto","download_url":"https://codeload.github.com/datto/cassava/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fcassava/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265402833,"owners_count":23759237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T01:58:43.650Z","updated_at":"2025-07-15T04:34:22.430Z","avatar_url":"https://github.com/datto.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cassava\n\n[![Code Climate](https://codeclimate.com/github/backupify/cassava/badges/gpa.svg)](https://codeclimate.com/github/backupify/cassava)\n\nAn unopinionated Cassandra client built on top of the Datastax Cassandra Driver. Cassava provides a higher-level statement execution interface while still supporting asynchronous queries and the ability to connect to multiple clusters.\n\n _If prepared incorrectly, the cassava plant can produce cyanide, a deadly compound when consumed._\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'cassava_rb', github: 'backupify/cassava'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install cassava_rb\n\n## Usage\n\nCreating a client requires a `Cassandra::Session` object:\n\n```ruby\nrequire 'cassava'\ncluster = Cassandra.cluster\nsession = cluster.connect('a_keyspace')\nclient = Cassava::Client.new(session)\n```\n\n### Insert\n\n```ruby\nclient.insert(:table, :id =\u003e 'id', :a =\u003e 1, :b =\u003e 'b')\n\n```\n\n### Select\n\nA select statement is built and then executed. To create a statement that will\nselect all columns:\n\n```ruby\nstatement = client.select(:table)\n```\n\nThis statement can then be further refined:\n\n```ruby\nnew_statement = statement.where(:id =\u003e 'id').limit(2)\n```\n\nand then executed:\n\n```ruby\nresult = new_statement.execute\n```\n\nor executed asynchronously:\n\n```ruby\npromise = new_statement.execute_async\n```\n\nTo select only certain rows, provide those rows to the select method:\n\n```ruby\nclient.select(:table, [:id, :a, :b]).execute\n```\n\nOrdering can be specified using the order method:\n\n```ruby\nclient.select(:table).where('id = ? AND a \u003e ?', 1, 'b').order(:a, :desc).execute\n```\n\nFiltering is permitting with the `allow_filtering` method.\n\nMultiple records can be specified by passing an array of values, but this will generate an CQL IN query and should be used with caution:\n\n```ruby\nclient.select(:table).where(:id =\u003e 1, :a =\u003e [1, 2])\n```\n\n### Delete\n\nTo delete an entire record:\n\n```ruby\nclient.delete(table).where(:id =\u003e 1, :a =\u003e 1).execute\n```\n\nTo delete only certain columns:\n\n```ruby\nclient.delete(table, [:c, :d]).where(:id =\u003e 1, :a =\u003e 1).execute\n```\n\nNote here that :c and :d must not be part of the primary key.\n\n## Contributing\n\n1. Fork it ( https://github.com/backupify/cassava/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatto%2Fcassava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatto%2Fcassava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatto%2Fcassava/lists"}