Exqlite.TypeExtension behaviour (Exqlite v0.32.0)

View Source

A behaviour that defines the API for extensions providing custom data loaders and dumpers for Ecto schemas.

Summary

Callbacks

Takes a value and convers it to data suitable for storage in the database.

Callbacks

convert(value)

@callback convert(value :: term()) :: {:ok, term()} | {:error, reason :: term()} | nil

Takes a value and convers it to data suitable for storage in the database.

Returns a tagged :ok/:error tuple. If the value is not convertable by this extension, returns nil.