{"id":15056894,"url":"https://github.com/cafebazaar/elixir-cassandra","last_synced_at":"2025-10-04T16:31:56.700Z","repository":{"id":57482289,"uuid":"70412497","full_name":"cafebazaar/elixir-cassandra","owner":"cafebazaar","description":"An Elixir client for Apache Cassandra.","archived":false,"fork":true,"pushed_at":"2018-12-30T15:10:39.000Z","size":364,"stargazers_count":31,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-29T12:03:57.886Z","etag":null,"topics":["cassandra","driver","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hzamani/elixir-cassandra","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cafebazaar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-09T15:33:21.000Z","updated_at":"2022-06-26T13:55:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cafebazaar/elixir-cassandra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2Felixir-cassandra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2Felixir-cassandra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2Felixir-cassandra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafebazaar%2Felixir-cassandra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cafebazaar","download_url":"https://codeload.github.com/cafebazaar/elixir-cassandra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235285436,"owners_count":18965324,"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":["cassandra","driver","elixir"],"created_at":"2024-09-24T21:57:51.686Z","updated_at":"2025-10-04T16:31:51.426Z","avatar_url":"https://github.com/cafebazaar.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cassandra\n\n[![Build Status](https://travis-ci.org/cafebazaar/elixir-cassandra.svg?branch=master)](https://travis-ci.org/cafebazaar/elixir-cassandra)\n[![Hex.pm](https://img.shields.io/hexpm/v/cassandra.svg?maxAge=2592000)](https://hex.pm/packages/cassandra)\n[![Hex.pm](https://img.shields.io/hexpm/l/cassandra.svg?maxAge=2592000)](https://github.com/cafebazaar/elixir-cassandra/blob/master/LICENSE.md)\n[![Coverage Status](https://coveralls.io/repos/github/cafebazaar/elixir-cassandra/badge.svg?branch=master)](https://coveralls.io/github/cafebazaar/elixir-cassandra?branch=master)\n\nAn Elixir driver for Apache Cassandra.\n\nThis driver works with Cassandra Query Language version 3 (CQL3) and Cassandra's native protocol v4.\n\n## Features\n\n* Automatic peer discovery\n* Automatic connection managment (reconnect on connection loss and discover new nodes)\n* Configurable load-balancing/reconnection policies\n* Asynchronous execution through Tasks\n* Prepared statements with named and position based values\n* Token based load-balancing policy\n* Automatic prepare and cache prepared statements per host\n* Result paging\n\n## Installation\n\nAdd `cassandra` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:cassandra, \"~\u003e 1.0.0-beta.5\"}]\nend\n```\n\n## Quick Start\n\n```elixir\ndefmodule Repo do\n  use Cassandra\nend\n\n{:ok, _} = Repo.start_link\n# uses \"127.0.0.1:9042\" as contact point by default\n# discovers other nodes on first connection\n\nRepo.execute \"\"\"\n  CREATE KEYSPACE IF NOT EXISTS test\n    WITH replication = {'class':'SimpleStrategy','replication_factor':1};\n  \"\"\", consistency: :all\n\nRepo.execute \"\"\"\n  CREATE TABLE IF NOT EXISTS test.users (\n    id timeuuid,\n    name varchar,\n    age int,\n    PRIMARY KEY (id)\n  );\n  \"\"\", consistency: :all\n\ninsert = \"INSERT INTO test.users (id, name, age) VALUES (?, ?, ?);\"\n\nusers = [\n  %{name: \"Bilbo\", age: 50},\n  %{name: \"Frodo\", age: 33},\n  %{name: \"Gandolf\", age: 2019},\n]\n\nusers\n|\u003e Task.async_stream(\u0026Repo.execute(insert, values: [Cassandra.UUID.v1, \u00261.name, \u00261.age]))\n|\u003e Enum.to_list\n\nRepo.execute(\"SELECT * FROM test.users;\")\n\n# %CQL.Result.Rows{\n#   columns: [\"id\", \"age\", \"name\"],\n#   rows_count: 3,\n#   rows: [\n#     [\"831e5df2-a0e1-11e6-b9af-6d2c86545d91\", 2019, \"Gandolf\"],\n#     [\"831e5df1-a0e1-11e6-b9af-6d2c86545d91\", 33, \"Frodo\"],\n#     [\"831e5df0-a0e1-11e6-b9af-6d2c86545d91\", 50, \"Bilbo\"]\n#   ]\n# }\n```\n\n## Todo\n\n* [ ] Compression\n* [ ] Batch statement\n* [ ] Authentication and SSL encryption\n* [ ] User Defined Types\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafebazaar%2Felixir-cassandra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcafebazaar%2Felixir-cassandra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafebazaar%2Felixir-cassandra/lists"}