Configuration module for AshScylla using direct Xandra connections.
Usage
defmodule MyApp.Repo do
use AshScylla.Repo,
otp_app: :my_app
endThen configure it in config/config.exs:
config :my_app, MyApp.Repo,
nodes: ["127.0.0.1:9042"],
keyspace: "my_app_dev"Adding to your supervision tree
children = [
MyApp.Repo,
# ...
]Options
:nodes- List of ScyllaDB/Cassandra nodes to connect to:keyspace- The keyspace to use:connect_timeout- TCP connection timeout in ms (default: 5000)
Summary
Functions
Converts repo config to Xandra connection options.
Callbacks
@callback child_spec(keyword()) :: Supervisor.child_spec()
@callback config() :: keyword()
@callback connection() :: AshScylla.Connection.t() | nil
@callback keyspace() :: String.t() | nil
@callback nodes() :: [String.t()]
@callback prepare( String.t(), keyword() ) :: {:ok, Xandra.Prepared.t()} | {:error, term()}
@callback prepare!( String.t(), keyword() ) :: Xandra.Prepared.t() | no_return()