BSD3 licensed by Yorick Laupa
Maintained by

Module documentation for 1.1.5

There are no documented modules for this package.

EventStore Haskell TCP client

Talk and exchange ideas in our dedicated Discord Server

That driver supports 100% of EventStore features ! More information about the GetEventStore database can be found there:


  • 64bits system
  • GHC >= 7.8.3
  • Cabal >= 1.18
  • EventStore >= 3.0.0 (>= 3.1.0 if you want competing consumers).

Note: If you use this client version >= to 1.1, it will only supports EventStore >= 4.0.0.


$ cabal update
$ cabal install eventstore
  • From source
$ git clone
$ cd eventstore
$ cabal install --only-dependencies
$ cabal configure
$ cabal install

How to test

Tests are available. Those assume a server is running on and 1113 port.

$ cabal install --only-dependencies --enable-tests
$ cabal configure --enable-tests
$ cabal test

How to use

This code snippet showcases client version >= 1.1.

{-# LANGUAGE OverloadedStrings #-} -- That library uses `Text` pervasively. This pragma permits to use
                                   -- String literal when a Text is needed.
module Main where

import Control.Concurrent.Async (wait)
import Data.Aeson
-- It requires to have `aeson` package installed. Note that EventStore doesn't constraint you to JSON
-- format but putting common use aside, by doing so you'll be able to use some interesting EventStore
-- features like its Complex Event Processing (CEP) capabality.

import Database.EventStore
-- Note that imports 'NonEmpty' data constructor and 'nonEmpty' function from
-- 'Data.List.NonEmpty'.

main :: IO ()
main = do
    -- A common pattern with an EventStore connection is to create a single instance only and pass it
    -- wherever you need it (it's threadsafe). It's very important to not consider an EventStore connection like
    -- its regular SQL counterpart. An EventStore connection will try its best to reconnect
    -- automatically to the server if the connection dropped. Of course that behavior can be tuned
    -- through some settings.
    conn <- connect defaultSettings (Static "" 1113)
    let js  = object ["isHaskellTheBest" .= True] -- (.=) comes from Data.Aeson module.
        evt = createEvent "programming" Nothing (withJson js)

    -- Appends an event to a stream named `languages`.
    as <- sendEvent conn "languages" anyVersion evt Nothing

    -- EventStore interactions are fundamentally asynchronous. Nothing requires you to wait
    -- for the completion of an operation, but it's good to know if something went wrong.
    _ <- wait as

    -- Again, if you decide to `shutdown` an EventStore connection, it means your application is
    -- about to terminate.
    shutdown conn

    -- Make sure the EventStore connection completes every ongoing operation. For instance, if
    -- at the moment we call `shutdown` and some operations (or subscriptions) were still pending,
    -- the connection aborted all of them.
    waitTillClosed conn


That library was tested on Linux and OSX.

Contributions and bug reports are welcome!

BSD3 License

-Yorick Laupa



  • Update package metadata information.


  • Bump aeson version.


  • Fix compilation on GHC 8.4


  • Remove text-format dependency.


  • Aeson bump version.


  • Fix connection-manager connection reference. The issue was the client was starting to send requests to server even if the confirmation hasn’t been confirmed yet.


  • Supports GetEventStore >= 4.0.0 protocol changes.
  • No longer support GetEventStore < 4.0.0.
  • Stream versions are Int64.


  • Support SemVer versioning.

  • Support GHC 8.2.1.
  • Support Stackage LTS 9.

  • Discard version restriction on hashable library.

  • Overall internal components refactoring.
  • Decrease memory pressure by 10 folds.
  • Improve general performance.
  • Provide proper logging support using fast-logger library.
  • Support operation timeout detection.
  • Detects if the server is overwhelmed and act accordingly.
  • Improve connection management code.
  • Expose EKG monitoring metrics.

  • Fix subscription deadlock on connection drop.
  • Fix subscription catchup state tracking on connection drop.
  • Fix internal connection dispose lock implementation.
  • Bump aeson version.

  • Fix deadlock issues in subscription code.
  • Improve cluster connection fiability.
  • Internal refactoring.
  • Typeful EventType

  • Report stream name when facing a ‘Stream not found’ error from the server on catchup subscription.
  • Prevent the driver from deadlocking when asking for catchup subscription on a stream that doesn’t exist.

  • Fix a deadlock on user side when asking a catchup subscription on a stream that doesn’t exist.

  • Fix an internal connection bug.

  • Bump aeson version.
  • Internal connection refactoring.

  • Bump http-client version.

  • Restrain http-client package version.

  • Typo on streamExists implementation.

  • Add streamExists ExpectedVersion smart constructor.

  • Bump protobuf version

  • Implement SSL Connection
  • Implement waitConfirmation function

  • Quit using internal .NET TimeSpan for dotnet-timespan TimeSpan

  • Implement Cluster connection.
  • Domain can be used to connect to a server instance.

  • Bump aeson version.

  • Bump async version.

  • Fix $maxAge and $cacheControl TimeSpan metadata serialization.
  • Fix timeSpanFrom* functions.
  • Implement timeSpanTotalDays, timeSpanTotalHours, timeSpanTotalMinutes and timeSpanTotalSeconds.
  • Add withBinary and withBinaryAndMetadata.
  • Remove useless TimeSpan ToJSON and FromJSON instances.
  • Drop attoparsec dependency.

  • Increase cereal upper bound to <0.6

  • Increase aeson upper bound to <0.11

  • Fix stackage integration.

  • Introduce convinient persistent subscription functions.
  • Add multi GHC version testing.

  • Rewrite entirely the internals.
  • Implement integration tests.
  • Rename every ExpectedVersion smart constructors.
  • Improve internal and public documentation.
  • Improve failure reports when the connection dropped.
  • Implement more robust internal connection.

  • Implement competing consumers.
  • Expose an uniform API among all kind of subscriptions.
  • Rewrite internal subscription management.
  • Add missing Eq or Show instances for exposed datatypes.
  • Add streamMetadataCustomPropertyValue and streamMetadataCustomProperty.
  • Add logging capability.

  • Fix compilation issue

  • Add setStreamMetadata
  • Add getStreamMetadata

  • Internal connection changes
  • Allow creating an event with an existing ID

  • Tight package channnel to connection instance in order to prevent loss on connection drops.
  • Connection has asynchronous operation for real now.

  • Fix date conversion. recordedEventCreateEpoch is no longer exposed.
  • Add waitTillCatchup and hasCaughtUp functions.
  • Add exactStream ExpectedVersion smart constructor. As the result, ExpectedVersion constructors are no longer exposed. You have to use anyStream, noStream, emptyStream or exactStream instead.

No changes

  • Support keepRetrying reconnection strategy.
comments powered byDisqus