Skip to content

Stackage version upgrade and update Hasql calls to latest version #47

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 5 commits into from
Mar 16, 2020
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
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2
jobs:
publish:
docker:
- image: fpco/stack-build-small:lts
- image: fpco/stack-build-small:lts-14
steps:
- attach_workspace:
at: ws
Expand All @@ -30,11 +30,12 @@ jobs:

build-test:
docker:
- image: fpco/stack-build:lts-13.14
- image: fpco/stack-build:lts-14.27
- image: postgres:11-alpine
environment:
POSTGRES_DB: postgres_ws_test
POSTGRES_USER: root
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- checkout
- restore_cache:
Expand All @@ -45,8 +46,8 @@ jobs:
name: Resolve and update dependencies
command: stack setup
- run:
name: Install Cabal and hlint
command: stack install --system-ghc --resolver=lts-13.14 Cabal hlint
name: Install hlint
command: apt-get update && apt-get -qq -y install hlint
- save_cache:
name: Cache Dependencies
key: postgres-websockets-v2-{{ checksum "stack.yaml" }}
Expand Down
2 changes: 1 addition & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ isServerVersionSupported = do
where
pgVersion =
H.Statement "SELECT current_setting('server_version_num')::integer"
HE.unit (HD.singleRow $ HD.column HD.int4) False
HE.noParams (HD.singleRow $ HD.column $ HD.nonNullable $ HD.int4) False

main :: IO ()
main = do
Expand Down
4 changes: 2 additions & 2 deletions postgres-websockets.cabal
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: postgres-websockets
version: 0.5.0.1
version: 0.5.0.2
synopsis: Middleware to map LISTEN/NOTIFY messages to Websockets
description: Please see README.md
homepage: https://github.com/diogob/postgres-websockets#readme
license: BSD3
license-file: LICENSE
author: Diogo Biazus
maintainer: diogo@biazus.me
maintainer: diogo@biazus.ca
copyright: 2016 Diogo Biazus
category: Web
build-type: Simple
Expand Down
4 changes: 2 additions & 2 deletions src/PostgresWebsockets/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ notifyPool pool channel mesg =
where
mapError :: Either UsageError () -> Either Error ()
mapError = mapLeft (NotifyError . show)
callStatement = HST.Statement ("SELECT pg_notify" <> "($1, $2)") encoder HD.unit False
encoder = contramap fst (HE.param HE.text) <> contramap snd (HE.param HE.text)
callStatement = HST.Statement ("SELECT pg_notify" <> "($1, $2)") encoder HD.noResult False
encoder = contramap fst (HE.param $ HE.nonNullable $ HE.text) <> contramap snd (HE.param $ HE.nonNullable $ HE.text)

-- | Given a Hasql Connection, a channel and a message sends a notify command to the database
notify :: Connection -> PgIdentifier -> ByteString -> IO (Either Error ())
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-13.14
resolver: lts-14.27
extra-deps:
- envparse-0.4.1@sha256:989902e6368532548f61de1fa245ad2b39176cddd8743b20071af519a709ce30
- stm-containers-1.1.0.2@sha256:8976df591e61f378ef29dc0443dbe2d5d34818c898093af3ca138ea1d013b5eb
Expand Down
40 changes: 40 additions & 0 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files

packages:
- completed:
hackage: envparse-0.4.1@sha256:989902e6368532548f61de1fa245ad2b39176cddd8743b20071af519a709ce30,2842
pantry-tree:
size: 1180
sha256: 35044d67979fe2a5cff05cf8736a06a265592433cdd03e13a72908ceed892612
original:
hackage: envparse-0.4.1@sha256:989902e6368532548f61de1fa245ad2b39176cddd8743b20071af519a709ce30
- completed:
hackage: stm-containers-1.1.0.2@sha256:8976df591e61f378ef29dc0443dbe2d5d34818c898093af3ca138ea1d013b5eb,3210
pantry-tree:
size: 697
sha256: 61e041a97aa230e874a50cdea4ded5f264fbb6337811cf4adf4cadd51176a084
original:
hackage: stm-containers-1.1.0.2@sha256:8976df591e61f378ef29dc0443dbe2d5d34818c898093af3ca138ea1d013b5eb
- completed:
hackage: stm-hamt-1.2.0.2@sha256:18126db7bf2d9c967a6020c677b3005dd957a4c39d69aeaea3c29c90de8f6124,3972
pantry-tree:
size: 1009
sha256: ef426797655d6b4b9238b1200c4129d44e91f996f26b92a035b1333b8b8a6f62
original:
hackage: stm-hamt-1.2.0.2@sha256:18126db7bf2d9c967a6020c677b3005dd957a4c39d69aeaea3c29c90de8f6124
- completed:
hackage: primitive-extras-0.7.1@sha256:23905c57089418b1a2d324cfee3e81bbd5a344a0fa56a827867b2dce275fdb5e,2945
pantry-tree:
size: 1181
sha256: f788dae21ca4f0d0377d97a5ba7fd008d4b0af8991a745f94c29f2caa11dc6bd
original:
hackage: primitive-extras-0.7.1@sha256:23905c57089418b1a2d324cfee3e81bbd5a344a0fa56a827867b2dce275fdb5e
snapshots:
- completed:
size: 524996
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/27.yaml
sha256: 7ea31a280c56bf36ff591a7397cc384d0dff622e7f9e4225b47d8980f019a0f0
original: lts-14.27