hasql-th 0.4.0.5 → 0.4.0.6
raw patch · 2 files changed
+27/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hasql-th.cabal +1/−1
- library/Hasql/TH/Syntax/Parsing.hs +26/−1
hasql-th.cabal view
@@ -1,5 +1,5 @@ name: hasql-th-version: 0.4.0.5+version: 0.4.0.6 category: Hasql, Database, PostgreSQL, Template Haskell synopsis: Template Haskell utilities for Hasql description:
library/Hasql/TH/Syntax/Parsing.hs view
@@ -1741,14 +1741,39 @@ >>> testParser typecastTypename "int4?[][]" TypecastTypename (UnquotedIdent "int4") True 2 False++>>> testParser typecastTypename "interval"+TypecastTypename (UnquotedIdent "interval") False 0 False++>>> testParser typecastTypename "time"+TypecastTypename (UnquotedIdent "time") False 0 False++>>> testParser typecastTypename "timestamp"+TypecastTypename (UnquotedIdent "timestamp") False 0 False++>>> testParser typecastTypename "timestamptz"+TypecastTypename (UnquotedIdent "timestamptz") False 0 False -} typecastTypename = label "type" $ do- _baseName <- typeFunctionName+ _baseName <- baseIdent endHead _baseNullable <- option False (True <$ space <* char '?') _arrayLevels <- fmap length $ many $ space *> char '[' *> endHead *> space *> char ']' _arrayNullable <- option False (True <$ space <* char '?') return (TypecastTypename _baseName _baseNullable _arrayLevels _arrayNullable)+ where+ {-+ A custom derivation from definition of SimpleTypename,+ wrapping up to a merger of "type_function_name" and "ConstInterval" and "ConstDatetime".+ -}+ baseIdent =+ ident <|>+ keywordNameFromSet set+ where+ set =+ HashSet.unreservedKeyword <> HashSet.typeFuncNameKeyword <>+ -- From defs of "ConstInterval" and "ConstDatetime":+ HashSet.fromList ["interval", "timestamp", "time"] -- * Clauses