AshClickhouse.DataLayer.Record (AshClickhouse v0.6.2)

Copy Markdown View Source

Decodes raw ClickHouse rows/maps into Ash resource structs.

Extracted from AshClickhouse.DataLayer so the row→record decoding logic (UUID/atom type handling, column mapping, attribute-type-aware value decoding) lives in one focused module.

Summary

Functions

Decodes a value list positionally against the resource's attribute declaration order (used by the streaming path when no column names are known).

Decodes a single value list (positional, aligned to columns) into a record.

Converts a string to an existing atom, leaving it as a string otherwise.

Functions

to_ash_record(row, resource)

@spec to_ash_record(maybe_improper_list() | map(), module()) :: struct()

Decodes a value list positionally against the resource's attribute declaration order (used by the streaming path when no column names are known).

to_ash_record(row, resource, columns)

@spec to_ash_record(maybe_improper_list(), module(), maybe_improper_list() | nil) ::
  struct()

Decodes a single value list (positional, aligned to columns) into a record.

to_existing_atom(value)

@spec to_existing_atom(String.t()) :: atom() | String.t()

Converts a string to an existing atom, leaving it as a string otherwise.