AshArcadic.Identifier (AshArcadic v0.1.0)

Copy Markdown View Source

Identifier validation for values AshArcadic interpolates into Cypher or a database name (labels, database names, sort/PK/attribute field names). The allowlist is single-sourced in Arcadic.Identifier (letter-first, ≤128) — the same guard the transport applies — so labels and DB names satisfy the URL-path and statement rules by construction. Never interpolate a VALUE; values ride params. A failure carries the invalid-SHAPE fact only, never the offending string (AGENTS.md Rules 1 & 4).

Summary

Functions

Returns the identifier as a string, or raises a value-free ArgumentError.

Functions

validate!(name)

@spec validate!(atom() | String.t()) :: String.t()

Returns the identifier as a string, or raises a value-free ArgumentError.

Accepts a non-nil, non-boolean atom or a binary. Fails closed: nil, true/false, and any non-atom/non-binary term raise the same value-free ArgumentError rather than silently becoming the literal "nil"/"true" or a FunctionClauseError that could surface the argument in a stacktrace (AGENTS.md Rules 2 & 4). Callers pass DSL-static labels or resolved identifiers, never a runtime value.