A pure Haskell interface to the Tokyo Tyrant database server via its binary protocol
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 3 commits ahead, 2 commits behind travisbrady:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Database
tests
.gitignore
LICENSE
README.md
Setup.hs
haskell-tyrant.cabal

README.md

Pure Haskell interface to Tokyo Tyrant

Haskell-tyrant is a client library for Tokyo Tyrant. It uses the binary protocol for efficiency.

Example

A simple example assuming you've got ttserver running at the default location

module Main where

import Database.TokyoTyrant
import Data.ByteString.Lazy.Char8 (pack)

defaultHost = "localhost"
defaultPort = "1978"

main = do
    let k = pack "mykey"
    let v = pack "myval"
    conn <- openConnection defaultHost defaultPort
    result <- putValue conn k v
    --should be "success"
    print result
    g <- getValue conn k
    print g
    -- remove the record created above
    out conn k
    -- close connection to server
    closeConnection conn