hpqtypes 1.9.2.1 → 1.9.3.0
raw patch · 11 files changed
+207/−177 lines, 11 filesdep ~QuickCheckdep ~aesondep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck, aeson, base, monad-control
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- hpqtypes.cabal +11/−11
- libpqtypes/src/libpqtypes.h +8/−1
- src/Database/PostgreSQL/PQTypes/Internal/C/Get.hs +53/−50
- src/Database/PostgreSQL/PQTypes/Internal/C/Put.hs +53/−50
- src/Database/PostgreSQL/PQTypes/Internal/C/Types.hsc +2/−2
- src/Database/PostgreSQL/PQTypes/Internal/Monad.hs +0/−16
- test/Main.hs +11/−18
- test/Test/Aeson/Compat.hs +58/−0
- test/Test/QuickCheck/Arbitrary/Instances.hs +5/−5
- test/Test/QuickCheck/Compat.hs +0/−24
CHANGELOG.md view
@@ -1,3 +1,9 @@+# hpqtypes-1.9.3.0 (2022-02-25)+* Fix support for M1 chips.+* Add support for aeson >= 2.0.+* Add support for GHC 9.2.+* Drop support for GHC < 8.8.+ # hpqtypes-1.9.2.1 (2021-11-04) * Improve an SQL query that gets information about composite types.
hpqtypes.cabal view
@@ -1,5 +1,5 @@ name: hpqtypes-version: 1.9.2.1+version: 1.9.3.0 synopsis: Haskell bindings to libpqtypes description: Efficient and easy-to-use bindings to (slightly modified)@@ -39,8 +39,7 @@ category: Database build-type: Custom cabal-version: 1.24-tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.4- || ==9.0.1+tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.1 extra-source-files: README.md@@ -71,8 +70,8 @@ , libpqtypes/src/libpqtypes.h custom-setup- setup-depends: base >= 4.9 && < 5,- Cabal >= 1.24 && < 3.6,+ setup-depends: base >= 4.13 && < 5,+ Cabal >= 1.24 && < 3.7, directory, filepath @@ -124,9 +123,9 @@ , Database.PostgreSQL.PQTypes.Internal.C.Interface , Database.PostgreSQL.PQTypes.Internal.C.Get - build-depends: base >= 4.9 && < 5+ build-depends: base >= 4.13 && < 5 , text >= 0.11- , aeson >= 1.0 && < 2.0+ , aeson >= 1.0 , async >= 2.1.1.1 , bytestring >= 0.9 , semigroups >= 0.16@@ -173,6 +172,7 @@ default-language: Haskell2010 default-extensions: BangPatterns+ , CApiFFI , ConstraintKinds , DataKinds , DeriveFunctor@@ -205,17 +205,17 @@ hs-source-dirs: test main-is: Main.hs other-modules: Prelude.Instances- Test.QuickCheck.Compat+ Test.Aeson.Compat Test.QuickCheck.Arbitrary.Instances build-depends: hpqtypes- , base >= 4.9 && < 5+ , base >= 4.13 && < 5 , HUnit >= 1.2- , QuickCheck >= 2.5+ , QuickCheck >= 2.7 , aeson >= 0.6.2.0 , bytestring >= 0.9 , exceptions >= 0.6 , lifted-base >= 0.2- , monad-control >= 0.3+ , monad-control >= 1.0 , mtl >= 2.1 , random >= 1.0 , scientific
libpqtypes/src/libpqtypes.h view
@@ -478,8 +478,15 @@ PQT_EXPORT void PQlocalTZInfo(time_t *t, int *gmtoff, int *isdst, char **tzabbrp); +/* === in ffi.c === */++PQT_EXPORT void+PQfinishPtr(PGconn **conn);++PQT_EXPORT const char+pqt_hs_null_string_ptr[1];+ #ifdef __cplusplus } #endif #endif /* !LIBPQTYPES_H */-
src/Database/PostgreSQL/PQTypes/Internal/C/Get.hs view
@@ -8,85 +8,88 @@ import Database.PostgreSQL.PQTypes.Internal.C.Types -foreign import ccall unsafe "PQgetf"+-- For PQgetf, we use capi imports since ccall is broken for variadic functions.+-- See https://www.haskell.org/ghc/blog/20210709-capi-usage.html.++foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf1 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf2 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf3 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf4 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf5 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf6 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf7 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf8 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf9 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8 -> CInt -> Ptr t9 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf10 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8 -> CInt -> Ptr t9 -> CInt -> Ptr t10 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf11 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8 -> CInt -> Ptr t9 -> CInt -> Ptr t10 -> CInt -> Ptr t11 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf12 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8 -> CInt -> Ptr t9 -> CInt -> Ptr t10 -> CInt -> Ptr t11 -> CInt -> Ptr t12 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf13 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8 -> CInt -> Ptr t9 -> CInt -> Ptr t10 -> CInt -> Ptr t11 -> CInt -> Ptr t12 -> CInt -> Ptr t13 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf14 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -94,7 +97,7 @@ -> CInt -> Ptr t13 -> CInt -> Ptr t14 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf15 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -102,7 +105,7 @@ -> CInt -> Ptr t13 -> CInt -> Ptr t14 -> CInt -> Ptr t15 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf16 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -110,7 +113,7 @@ -> CInt -> Ptr t13 -> CInt -> Ptr t14 -> CInt -> Ptr t15 -> CInt -> Ptr t16 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf17 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -119,7 +122,7 @@ -> CInt -> Ptr t17 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf18 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -128,7 +131,7 @@ -> CInt -> Ptr t17 -> CInt -> Ptr t18 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf19 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -137,7 +140,7 @@ -> CInt -> Ptr t17 -> CInt -> Ptr t18 -> CInt -> Ptr t19 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf20 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -146,7 +149,7 @@ -> CInt -> Ptr t17 -> CInt -> Ptr t18 -> CInt -> Ptr t19 -> CInt -> Ptr t20 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf21 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -156,7 +159,7 @@ -> CInt -> Ptr t21 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf22 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -166,7 +169,7 @@ -> CInt -> Ptr t21 -> CInt -> Ptr t22 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf23 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -176,7 +179,7 @@ -> CInt -> Ptr t21 -> CInt -> Ptr t22 -> CInt -> Ptr t23 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf24 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -186,7 +189,7 @@ -> CInt -> Ptr t21 -> CInt -> Ptr t22 -> CInt -> Ptr t23 -> CInt -> Ptr t24 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf25 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -197,7 +200,7 @@ -> CInt -> Ptr t25 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf26 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -208,7 +211,7 @@ -> CInt -> Ptr t25 -> CInt -> Ptr t26 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf27 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -219,7 +222,7 @@ -> CInt -> Ptr t25 -> CInt -> Ptr t26 -> CInt -> Ptr t27 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf28 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -230,7 +233,7 @@ -> CInt -> Ptr t25 -> CInt -> Ptr t26 -> CInt -> Ptr t27 -> CInt -> Ptr t28 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf29 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -242,7 +245,7 @@ -> CInt -> Ptr t29 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf30 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -254,7 +257,7 @@ -> CInt -> Ptr t29 -> CInt -> Ptr t30 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf31 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -266,7 +269,7 @@ -> CInt -> Ptr t29 -> CInt -> Ptr t30 -> CInt -> Ptr t31 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf32 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -278,7 +281,7 @@ -> CInt -> Ptr t29 -> CInt -> Ptr t30 -> CInt -> Ptr t31 -> CInt -> Ptr t32 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf33 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -291,7 +294,7 @@ -> CInt -> Ptr t33 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf34 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -304,7 +307,7 @@ -> CInt -> Ptr t33 -> CInt -> Ptr t34 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf35 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -317,7 +320,7 @@ -> CInt -> Ptr t33 -> CInt -> Ptr t34 -> CInt -> Ptr t35 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf36 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -330,7 +333,7 @@ -> CInt -> Ptr t33 -> CInt -> Ptr t34 -> CInt -> Ptr t35 -> CInt -> Ptr t36 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf37 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -344,7 +347,7 @@ -> CInt -> Ptr t37 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf38 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -358,7 +361,7 @@ -> CInt -> Ptr t37 -> CInt -> Ptr t38 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf39 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -372,7 +375,7 @@ -> CInt -> Ptr t37 -> CInt -> Ptr t38 -> CInt -> Ptr t39 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf40 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -386,7 +389,7 @@ -> CInt -> Ptr t37 -> CInt -> Ptr t38 -> CInt -> Ptr t39 -> CInt -> Ptr t40 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf41 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -401,7 +404,7 @@ -> CInt -> Ptr t41 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf42 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -416,7 +419,7 @@ -> CInt -> Ptr t41 -> CInt -> Ptr t42 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf43 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -431,7 +434,7 @@ -> CInt -> Ptr t41 -> CInt -> Ptr t42 -> CInt -> Ptr t43 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf44 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -446,7 +449,7 @@ -> CInt -> Ptr t41 -> CInt -> Ptr t42 -> CInt -> Ptr t43 -> CInt -> Ptr t44 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf45 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -462,7 +465,7 @@ -> CInt -> Ptr t45 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf46 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -478,7 +481,7 @@ -> CInt -> Ptr t45 -> CInt -> Ptr t46 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf47 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -494,7 +497,7 @@ -> CInt -> Ptr t45 -> CInt -> Ptr t46 -> CInt -> Ptr t47 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf48 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -510,7 +513,7 @@ -> CInt -> Ptr t45 -> CInt -> Ptr t46 -> CInt -> Ptr t47 -> CInt -> Ptr t48 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf49 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8@@ -527,7 +530,7 @@ -> CInt -> Ptr t49 -> IO CInt -foreign import ccall unsafe "PQgetf"+foreign import capi unsafe "libpqtypes.h PQgetf" c_PQgetf50 :: Ptr PGresult -> Ptr PGerror -> CInt -> CString -> CInt -> Ptr t1 -> CInt -> Ptr t2 -> CInt -> Ptr t3 -> CInt -> Ptr t4 -> CInt -> Ptr t5 -> CInt -> Ptr t6 -> CInt -> Ptr t7 -> CInt -> Ptr t8
src/Database/PostgreSQL/PQTypes/Internal/C/Put.hs view
@@ -8,133 +8,136 @@ import Database.PostgreSQL.PQTypes.Internal.C.Types -foreign import ccall unsafe "PQputf"+-- For PQputf, we use capi imports since ccall is broken for variadic functions.+-- See https://www.haskell.org/ghc/blog/20210709-capi-usage.html.++foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf1 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf2 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf3 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf4 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf5 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf6 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf7 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf8 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf9 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf10 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf11 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf12 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf13 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf14 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf15 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf16 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> Ptr t16 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf17 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> Ptr t16 -> Ptr t17 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf18 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> Ptr t16 -> Ptr t17 -> Ptr t18 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf19 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> Ptr t16 -> Ptr t17 -> Ptr t18 -> Ptr t19 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf20 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> Ptr t16 -> Ptr t17 -> Ptr t18 -> Ptr t19 -> Ptr t20 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf21 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14 -> Ptr t15 -> Ptr t16 -> Ptr t17 -> Ptr t18 -> Ptr t19 -> Ptr t20 -> Ptr t21 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf22 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -142,7 +145,7 @@ -> Ptr t22 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf23 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -150,7 +153,7 @@ -> Ptr t22 -> Ptr t23 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf24 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -158,7 +161,7 @@ -> Ptr t22 -> Ptr t23 -> Ptr t24 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf25 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -166,7 +169,7 @@ -> Ptr t22 -> Ptr t23 -> Ptr t24 -> Ptr t25 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf26 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -174,7 +177,7 @@ -> Ptr t22 -> Ptr t23 -> Ptr t24 -> Ptr t25 -> Ptr t26 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf27 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -182,7 +185,7 @@ -> Ptr t22 -> Ptr t23 -> Ptr t24 -> Ptr t25 -> Ptr t26 -> Ptr t27 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf28 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -190,7 +193,7 @@ -> Ptr t22 -> Ptr t23 -> Ptr t24 -> Ptr t25 -> Ptr t26 -> Ptr t27 -> Ptr t28 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf29 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -199,7 +202,7 @@ -> Ptr t29 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf30 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -208,7 +211,7 @@ -> Ptr t29 -> Ptr t30 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf31 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -217,7 +220,7 @@ -> Ptr t29 -> Ptr t30 -> Ptr t31 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf32 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -226,7 +229,7 @@ -> Ptr t29 -> Ptr t30 -> Ptr t31 -> Ptr t32 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf33 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -235,7 +238,7 @@ -> Ptr t29 -> Ptr t30 -> Ptr t31 -> Ptr t32 -> Ptr t33 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf34 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -244,7 +247,7 @@ -> Ptr t29 -> Ptr t30 -> Ptr t31 -> Ptr t32 -> Ptr t33 -> Ptr t34 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf35 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -253,7 +256,7 @@ -> Ptr t29 -> Ptr t30 -> Ptr t31 -> Ptr t32 -> Ptr t33 -> Ptr t34 -> Ptr t35 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf36 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -263,7 +266,7 @@ -> Ptr t36 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf37 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -273,7 +276,7 @@ -> Ptr t36 -> Ptr t37 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf38 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -283,7 +286,7 @@ -> Ptr t36 -> Ptr t37 -> Ptr t38 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf39 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -293,7 +296,7 @@ -> Ptr t36 -> Ptr t37 -> Ptr t38 -> Ptr t39 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf40 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -303,7 +306,7 @@ -> Ptr t36 -> Ptr t37 -> Ptr t38 -> Ptr t39 -> Ptr t40 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf41 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -313,7 +316,7 @@ -> Ptr t36 -> Ptr t37 -> Ptr t38 -> Ptr t39 -> Ptr t40 -> Ptr t41 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf42 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -323,7 +326,7 @@ -> Ptr t36 -> Ptr t37 -> Ptr t38 -> Ptr t39 -> Ptr t40 -> Ptr t41 -> Ptr t42 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf43 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -334,7 +337,7 @@ -> Ptr t43 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf44 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -345,7 +348,7 @@ -> Ptr t43 -> Ptr t44 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf45 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -356,7 +359,7 @@ -> Ptr t43 -> Ptr t44 -> Ptr t45 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf46 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -367,7 +370,7 @@ -> Ptr t43 -> Ptr t44 -> Ptr t45 -> Ptr t46 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf47 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -378,7 +381,7 @@ -> Ptr t43 -> Ptr t44 -> Ptr t45 -> Ptr t46 -> Ptr t47 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf48 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -389,7 +392,7 @@ -> Ptr t43 -> Ptr t44 -> Ptr t45 -> Ptr t46 -> Ptr t47 -> Ptr t48 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf49 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14@@ -400,7 +403,7 @@ -> Ptr t43 -> Ptr t44 -> Ptr t45 -> Ptr t46 -> Ptr t47 -> Ptr t48 -> Ptr t49 -> IO CInt -foreign import ccall unsafe "PQputf"+foreign import capi unsafe "libpqtypes.h PQputf" c_PQputf50 :: Ptr PGparam -> Ptr PGerror -> CString -> Ptr t1 -> Ptr t2 -> Ptr t3 -> Ptr t4 -> Ptr t5 -> Ptr t6 -> Ptr t7 -> Ptr t8 -> Ptr t9 -> Ptr t10 -> Ptr t11 -> Ptr t12 -> Ptr t13 -> Ptr t14
src/Database/PostgreSQL/PQTypes/Internal/C/Types.hsc view
@@ -55,8 +55,8 @@ #include <libpqtypes.h> #include <libpq-fe.h> -foreign import ccall unsafe htonl :: Word32 -> Word32-foreign import ccall unsafe ntohl :: Word32 -> Word32+foreign import ccall unsafe "htonl" htonl :: Word32 -> Word32+foreign import ccall unsafe "ntohl" ntohl :: Word32 -> Word32 ----------------------------------------
src/Database/PostgreSQL/PQTypes/Internal/Monad.hs view
@@ -117,34 +117,18 @@ ---------------------------------------- instance MonadTransControl (DBT_ m) where-#if MIN_VERSION_monad_control(1,0,0) type StT (DBT_ m) a = StT (InnerDBT m) a liftWith = defaultLiftWith DBT unDBT restoreT = defaultRestoreT DBT {-# INLINE liftWith #-} {-# INLINE restoreT #-}-#else- newtype StT (DBT_ m) a = StDBT { unStDBT :: StT (InnerDBT m) a }- liftWith = defaultLiftWith DBT unDBT StDBT- restoreT = defaultRestoreT DBT unStDBT- {-# INLINE liftWith #-}- {-# INLINE restoreT #-}-#endif instance (m ~ n, MonadBaseControl b m) => MonadBaseControl b (DBT_ m n) where-#if MIN_VERSION_monad_control(1,0,0) type StM (DBT_ m n) a = ComposeSt (DBT_ m) m a liftBaseWith = defaultLiftBaseWith restoreM = defaultRestoreM {-# INLINE liftBaseWith #-} {-# INLINE restoreM #-}-#else- newtype StM (DBT m) a = StMDBT { unStMDBT :: ComposeSt (DBT_ m) m a }- liftBaseWith = defaultLiftBaseWith StMDBT- restoreM = defaultRestoreM unStMDBT- {-# INLINE liftBaseWith #-}- {-# INLINE restoreM #-}-#endif instance (m ~ n, MonadError e m) => MonadError e (DBT_ m n) where throwError = lift . throwError
test/Main.hs view
@@ -25,6 +25,7 @@ import Test.HUnit hiding (Test, assertEqual) import Test.QuickCheck import Test.QuickCheck.Gen+import Test.QuickCheck.Random import TextShow import qualified Data.ByteString as BS import qualified Data.Text as T@@ -33,32 +34,24 @@ import Data.Monoid.Utils import Database.PostgreSQL.PQTypes import Prelude.Instances ()+import Test.Aeson.Compat (Value0) import Test.QuickCheck.Arbitrary.Instances-import Test.QuickCheck.Compat type InnerTestEnv = StateT QCGen (DBT IO) newtype TestEnv a = TestEnv { unTestEnv :: InnerTestEnv a }- deriving ( Applicative, Functor, Monad- , MonadBase IO, MonadCatch, MonadDB, MonadMask, MonadThrow )+ deriving ( Applicative, Functor, Monad, MonadFail+ , MonadBase IO, MonadCatch, MonadDB, MonadMask, MonadThrow) instance MonadBaseControl IO TestEnv where-#if MIN_VERSION_monad_control(1,0,0) type StM TestEnv a = StM InnerTestEnv a liftBaseWith f = TestEnv $ liftBaseWith $ \run -> f $ run . unTestEnv restoreM = TestEnv . restoreM-#else- newtype StM TestEnv a = StTestEnv { unStTestEnv :: StM InnerTestEnv a }- liftBaseWith f = TestEnv $ liftBaseWith $ \run ->- f $ liftM StTestEnv . run . unTestEnv- restoreM = TestEnv . restoreM . unStTestEnv-#endif withQCGen :: (QCGen -> r) -> TestEnv r withQCGen f = do- gen <- TestEnv get- TestEnv . modify $ snd . next+ gen <- TestEnv $ state split return (f gen) ----------------------------------------@@ -368,7 +361,7 @@ forkNewConn $ notify chan payload mnt1 <- getNotification 100000 liftBase $ assertBool "Notification received" (isJust mnt1)- let Just nt1 = mnt1+ Just nt1 <- pure mnt1 assertEqualEq "Channels are equal" chan (ntChannel nt1) assertEqualEq "Payloads are equal" payload (ntPayload nt1) @@ -429,7 +422,7 @@ uuidTest :: TestData -> Test uuidTest td = testCase "UUID encoding / decoding test" $ do let uuidStr = "550e8400-e29b-41d4-a716-446655440000"- (Just uuid) = U.fromText uuidStr+ Just uuid <- pure $ U.fromText uuidStr runTestEnv td defaultTransactionSettings $ do runSQL_ $ mkSQL $ "SELECT '" `mappend` uuidStr `mappend` "' :: uuid" uuid2 <- fetchOne runIdentity@@ -525,10 +518,10 @@ , putGetTest td 1000 (u::BS.ByteString) (==) , putGetTest td 1000 (u::T.Text) (==) , putGetTest td 1000 (u::U.UUID) (==)- , putGetTest td 50 (u::JSON Value) (==)- , putGetTest td 50 (u::JSONB Value) (==)- , putGetTest td 20 (u::Array1 (JSON Value)) (==)- , putGetTest td 20 (u::Array1 (JSONB Value)) (==)+ , putGetTest td 50 (u::JSON Value0) (==)+ , putGetTest td 50 (u::JSONB Value0) (==)+ , putGetTest td 20 (u::Array1 (JSON Value0)) (==)+ , putGetTest td 20 (u::Array1 (JSONB Value0)) (==) , putGetTest td 50 (u::Interval) (==) , putGetTest td 1000000 (u::Day) (==) , putGetTest td 10000 (u::TimeOfDay) eqTOD
+ test/Test/Aeson/Compat.hs view
@@ -0,0 +1,58 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE DerivingStrategies #-}+module Test.Aeson.Compat+ ( fromList+ , Value0+ , mkValue0+ ) where++import Data.Aeson+import Data.Text (Text)++#if MIN_VERSION_aeson(2,0,0)++import Data.Bifunctor (first)+import qualified Data.Aeson.Key as K+import qualified Data.Aeson.KeyMap as KM++import Database.PostgreSQL.PQTypes.Internal.C.Types+import Database.PostgreSQL.PQTypes++fromList :: [(Text, v)] -> KM.KeyMap v+fromList = KM.fromList . map (first K.fromText)++newtype Value0 = Value0 { unValue0 :: Value }+ deriving newtype (Eq, Show)++instance ToSQL (JSON Value0) where+ type PQDest (JSON Value0) = PGbytea+ toSQL = aesonToSQL . unValue0 . unJSON++instance FromSQL (JSON Value0) where+ type PQBase (JSON Value0) = PGbytea+ fromSQL = fmap (JSON . Value0) . aesonFromSQL++instance ToSQL (JSONB Value0) where+ type PQDest (JSONB Value0) = PGbytea+ toSQL = aesonToSQL . unValue0 . unJSONB++instance FromSQL (JSONB Value0) where+ type PQBase (JSONB Value0) = PGbytea+ fromSQL = fmap (JSONB . Value0) . aesonFromSQL++mkValue0 :: Value -> Value0+mkValue0 = Value0++#else++import qualified Data.HashMap.Strict as HM++fromList :: [(Text, v)] -> HM.HashMap Text v+fromList = HM.fromList++type Value0 = Value++mkValue0 :: Value0 -> Value0+mkValue0 = id++#endif
test/Test/QuickCheck/Arbitrary/Instances.hs view
@@ -11,12 +11,12 @@ import Test.QuickCheck.Arbitrary import Test.QuickCheck.Gen import qualified Data.ByteString as BS-import qualified Data.HashMap.Strict as HM import qualified Data.Text as T import qualified Data.Vector as V import qualified Data.UUID.Types as U import Database.PostgreSQL.PQTypes+import qualified Test.Aeson.Compat as C newtype String0 = String0 { unString0 :: String } deriving (Eq, Ord, Show)@@ -64,8 +64,8 @@ instance Arbitrary Scientific where arbitrary = scientific <$> arbitrary <*> ((`mod` 100) <$> arbitrary) -instance Arbitrary Value where- arbitrary = value depth depth+instance Arbitrary C.Value0 where+ arbitrary = C.mkValue0 <$> value depth depth where depth :: Int depth = 3@@ -76,8 +76,8 @@ | otherwise = oneof $ leafs ++ branches where branches = [- Object . HM.fromList <$> shortListOf ((,) <$> arbitrary <*> subValue)- , Array . V.fromList <$> shortListOf subValue+ Object . C.fromList <$> shortListOf ((,) <$> arbitrary <*> subValue)+ , Array . V.fromList <$> shortListOf subValue ] leafs = [ String <$> arbitrary
− test/Test/QuickCheck/Compat.hs
@@ -1,24 +0,0 @@-{-# LANGUAGE CPP #-}-module Test.QuickCheck.Compat (- QCGen- , newQCGen- , mkQCGen- ) where--#if MIN_VERSION_QuickCheck(2,7,0)--import Test.QuickCheck.Random--#else--import System.Random--type QCGen = StdGen--newQCGen :: IO QCGen-newQCGen = newStdGen--mkQCGen :: Int -> QCGen-mkQCGen = mkStdGen--#endif