Adds a interface like mysql-simple to mysql-haskell.

Version on this page:
LTS Haskell 13.3:
Stackage Nightly 2019-01-19:
Latest on Hackage:

See all snapshots mysql-haskell-nem appears in

BSD-3-Clause licensed by José Lorenzo Rodríguez , Bryan O'Sullivan , Paul Rouse
Maintained by

Module documentation for


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]
Used by 1 package:
comments powered byDisqus