Last active
October 6, 2016 22:23
-
-
Save jamesbee/64aa3fb365d5b195f83e to your computer and use it in GitHub Desktop.
Elixir connect to cassandra example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cool! 👍 but how would I set the configuration of cqerl? like cluster and nodes? from within my elixir server?