on dev help sign in
Update RELEASE NOTES.md

some more composite notes

commit8e2dfb76232e2b442caabbc84a337c42b0cf7a63 authorEitan Chatav <eitan.chatav@gmail.com> dateMon 25 Jun 2018, 11:07 (8 years ago) parentdf89a4b
1 file changed+11−1
RELEASE NOTES.md+11−1
RELEASE NOTES.md+11−1
@@ -159,7 +159,17 @@ Composite types can be generated from a Haskell record type, for example:
159159>>> data Complex = Complex {real :: Maybe Double, imaginary :: Maybe Double} deriving GHC.Generic
160160>>> instance SOP.Generic Complex
161161>>> instance SOP.HasDatatypeInfo Complex
162−>>> printSQL $ createTypeCompositeFrom @Complex #complex
162+
163+>>> :kind! CompositeFrom Complex
164+CompositeFrom Complex :: PGType
165+= 'PGcomposite '['("real", 'PGfloat8), '("imaginary", 'PGfloat8)]
166+
167+>>> :{
168+let
169+ definition :: Definition '[] '["complex" ::: 'Typedef (CompositeFrom Complex)]
170+ definition = createTypeCompositeFrom @Complex #complex
171+in printSQL definition
172+:}
163173CREATE TYPE "complex" AS ("real" float8, "imaginary" float8);
164174```
165175