The mysql-haskell-nem package

[ Tags: bsd3, database, library ] [ Propose Tags ]

Please see

[Skip to Readme]


Dependencies base (>=4.7 && <5), bytestring, io-streams, mysql-haskell, scientific, text, time [details]
License BSD3
Copyright 2016 José Lorenzo Rodríguez
Author José Lorenzo Rodríguez , Bryan O'Sullivan , Paul Rouse
Category Database
Home page
Source repository head: git clone
Uploaded Sun Dec 18 16:03:30 UTC 2016 by lorenzo
Distributions NixOS:, Stackage:
Downloads 104 total (14 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-12-18 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for mysql-haskell-nem-

[back to package description]


Provides a simpler interface for retrieving results when using the mysql-haskell package.


The Database.MySQL.Base and Database.MySQL.Nem modules provides everything you need to start making queries:

{-# LANGUAGE OverloadedStrings #-}

module Main where

import Database.MySQL.Base
import Database.MySQL.Base.Nem
import Data.Text (unpack)
import qualified System.IO.Streams as Streams

main :: IO () 
main = do
    conn <- connect
        defaultConnectInfo {ciUser = "username", ciPassword = "password", ciDatabase = "dbname"}

    results <- queryResults conn "SELECT email, name FROM users" >>=
    _ <-
            (\(email, name) -> print $ (Text.unpack email) ++ ":" ++ (name :: String) ) results >>=

It's recommended to use prepared statement to improve query speed:

    s <- prepareStmt conn "SELECT * FROM some_table where person_age > ?"
    results <- queryStmtResutls s [MySQLInt32U 18]