Cassandra.Ecto v0.5.1 Cassandra.Ecto
Ecto integration for Apache Cassandra.
Cassandra adapter implements 3 behaviours:
Every behaviour implementation stays in separate file with appropriate docs. Please view for more information:
Usage example
# In your config/config.exs file
config :my_app, Repo,
keyspace: "my_keyspace"
# In your application code
defmodule Repo do
use Ecto.Repo,
otp_app: :my_app,
adapter: Cassandra.Ecto
end
defmodule Post do
use Ecto.Model
@primary_key {:id, :binary_id, autogenerate: true}
schema "posts" do
field :title, :string
field :text, :string
field :tags, {:array, :string}
timestamps()
end
end
defmodule Simple do
import Ecto.Query
def sample_query do
query = from p in Post, where: "elixir" in p.tags
Repo.all(query, allow_filtering: true)
end
end
Available connection options
:nodes
:keyspace
:auth
:ssl
:protocol_version
:pool_max_size
:pool_min_size
:pool_cull_interval
By default nodes: [{"127.0.0.1", 9042}]
Please see CQErl connecting for other options information.
Summary
Functions
Returns the childspec that starts the adapter process
Ensure all applications necessary to run the adapter are started
Checks if the adapter supports ddl transaction
Functions
Returns the childspec that starts the adapter process.
Callback implementation for Ecto.Adapter.child_spec/2
.
Ensure all applications necessary to run the adapter are started.
Callback implementation for Ecto.Adapter.ensure_all_started/2
.
Checks if the adapter supports ddl transaction.
Callback implementation for Ecto.Adapter.Migration.supports_ddl_transaction?/0
.