AshArcadic.DataLayer

Copy Markdown View Source

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
end

Advertised 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

NameTypeDefaultDocs
clientatomModule implementing AshArcadic.Client (supplies the Arcadic.Conn).
databaseString.tPer-resource default database. Defaults to the client conn's database. Ignored for :context.
labelatom | String.tVertex label. Defaults to the resource's short module name.
skiplist(atom)[]Attribute names excluded from ArcadeDB properties.
sensitivelist(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_databasemfaMFA 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 name

Defines an edge mapping from this vertex to a destination resource.

Arguments

NameTypeDefaultDocs
nameatomEdge name (referenced by CreateEdge/DestroyEdge edge:).

Options

NameTypeDefaultDocs
labelatomEdge label in the graph (a valid Arcadic.Identifier).
destinationatomDestination resource module (single-attribute PK).
direction:outgoing | :incoming | :both:outgoingEdge direction.
propertieslist(atom)[]Edge property keys, set from same-named declared action arguments.
multiple?booleanfalsefalse → idempotent MERGE (one edge per endpoint-pair+label); true → CREATE (parallel edges).

Introspection

Target: AshArcadic.Edge

arcade.vector_index

vector_index name

Declares a dense vector index on an attribute (metadata only — the host creates the index).

Arguments

NameTypeDefaultDocs
nameatomThe vector attribute (a stored, non-sensitive, array-typed property).

Options

NameTypeDefaultDocs
dimensionspos_integerEmbedding dimensionality (must equal the search vector's length).
similarity:cosine | :dot_product | :euclidean:cosineDistance metric — drives distance/max_distance semantics.

Introspection

Target: AshArcadic.VectorIndex

arcade.sparse_vector_index

sparse_vector_index name

Declares a sparse vector index over a (tokens, weights) attribute pair (metadata only — the host creates the index).

Arguments

NameTypeDefaultDocs
nameatomA logical index name (referenced by the vector-search preparation).

Options

NameTypeDefaultDocs
tokensatomThe integer-array attribute holding token ids (stored, non-sensitive).
weightsatomThe float-array attribute holding the matching weights (stored, non-sensitive).

Introspection

Target: AshArcadic.SparseVectorIndex