eventstore: EventStore TCP Client

[ bsd3, database, library ] [ Propose Tags ]

EventStore TCP Client

[Skip to Readme]
Versions [RSS] [faq],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.4.2 (info)
Change log CHANGELOG.markdown
Dependencies aeson (>=0.8 && <1.3), array, base (>=4.7 && <5), cereal (>=0.4 && <0.6), classy-prelude (==1.*), connection (==0.2.*), containers (==0.5.*), dns, dotnet-timespan, http-client (==0.5.*), mtl, protobuf (>= && <0.3), random (==1.*), semigroups (>=0.5), stm, time (>=1.4 && <1.7), unordered-containers, uuid (==1.3.*) [details]
License BSD-3-Clause
Author Yorick Laupa
Category Database
Home page
Bug tracker
Source repo head: git clone git://
Uploaded by YorickLaupa at 2017-04-27T19:38:11Z
Distributions LTSHaskell:1.4.1, NixOS:1.4.1, Stackage:1.4.1
Downloads 37899 total (853 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2017-04-27 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees


Readme for eventstore-

[back to package description]

EventStore Haskell TCP client

Join the chat at Build Status

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)


$ 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

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

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 import also re-exports 'waitAsync'
-- function for instance. There are also '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  = "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

    -- 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.
    _ <- waitAsync 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 Yosemite.

Contributions and bug reports are welcome!

BSD3 License

-Yorick Laupa