Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

client API in haskell for HandlerSocket-mysql (initial version)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Database
Octocat-spinner-32 HandlerSocketClient.cabal
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Setup.hs
README
--
-- Module : HSClient
-- Author : Wu Xingbo
-- Copyright (c) 2011 Wu Xingbo (wuxb45@gmail.com)
-- New BSD License
--
-- |
-- Haskell implementation of a HandlerSocket client (API).
-- HandlerSocket is a MySQL plugin with better performance then SQL.
-- HandlerSocket site: https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL
--
-- this module is now available in Hackage.
-- To install:
-- $ cabal install HandlerSocketClient

-- here is a piece of sample code to use Client API

main :: IO ()
main = do
  hs <- connectTo "127.0.0.1" "9999"
  r1 <- runReqOpen hs "test" "t1" "PRIMARY" "k,v"
  putStrLn $ show r1
  r2 <- runReqFind hs ">" "1" 100
  putStrLn $ show r2
  r3 <- runReqInsert hs ["99", "77"]
  putStrLn $ show r3
  r4 <- runReqUpdate hs "99" ["101", "77"]
  putStrLn $ show r4
  r5 <- runReqDelete hs "101"
  putStrLn $ show r5
  r6 <- runReqGeneric hs ["0","+","2","555","999"]
  putStrLn $ show r6
  r7 <- runReqFindN hs "=" ["1","2","3","4"] 1
  putStrLn $ show r7


Something went wrong with that request. Please try again.