Skip to content

meetwalter/ecto_homoiconic_enum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EctoHomoiconicEnum

This is a rewrite of EctoEnum, with a much simpler goal.

EctoEnum assumes its storage is a dumb integer-typed DB field, and thus must create stable mappings between the atoms you provide it, and the integer keys they must serialize to.

EctoHomoiconicEnum assumes its storage is either a text-typed column, or a literal enum column with string serialization semantics (like a Postgres ENUM.) Such columns will both accept and return the string representations of the enum's values, so EctoHomoiconicEnum has no need to maintain mappings for its keys.

Instead, EctoHomoiconicEnum simply acts to validate that your keys are members of the values set you specify.

About

Enumerables for Ecto, without mapping to integers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages