Permalink
Browse files

Add UUID to BuiltinTypes

  • Loading branch information...
lpsmith committed Jul 23, 2012
1 parent 5405faf commit 2e985d948d6818ca030d0133fb09dca932c399a3
Showing with 9 additions and 0 deletions.
  1. +8 −0 src/Database/PostgreSQL/Simple/BuiltinTypes.hs
  2. +1 −0 tools/GenBuiltinTypes.hs
@@ -71,6 +71,7 @@ data BuiltinType
| RefCursor
| Record
| Void
+ | UUID
deriving (Eq, Ord, Enum, Bounded, Read, Show, Typeable)
builtin2oid :: BuiltinType -> PQ.Oid
@@ -120,6 +121,7 @@ builtin2oid typ = PQ.Oid $ case typ of
RefCursor -> 1790
Record -> 2249
Void -> 2278
+ UUID -> 2950
oid2builtin :: PQ.Oid -> Maybe BuiltinType
oid2builtin (PQ.Oid x) = case x of
@@ -168,6 +170,7 @@ oid2builtin (PQ.Oid x) = case x of
1790 -> Just RefCursor
2249 -> Just Record
2278 -> Just Void
+ 2950 -> Just UUID
_ -> Nothing
builtin2typname :: BuiltinType -> ByteString
@@ -217,6 +220,7 @@ builtin2typname typ = case typ of
RefCursor -> refcursor
Record -> record
Void -> void
+ UUID -> uuid
oid2typname :: PQ.Oid -> Maybe ByteString
oid2typname (PQ.Oid x) = case x of
@@ -265,6 +269,7 @@ oid2typname (PQ.Oid x) = case x of
1790 -> Just refcursor
2249 -> Just record
2278 -> Just void
+ 2950 -> Just uuid
_ -> Nothing
bool :: ByteString
@@ -401,3 +406,6 @@ record = "record"
void :: ByteString
void = "void"
+
+uuid :: ByteString
+uuid = "uuid"
View
@@ -83,6 +83,7 @@ numeric
refcursor RefCursor
record
void
+uuid UUID
|]
instance IsString Blaze.Builder where

0 comments on commit 2e985d9

Please sign in to comment.