on dev help sign in
Update RELEASE NOTES.md

enum type notes

commitaa91c353c6e66426bc349bc37d084fc0af27b153 authorEitan Chatav <eitan.chatav@gmail.com> dateMon 25 Jun 2018, 10:00 (8 years ago) parent89173fa
1 file changed+25−1
RELEASE NOTES.md+25−1
RELEASE NOTES.md+25−1
@@ -1,6 +1,6 @@
11## RELEASE NOTES
22
3−### Version 0.3.0.0 - June 23, 2018
3+### Version 0.3 - June 23, 2018
44
55Version 0.3 of Squeal adds views as well as composite and enumerated types to Squeal.
66To support these features, a new kind `SchemumType` was added.
@@ -89,6 +89,30 @@ in printSQL query
8989SELECT * FROM "bc" AS "bc"
9090```
9191
92+**Enumerated Types**
93+
94+PostgreSQL has a powerful type system. It even allows for user defined types.
95+For instance, you can define enumerated types which are data types that comprise
96+a static, ordered set of values. An example of an enum type might be the days of the week,
97+or a set of status values for a piece of data.
98+
99+Enumerated types are created using the `createTypeEnum` command, for example
100+
101+```Haskell
102+>>> printSQL $ createTypeEnum #mood (label @"sad" :* label @"ok" :* label @"happy" :* Nil)
103+CREATE TYPE "mood" AS ENUM ('sad', 'ok', 'happy');
104+```
105+
106+Enumerated types can also be generated from a Haskell type, for example
107+
108+```Haskell
109+>>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
110+>>> instance SOP.Generic Schwarma
111+>>> instance SOP.HasDatatypeInfo Schwarma
112+>>> printSQL $ createTypeEnumFrom @Schwarma #schwarma
113+CREATE TYPE "schwarma" AS ENUM ('Beef', 'Lamb', 'Chicken');
114+```
115+
92116### Version 0.2.1 - April 7, 2018
93117
94118This minor update fixes an issue where alias identifiers could conflict with