View on GitHub

SqlFun

Idiomatic data access for F#

Download this project as a .zip file Download this project as a tar.gz file

Enum support

By default enums are represented as integer values.

type PostStatus = 
     | New = 0
     | Published = 1
     | Archived = 2

If you prefer more descriptive values in a database, you can override them using EnumValueAttribute:

type PostStatus = 
     | [<EnumValue("N")>] New = 0
     | [<EnumValue("P")>] Published = 1
     | [<EnumValue("A")>] Archived = 2

Arguments of EnumValueAttribute can be any values, that can be written do a database (integers, strings, etc.).