Current section
Files
Jump to
Current section
Files
ash_arcadic
README.md
README.md
<!--
SPDX-FileCopyrightText: 2026 BaseLabs Holdings LLC
SPDX-License-Identifier: MIT
-->
# AshArcadic
[](https://github.com/baselabs/ash_arcadic/actions/workflows/ci.yml)
[](https://hex.pm/packages/ash_arcadic)
[](https://hexdocs.pm/ash_arcadic)
[](https://api.reuse.software/info/github.com/baselabs/ash_arcadic)
[](LICENSE)
AshArcadic is the [Ash Framework](https://hexdocs.pm/ash) data layer for
[ArcadeDB](https://arcadedb.com). Define Ash resources backed by an ArcadeDB
graph and use Ash actions to read and write them.
- Use Ash actions for graph records, including bulk writes and upserts.
- Load related records through graph edges and run ranked searches through read actions.
- Scope graph operations by tenant and enforce storage rules for sensitive attributes.
- Mirror PostgreSQL changes with the optional CDC sink, which commits its checkpoint
with the corresponding graph writes.
## Installation
In a project with Igniter, run `mix igniter.install ash_arcadic` to create a client
and configure Ash setup aliases. For manual installation, add the dependency and
run `mix deps.get`.
```elixir
{:ash_arcadic, "~> 4.1"}
```
## Example
Set `config :ash, default_string_length_count: :codepoints` if your application
has no string-length rule. Register `MyApp.Graph` in the application's
`:ash_domains` config. Use an existing ArcadeDB database. Set
`ARCADEDB_URL`, `ARCADEDB_DATABASE`, `ARCADEDB_USERNAME`, and `ARCADEDB_PASSWORD`
in the application's environment.
```elixir
defmodule MyApp.GraphClient do
@behaviour AshArcadic.Client
@impl true
def conn do
Arcadic.connect(
System.fetch_env!("ARCADEDB_URL"),
System.fetch_env!("ARCADEDB_DATABASE"),
auth: {System.fetch_env!("ARCADEDB_USERNAME"), System.fetch_env!("ARCADEDB_PASSWORD")}
)
end
end
defmodule MyApp.Document do
use Ash.Resource, domain: MyApp.Graph, data_layer: AshArcadic.DataLayer
arcade do
client MyApp.GraphClient
label :Document
end
attributes do
uuid_primary_key :id
attribute :title, :string, allow_nil?: false
end
actions do
default_accept [:title]
defaults [:create, :read]
end
end
defmodule MyApp.Graph do
use Ash.Domain
resources do
resource MyApp.Document
end
end
```
```elixir
Ash.create!(MyApp.Document, %{title: "Field notes"})
Ash.read!(MyApp.Document)
```
## Tutorials
- [Tour AshArcadic in Livebook](documentation/tutorials/tour.livemd)
## Topics
- [Resources and connections](documentation/topics/resources/resources.md)
- [Multitenancy and sensitive data](documentation/topics/resources/multitenancy.md)
- [Relationships and traversal](documentation/topics/resources/relationships.md)
- [Reads and expressions](documentation/topics/queries/reads.md)
- [Writes and transactions](documentation/topics/queries/writes.md)
- [Ranked search](documentation/topics/queries/ranked-search.md)
- [PostgreSQL change data capture](documentation/topics/replication/cdc.md)
## How-to
- [Generate and run migrations](documentation/how-to/generate-migrations.md)
- [Troubleshoot an operation](documentation/how-to/troubleshooting.md)
- [Tune storage and indexing](documentation/how-to/performance.md)
- [Upgrade AshArcadic](documentation/how-to/upgrading.md)
- [Verify release archives](documentation/how-to/verify-release.md)
## Reference
- [Data layer DSL](documentation/dsls/DSL-AshArcadic.DataLayer.md)
- [CDC resource DSL](documentation/dsls/DSL-AshArcadic.Replicant.md)
- [Telemetry events](documentation/topics/operations/telemetry.md)
- [Usage rules](usage-rules.md)
## Compatibility
See [Compatibility](documentation/topics/about-ash-arcadic/compatibility.md) for supported toolchains, database versions, and dependency requirements.
## License
[MIT](LICENSE).