summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphadej <>2018-09-24 21:10:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-09-24 21:10:00 (GMT)
commite9dc6ad6f75e3e4ac59e4bb15eeb1963fa1d158d (patch)
treef56e8ce2d5648a52f971dbe9a435a2cbc5660bf2
parented0622b71f1ae335600f48c6b6a8116b4a8f098d (diff)
version 0.9.4.2HEAD0.9.4.2master
-rw-r--r--CHANGELOG.md6
-rw-r--r--postgresql-libpq.cabal41
-rw-r--r--test/Smoke.hs29
3 files changed, 62 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..30f5f4f
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,6 @@
+0.9.4.2
+-------
+
+- Support GHC-8.6.1
+- Add simple smoke test
+
diff --git a/postgresql-libpq.cabal b/postgresql-libpq.cabal
index 583d114..16e751e 100644
--- a/postgresql-libpq.cabal
+++ b/postgresql-libpq.cabal
@@ -1,5 +1,5 @@
Name: postgresql-libpq
-Version: 0.9.4.1
+Version: 0.9.4.2
Synopsis: low-level binding to libpq
Description: This is a binding to libpq: the C application
@@ -9,11 +9,11 @@ Description: This is a binding to libpq: the C application
backend server and to receive the results of
these queries.
-Homepage: https://github.com/lpsmith/postgresql-libpq
+Homepage: https://github.com/phadej/postgresql-libpq
License: BSD3
License-file: LICENSE
Author: Grant Monroe, Leon P Smith, Joey Adams
-Maintainer: Leon P Smith <leon@melding-monads.com>
+Maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
Copyright: (c) 2010 Grant Monroe
(c) 2011 Leon P Smith
Category: Database
@@ -29,11 +29,15 @@ Tested-with:
GHC==7.10.3,
GHC==8.0.2,
GHC==8.2.2,
- GHC==8.4.1
+ GHC==8.4.3,
+ GHC==8.6.1
+
+extra-source-files:
+ CHANGELOG.md
Custom-setup
setup-depends:
- base >= 4.3 && <5, Cabal >= 1.10 && <2.3
+ base >= 4.3 && <5, Cabal >= 1.10 && <2.5
-- If true, use pkg-config, otherwise use the pg_config based build
-- configuration
@@ -47,19 +51,19 @@ Library
include-dirs: cbits
Exposed-modules: Database.PostgreSQL.LibPQ
Database.PostgreSQL.LibPQ.Internal
- Build-depends: base >= 4.3 && < 5
- , bytestring
+ Build-depends: base >=4.3 && <4.13
+ , bytestring >=0.9.1.0 && <0.11
if !os(windows)
- Build-depends: unix
+ Build-depends: unix >=2.4.2.0 && <2.8
if os(windows)
- Build-depends: Win32
-
+ Build-depends: Win32 >=2.2.0.2 && <2.7
GHC-Options: -Wall
+
if flag(use-pkg-config)
- Pkgconfig-depends: libpq
+ Pkgconfig-depends: libpq >=9.3
else
if os(windows)
-- Due to https://sourceware.org/bugzilla/show_bug.cgi?id=22948,
@@ -76,11 +80,20 @@ Library
-- Other-modules:
Build-tools: hsc2hs
+test-suite smoke
+ type: exitcode-stdio-1.0
+ main-is: Smoke.hs
+ hs-source-dirs: test
+ build-depends:
+ base,
+ bytestring,
+ postgresql-libpq
+
source-repository head
type: git
- location: https://github.com/lpsmith/postgresql-libpq
+ location: https://github.com/phadej/postgresql-libpq
source-repository this
type: git
- location: https://github.com/lpsmith/postgresql-libpq
- tag: v0.9.4.1
+ location: https://github.com/phadej/postgresql-libpq
+ tag: v0.9.4.0
diff --git a/test/Smoke.hs b/test/Smoke.hs
new file mode 100644
index 0000000..7a04892
--- /dev/null
+++ b/test/Smoke.hs
@@ -0,0 +1,29 @@
+module Main (main) where
+
+import Database.PostgreSQL.LibPQ
+import System.Environment (getEnvironment)
+
+import qualified Data.ByteString.Char8 as BS8
+
+main :: IO ()
+main = do
+ env <- getEnvironment
+ case lookup "DATABASE_CONNSTRING" env of
+ Nothing -> putStrLn "Set DATABASE_CONNSTRING environment variable"
+ Just s -> smoke (BS8.pack s)
+
+smoke :: BS8.ByteString -> IO ()
+smoke connstring = do
+ conn <- connectdb connstring
+
+ -- status functions
+ db conn >>= print
+ user conn >>= print
+ host conn >>= print
+ port conn >>= print
+ status conn >>= print
+ transactionStatus conn >>= print
+ protocolVersion conn >>= print
+ serverVersion conn >>= print
+
+ finish conn