eventstore: EventStore TCP Client

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


EventStore TCP Client

[Skip to ReadMe]


Versions0.1.0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 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.1.6
Change logCHANGELOG.markdown
Dependenciesaeson (>=0.8), array, base (>=4.7 && <5), bifunctors, bytestring, cereal (>=0.4 && <0.6), clock, connection (==0.2.*), containers (==0.5.*), dns (>=3.0.1), dotnet-timespan, ekg-core, exceptions, fast-logger, hashable, http-client (==0.5.*), interpolate, lifted-async, lifted-base, machines (>=0.6), monad-control, monad-logger (>=0.3.20), mono-traversable (==1.*), mtl, protobuf (>= && <0.3), random (==1.*), safe-exceptions, semigroups (>=0.5), stm, stm-chans, text, time (>=1.4), transformers-base, unordered-containers, uuid (==1.3.*) [details]
CopyrightYorick Laupa
AuthorYorick Laupa
Home page
Source repositoryhead: git clone
UploadedThu Sep 6 09:11:57 UTC 2018 by YorickLaupa




Maintainers' corner

For package maintainers and hackage trustees

Readme for eventstore-1.1.6

[back to package description]

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:


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


$ cabal update
$ cabal install eventstore
$ 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