Created
December 23, 2015 08:46
-
-
Save krdlab/4355eec547ba54cd1c1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Database.MySQL.Base as MySQL | |
import Database.MySQL.Base (defaultConnectInfo, ConnectInfo(..), Option(..)) | |
test :: IO () | |
test = do | |
let conf = defaultConnectInfo { | |
connectHost = "172.17.0.2" | |
, connectDatabase = "testapp" | |
, connectUser = "tester" | |
, connectPassword = "tester" | |
, connectOptions = [CharsetName "utf8mb4"] | |
} | |
c <- MySQL.connect conf | |
MySQL.query c "select 1 + 1" | |
res <- MySQL.useResult c | |
row <- MySQL.fetchRow res | |
print row |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment