Skip to content

Instantly share code, notes, and snippets.

@jamesbee
Last active October 6, 2016 22:23
Show Gist options
  • Save jamesbee/64aa3fb365d5b195f83e to your computer and use it in GitHub Desktop.
Save jamesbee/64aa3fb365d5b195f83e to your computer and use it in GitHub Desktop.
Elixir connect to cassandra example
defmodule Conn do
def test do
{ok, client} = :cqerl.new_client({})
{ok, result} = :cqerl.run_query(client, "SELECT * FROM demodb.users;")
rows = :cqerl.all_rows(result)
end
end
defmodule SomeProject.Mixfile do
use Mix.Project
##
# bla, bla, bla...
##
def application do
[applications: [:cqerl]]
end
defp deps do
[{:cqerl, github: "matehat/cqerl", ref: "HEAD"}]
end
end
@hopewise
Copy link

hopewise commented Jun 19, 2016

cool! 👍 but how would I set the configuration of cqerl? like cluster and nodes? from within my elixir server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment