Skip to content

Updates 2019-09-19 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.5.20190908
# version: 0.5.20190916
#
language: c
dist: xenial
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Patches welcome!

- If you are only going to bump bounds:
- If it's really **only bounds**, please simply open an issue (so you'll have a URL to refer to). I have a semi-automated process to make revisions, pull requests only disturb it.
- If patch includes **source code change** (i.e. I'll need to make a release), and it's a patch to support **newer base/GHC version**:
- Amend `tested-with` to include that GHC
- Regenerate `.travis.yml` with `haskell-ci regenerate` (get the latest from [GitHub haskell-ci/haskell-ci](https://github.com/haskell-ci/haskell-ci))

- Don't edit `CHANGELOG.md`, rather include a copyable entry in your pull request description. I often process pull requests in bulk, and everyone editing the `CHANGELOG.md` causes unnecessary conflicts.

- I use [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell) to format imports. I encourage you to use it too, when contributing.
- General code style is 4 spaces, just look around how it looks, it's not so strict.
132 changes: 71 additions & 61 deletions postgresql-libpq.cabal
Original file line number Diff line number Diff line change
@@ -1,95 +1,105 @@
Name: postgresql-libpq
Version: 0.9.4.2
x-revision: 1
Synopsis: low-level binding to libpq

Description: This is a binding to libpq: the C application
programmer's interface to PostgreSQL. libpq is a
set of library functions that allow client
programs to pass queries to the PostgreSQL
backend server and to receive the results of
these queries.

Homepage: https://github.com/phadej/postgresql-libpq
License: BSD3
License-file: LICENSE
Author: Grant Monroe, Leon P Smith, Joey Adams
Maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
Copyright: (c) 2010 Grant Monroe
(c) 2011 Leon P Smith
Category: Database
Build-type: Custom
Extra-source-files: cbits/noticehandlers.h
Cabal-version: >=1.8
Tested-with:
GHC==7.0.4,
GHC==7.2.2,
GHC==7.4.2,
GHC==7.6.3,
GHC==7.8.4,
GHC==7.10.3,
GHC==8.0.2,
GHC==8.2.2,
GHC==8.4.4,
GHC==8.6.5,
GHC==8.8.1

extra-source-files:
CHANGELOG.md

Custom-setup
name: postgresql-libpq
version: 0.9.4.2
x-revision: 1
synopsis: low-level binding to libpq
description:
This is a binding to libpq: the C application
programmer's interface to PostgreSQL. libpq is a
set of library functions that allow client
programs to pass queries to the PostgreSQL
backend server and to receive the results of
these queries.

homepage: https://github.com/phadej/postgresql-libpq
license: BSD3
license-file: LICENSE
author: Grant Monroe, Leon P Smith, Joey Adams
maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
copyright:
(c) 2010 Grant Monroe
(c) 2011 Leon P Smith

category: Database
build-type: Custom
extra-source-files: cbits/noticehandlers.h
cabal-version: >=1.8
tested-with:
GHC ==7.0.4
|| ==7.2.2
|| ==7.4.2
|| ==7.6.3
|| ==7.8.4
|| ==7.10.3
|| ==8.0.2
|| ==8.2.2
|| ==8.4.4
|| ==8.6.5
|| ==8.8.1

extra-source-files: CHANGELOG.md

custom-setup
setup-depends:
base >= 4.3 && <5, Cabal >= 1.10 && <3.1
base >=4.3 && <5
, Cabal >=1.10 && <3.1

-- If true, use pkg-config, otherwise use the pg_config based build
-- configuration
Flag use-pkg-config
flag use-pkg-config
default: False
manual: True

Library
hs-source-dirs: src
c-sources: cbits/noticehandlers.c
include-dirs: cbits
Exposed-modules: Database.PostgreSQL.LibPQ
Database.PostgreSQL.LibPQ.Internal
Build-depends: base >=4.3 && <4.14
, bytestring >=0.9.1.0 && <0.11
library
hs-source-dirs: src
c-sources: cbits/noticehandlers.c
include-dirs: cbits
exposed-modules:
Database.PostgreSQL.LibPQ
Database.PostgreSQL.LibPQ.Internal

build-depends:
base >=4.3 && <4.14
, bytestring >=0.9.1.0 && <0.11

if !os(windows)
Build-depends: unix >=2.4.2.0 && <2.8
build-depends: unix >=2.4.2.0 && <2.8

if os(windows)
Build-depends: Win32 >=2.2.0.2 && <2.7
build-depends: Win32 >=2.2.0.2 && <2.7

GHC-Options: -Wall
ghc-options: -Wall

if flag(use-pkg-config)
Pkgconfig-depends: libpq >=9.3
pkgconfig-depends: libpq ==9.3 || >9.3

else
if os(windows)
-- Due to https://sourceware.org/bugzilla/show_bug.cgi?id=22948,
-- if we specify pq instead of libpq, then ld might link against
-- libpq.dll directly, which can lead to segfaults. As a temporary hack,
-- we force ld to link against the libpq.lib import library directly
-- by specifying libpq here.
Extra-Libraries: libpq
extra-libraries: libpq

else
Extra-Libraries: pq
extra-libraries: pq

if os(openbsd)
Extra-Libraries: crypto ssl
extra-libraries:
crypto
ssl

-- Other-modules:
Build-tools: hsc2hs
build-tools: hsc2hs -any

test-suite smoke
type: exitcode-stdio-1.0
main-is: Smoke.hs
hs-source-dirs: test
build-depends:
base,
bytestring,
postgresql-libpq
base
, bytestring
, postgresql-libpq

source-repository head
type: git
Expand Down
5 changes: 3 additions & 2 deletions src/Database/PostgreSQL/LibPQ/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
--
-----------------------------------------------------------------------------

{-# LANGUAGE BangPatterns, EmptyDataDecls #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE EmptyDataDecls #-}

module Database.PostgreSQL.LibPQ.Internal where

import Control.Concurrent.MVar (MVar)
import Foreign
import Control.Concurrent.MVar ( MVar )


-- | 'Connection' encapsulates a connection to the backend.
Expand Down