hasql-dynamic-statements 0.2.0.1 → 0.2.0.2
raw patch · 2 files changed
+18/−2 lines, 2 filesdep ~ptrPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ptr
API changes (from Hackage documentation)
Files
- hasql-dynamic-statements.cabal +2/−2
- test/Main.hs +16/−0
hasql-dynamic-statements.cabal view
@@ -1,5 +1,5 @@ name: hasql-dynamic-statements-version: 0.2.0.1+version: 0.2.0.2 synopsis: Toolkit for constructing Hasql statements dynamically description: This library introduces into the Hasql ecosystem a new abstraction named Snippet,@@ -38,7 +38,7 @@ containers >=0.6 && <0.7, hasql >=1.4 && <1.5, hasql-implicits >=0.1 && <0.2,- ptr >=0.16.6 && <0.17+ ptr >=0.16.7.2 && <0.17 test-suite test type: exitcode-stdio-1.0
test/Main.hs view
@@ -14,6 +14,9 @@ import qualified Hasql.Connection as Connection import qualified Hasql.DynamicStatements.Snippet as Snippet import qualified Hasql.DynamicStatements.Session as Session+import qualified Hasql.DynamicStatements.Statement as Statement+import qualified Data.ByteString as ByteString+import qualified Data.ByteString.Char8 as ByteStringChar8 main =@@ -36,6 +39,19 @@ assertEqual "" (Right (Right "bcd")) =<< sample "abcd" (Just 2) (Just 3) assertEqual "" (Right (Right "abc")) =<< sample "abcd" Nothing (Just 3) assertEqual "" (Right (Right "bcd")) =<< sample "abcd" (Just 2) Nothing+ ,+ testGroup "Regression" [+ testCase "Missing $ for 1000th parameter string #2" $ let+ snippet =+ "SELECT 1 " <> (foldMap @[] ("," <>) $ replicate 1001 $ Snippet.param (10::Int64))+ statement =+ Statement.dynamicallyParameterized snippet Decoders.noResult+ sql =+ case statement of+ Statement.Statement x _ _ _ -> x+ in do+ assertBool (ByteStringChar8.unpack sql) (isJust (ByteString.findSubstring "$1000" sql))+ ] ] runSession :: Session.Session a -> IO (Either Connection.ConnectionError (Either Session.QueryError a))