Snowflex.VariantField (Snowflex v1.4.1)

View Source

Shared predicate for identifying Ecto field types that map to Snowflake's VARIANT semi-structured type (:map, {:map, _}, {:array, _}).

This is the single source of truth used by both Snowflex (for insert/update via schema meta) and Snowflex.Ecto.Adapter.Connection (for update_all SQL generation).

Summary

Functions

Returns true if the given Ecto field type maps to a Snowflake VARIANT column.

Functions

variant_field?(arg1)

@spec variant_field?(term()) :: boolean()

Returns true if the given Ecto field type maps to a Snowflake VARIANT column.

Examples

iex> Snowflex.VariantField.variant_field?(:map)
true

iex> Snowflex.VariantField.variant_field?({:map, :string})
true

iex> Snowflex.VariantField.variant_field?({:array, :integer})
true

iex> Snowflex.VariantField.variant_field?(:string)
false