queryparser-vertica 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+14/−13 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +4/−0
- queryparser-vertica.cabal +4/−4
- src/Database/Sql/Vertica/Type.hs +6/−9
+ CHANGELOG.md view
@@ -0,0 +1,4 @@+# 0.1 to 0.2++## 0.1.0 to 0.1.1+- Upgraded to GHC8, base 4.9
queryparser-vertica.cabal view
@@ -6,7 +6,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.0+version: 0.1.0.1 -- A short (one-line) description of the package. synopsis: Parsing for Vertica SQL queries@@ -42,7 +42,7 @@ -- Extra files to be distributed with the package, such as examples or a -- README.--- extra-source-files:+extra-source-files: CHANGELOG.md -- Constraint on the version of Cabal needed to build this package. cabal-version: >=1.10@@ -65,7 +65,7 @@ , Database.Sql.Vertica.Parser.Shared -- Modules included in this library but not exported.- -- other-modules: + -- other-modules: default-extensions: OverloadedStrings , LambdaCase@@ -75,7 +75,7 @@ , FlexibleInstances -- Other library packages from which modules are imported.- build-depends: base >=4.8 && <4.9+ build-depends: base >=4.9 && <4.11 , text >=1.2 && <1.3 , bytestring , queryparser
src/Database/Sql/Vertica/Type.hs view
@@ -52,6 +52,7 @@ import Data.Maybe (catMaybes) import Data.Semigroup import Data.Text.Lazy (Text)+import Data.Traversable (traverse) import Data.Aeson (ToJSON (..), (.=)) import qualified Data.Aeson as JSON@@ -110,16 +111,12 @@ deriving instance ConstrainSASNames Foldable r => Foldable (TableInfo r) deriving instance ConstrainSASNames Traversable r => Traversable (TableInfo r) -overJust :: Applicative f => (t -> f a) -> Maybe t -> f (Maybe a)-overJust _ Nothing = pure Nothing-overJust f (Just x) = Just <$> f x- resolveTableInfo :: TableInfo RawNames a -> Resolver (TableInfo ResolvedNames) a resolveTableInfo TableInfo{..} = do- tableInfoOrdering' <- overJust (mapM $ resolveOrder []) tableInfoOrdering- tableInfoEncoding' <- overJust resolveTableEncoding tableInfoEncoding- tableInfoSegmentation' <- overJust resolveSegmentation tableInfoSegmentation- tableInfoPartitioning' <- overJust resolvePartitioning tableInfoPartitioning+ tableInfoOrdering' <- traverse (mapM $ resolveOrder []) tableInfoOrdering+ tableInfoEncoding' <- traverse resolveTableEncoding tableInfoEncoding+ tableInfoSegmentation' <- traverse resolveSegmentation tableInfoSegmentation+ tableInfoPartitioning' <- traverse resolvePartitioning tableInfoPartitioning pure TableInfo { tableInfoOrdering = tableInfoOrdering' , tableInfoEncoding = tableInfoEncoding'@@ -444,7 +441,7 @@ resolveVerticaStatement (VerticaCreateProjectionStatement CreateProjection{..}) = do WithColumns createProjectionQuery' columns <- resolveQueryWithColumns createProjectionQuery bindColumns columns $ do- createProjectionSegmentation' <- overJust resolveSegmentation createProjectionSegmentation+ createProjectionSegmentation' <- traverse resolveSegmentation createProjectionSegmentation pure $ VerticaCreateProjectionStatement CreateProjection { createProjectionQuery = createProjectionQuery' , createProjectionSegmentation = createProjectionSegmentation'