AGType decoder for PostgreSQL AGE graph data.
AGE returns text in formats like:
{"id": 844424930131969, "label": "Person", "properties": {"name": "Usman"}}::vertex
{"id": N, "label": "L", "end_id": N, "start_id": N, "properties": {...}}::edge
[{...}::vertex, {...}::edge, {...}::vertex, ...]::pathFor vertices and edges this module strips the type suffix, JSON-decodes the
body, and maps to the appropriate struct. A ::path body is NOT plain JSON:
each element is itself a fully tagged ::vertex/::edge agtype, so the path
decoder splits the array at top-level commas and recursively decodes each
element, then partitions the results into vertices and edges (order preserved).
Summary
Functions
Decodes an agtype string into an Elixir struct.
Functions
@spec decode(binary()) :: AshAge.Type.Vertex.t() | AshAge.Type.Edge.t() | AshAge.Type.Path.t() | term()
Decodes an agtype string into an Elixir struct.
Returns a %Vertex{}, %Edge{}, %Path{}, or a scalar value.