How to connect to Kassandra with Elixir

I included cqerl in my project Erlang driver for Elixir According to the documentation Erlang syntax for connection:

{ok, Client} = cqerl:new_client({}). 

I just don't know how to translate the above Elixir syntax.

+4
source share
1 answer

When you use Erlang through Elixir, you need to call the Erlang module as follows:

{:ok, client} = :cqerl.new_client({})

If you want to call Cassandra using a specific address, you can create a new client, as described in the cqerl documentation:

{:ok, client} = :cqerl.new_client({"127.0.0.1", 9042})

, ( , env , git):

{:ok, client} = :cqerl.new_client({"127.0.0.1", 9042}, , [{auth, {cqerl_auth_plain_handler, [{"Your-Username", "Your-Password"}]}}])
+10

All Articles