Custom Ecto type for storing lists as comma-separated strings.
Useful for MySQL/SQLite databases that lack native array column types.
In PostgreSQL, prefer {:array, :string} for native array support.
Storage Format
Lists are stored as comma-separated strings in the database:
["profile:read", "sessions:write"] -> "profile:read,sessions:write"Usage
field :scopes, Sigra.Ecto.Types.StringList
Summary
Functions
Casts external input to a list of strings.
Dumps a list to a comma-separated string for database storage.
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Loads a comma-separated string from the database into a list.
Returns the underlying database type (:string).
Functions
Casts external input to a list of strings.
Accepts both lists and comma-separated strings.
Dumps a list to a comma-separated string for database storage.
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Loads a comma-separated string from the database into a list.
Returns {:ok, []} for nil values (no scopes stored).
Returns the underlying database type (:string).