AshScylla is a data layer for Ash Framework that uses ScyllaDB (via Xandra).
Usage
Configure your Ash resource to use AshScylla.DataLayer:
defmodule MyApp.MyResource do
use Ash.Resource,
data_layer: AshScylla.DataLayer
attributes do
uuid_primary_key :id
attribute :name, :string
attribute :email, :string
end
endConfigure your repo to use AshScylla:
defmodule MyApp.Repo do
use AshScylla.Repo,
otp_app: :my_app
endThen configure your resource to use the repo:
# In your resource configuration
use Ash.Resource,
data_layer: AshScylla.DataLayer,
repo: MyApp.Repo
Summary
Functions
Creates the keyspace for a repo if it doesn't exist.
Runs migrations for all AshScylla resources against the given repo.
Returns the version of AshScylla.
Functions
Creates the keyspace for a repo if it doesn't exist.
Examples
AshScylla.create_keyspace(MyApp.Repo)
Runs migrations for all AshScylla resources against the given repo.
This is a convenience function for use in release tasks or scripts.
Options
:resources- List of specific resource modules to migrate (default: auto-discover):dry_run- If true, only log statements without executing:create_keyspace- Create the keyspace before migrating
Examples
AshScylla.migrate(MyApp.Repo)
AshScylla.migrate(MyApp.Repo, resources: [MyApp.User])
AshScylla.migrate(MyApp.Repo, dry_run: true)
@spec version() :: String.t()
Returns the version of AshScylla.