Ash DataLayer for ArcadeDB — the "ash_postgres of ArcadeDB". Executes through
the tenant-blind arcadic transport. Exposes an arcade do … end resource
section and implements the Ash.DataLayer behaviour.
use Ash.Resource, data_layer: AshArcadic.DataLayer
arcade do
client MyApp.ArcadicClient # module implementing AshArcadic.Client
label :Person # defaults to the short module name
skip [:computed]
sensitive [:ssn] # binary-storage-typed or skipped
# database "my_db" # per-resource default (non-:context)
# tenant_database {MyApp.Tenancy, :db_for, []} # :context override
endAdvertised capabilities (see can?/2 for the authoritative matrix): CRUD +
MERGE upserts + atomic SET, bulk writes (bulk_create, multi-row bulk
upsert, heterogeneous update_many, query-scoped update_query/
destroy_query), filter/sort/distinct/combinations push-down, offset +
keyset pagination (Ash.stream!), query + relationship aggregates,
expression calculations, standard relationships + Traverse manual
traversal + edge writes, dense/sparse/hybrid vector search, transactions,
:async_engine, telemetry. Multitenancy (:attribute + :context) is
fail-closed on every path; errors are value-free (no value, tenant, or byte
in a message). Per-feature fine print: usage-rules.md.
arcade
Configuration for the ArcadeDB data layer.
Nested DSLs
Options
| Name | Type | Default | Docs |
|---|---|---|---|
client | atom | Module implementing AshArcadic.Client (supplies the Arcadic.Conn). | |
database | String.t | Per-resource default database. Defaults to the client conn's database. Ignored for :context. | |
label | atom | String.t | Vertex label. Defaults to the resource's short module name. | |
skip | list(atom) | [] | Attribute names excluded from ArcadeDB properties. |
sensitive | list(atom) | [] | Attribute names classified as sensitive. Verifier (ValidateSensitive): each must be binary-storage-typed (app-side-encrypted bytes) or listed in skip. The verifier checks the type SHAPE — encrypting is the host app's job. |
tenant_database | mfa | MFA applied as apply(m, f, [tenant | a]) returning the ArcadeDB database name for a :context tenant. Defaults to a built-in collision-free encoder. |
arcade.edge
edge nameDefines an edge mapping from this vertex to a destination resource.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | Edge name (referenced by CreateEdge/DestroyEdge edge:). |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
label | atom | Edge label in the graph (a valid Arcadic.Identifier). | |
destination | atom | Destination resource module (single-attribute PK). | |
direction | :outgoing | :incoming | :both | :outgoing | Edge direction. |
properties | list(atom) | [] | Edge property keys, set from same-named declared action arguments. |
multiple? | boolean | false | false → idempotent MERGE (one edge per endpoint-pair+label); true → CREATE (parallel edges). |
Introspection
Target: AshArcadic.Edge
arcade.vector_index
vector_index nameDeclares a dense vector index on an attribute (metadata only — the host creates the index).
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | The vector attribute (a stored, non-sensitive, array-typed property). |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
dimensions | pos_integer | Embedding dimensionality (must equal the search vector's length). | |
similarity | :cosine | :dot_product | :euclidean | :cosine | Distance metric — drives distance/max_distance semantics. |
Introspection
Target: AshArcadic.VectorIndex
arcade.sparse_vector_index
sparse_vector_index nameDeclares a sparse vector index over a (tokens, weights) attribute pair (metadata only — the host creates the index).
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A logical index name (referenced by the vector-search preparation). |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
tokens | atom | The integer-array attribute holding token ids (stored, non-sensitive). | |
weights | atom | The float-array attribute holding the matching weights (stored, non-sensitive). |
Introspection
Target: AshArcadic.SparseVectorIndex