hasql 0.1.6 → 0.2.0
raw patch · 3 files changed
+51/−10 lines, 3 filesdep +HTFdep ~base-preludedep ~hasqldep ~hasql-backendPVP ok
version bump matches the API change (PVP)
Dependencies added: HTF
Dependency ranges changed: base-prelude, hasql, hasql-backend, hasql-postgres
API changes (from Hackage documentation)
Files
- hasql.cabal +28/−5
- library/Hasql.hs +1/−5
- tests/Main.hs +22/−0
hasql.cabal view
@@ -1,7 +1,7 @@ name: hasql version:- 0.1.6+ 0.2.0 synopsis: A minimalistic general high level API for relational databases description:@@ -42,7 +42,7 @@ . * <http://nikita-volkov.github.io/hasql-benchmarks/ Benchmarks analysis>. .- * <http://hackage.haskell.org/package/hasql-0.1.6/src/demo/Main.hs Basic tutorial-demo>.+ * <https://github.com/nikita-volkov/hasql/blob/master/demo/Main.hs Basic tutorial-demo>. . * <http://hackage.haskell.org/package/hasql-postgres PostgreSQL backend>. .@@ -92,7 +92,7 @@ exposed-modules: Hasql build-depends:- hasql-backend == 0.1.*,+ hasql-backend == 0.2.*, -- template-haskell: template-haskell >= 2.8 && < 2.10, -- parsing:@@ -121,6 +121,29 @@ base >= 4.5 && < 4.8 +test-suite tests+ type: + exitcode-stdio-1.0+ hs-source-dirs: + tests+ main-is: + Main.hs+ ghc-options:+ -threaded+ "-with-rtsopts=-N"+ -funbox-strict-fields+ default-extensions:+ Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFunctor, DeriveGeneric, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, ImpredicativeTypes, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ default-language:+ Haskell2010+ build-depends:+ HTF == 0.12.*,+ hasql == 0.2.*,+ hasql-backend == 0.2.*,+ base-prelude == 0.1.*,+ base >= 4.5 && < 4.8++ -- Well, it's not a benchmark actually, -- but in Cabal there's no better way to specify an executable, -- which is not intended for distribution.@@ -139,8 +162,8 @@ default-language: Haskell2010 build-depends:- hasql-postgres == 0.3.*,- hasql == 0.1.*,+ hasql-postgres == 0.7.*,+ hasql == 0.2.*, transformers >= 0.2 && < 0.5, base >= 4.5 && < 4.8
library/Hasql.hs view
@@ -315,11 +315,7 @@ statementF s n = TH.LamE (map TH.VarP argNames)- (TH.AppE - (TH.AppE - (TH.ConE '(,))- (statementE))- (argsE))+ (THUtil.purify [|(,,) $(pure statementE) $(pure argsE) True|]) where argNames = map (TH.mkName . ('_' :) . show) [1 .. n]
+ tests/Main.hs view
@@ -0,0 +1,22 @@+{-# OPTIONS_GHC -F -pgmF htfpp #-}+import BasePrelude+import Test.Framework+import qualified Hasql as H+import qualified Hasql.Backend as HB++main = + htfMain $ htf_thisModulesTests++data X+instance HB.Backend X where+ data StatementArgument X = + StatementArgument String+ deriving (Eq, Show)+instance HB.Mapping X Char where+ renderValue = StatementArgument . show+++test_quasiQuoterGeneratesAProperStatement =+ assertEqual + (" SELECT ? ", [HB.renderValue 'a'], True)+ ([H.q| SELECT ? |] 'a' :: HB.Statement X)