Belt v0.2.0 Belt.Ecto.Config
Ecto type for storing Belt.Provider config structs.
This Ecto type allows storing and retrieving Belt.Provider configurations without needing to perform manual conversions.
Usage
#in migrations
create table(:belt_providers) do
add :config, :map #Belt.Ecto.Config uses Ecto primitive :map
end
#in schemas
schema "belt_providers" do
field :config, Belt.Ecto.Config
end
Summary
Functions
Only valid provider config structs can be cast
Serializes config struct to Map primitive while preserving atoms
Loads config struct from serialized Map and restores existing atoms
Underlying Ecto primitive is a Map
Functions
Serializes config struct to Map primitive while preserving atoms.
Config structs that contain nested maps/structs or lists are currently not supported.