mysql-haskell-0.7.0.0: pure haskell MySQL driver

Copyright(c) Winterland, 2016
LicenseBSD
Maintainerdrkoster@qq.com
Stabilityexperimental
PortabilityPORTABLE
Safe HaskellNone
LanguageHaskell2010

Database.MySQL.Connection

Description

This is an internal module, the MySQLConn type should not directly acessed to user.

Synopsis

Documentation

data MySQLConn Source

MySQLConn wrap both InputStream and OutputStream for MySQL Packet.

You shouldn't use one MySQLConn in different thread, if you do that, consider protecting it with a MVar.

Constructors

MySQLConn 

Fields

mysqlRead :: !(InputStream Packet)
 
mysqlWrite :: !(OutputStream Packet)
 
mysqlCloseSocket :: IO ()
 
isConsumed :: !(IORef Bool)
 

data ConnectInfo Source

Everything you need to establish a MySQL connection.

To setup a TLS connection, use module Database.MySQL.TLS or Database.MySQL.OpenSSL.

Constructors

ConnectInfo 

Fields

ciHost :: HostName
 
ciPort :: PortNumber
 
ciDatabase :: ByteString
 
ciUser :: ByteString
 
ciPassword :: ByteString
 

defaultConnectInfo :: ConnectInfo Source

A simple ConnectInfo targeting localhost with user=root and empty password.

bUFSIZE :: Int Source

Socket buffer size.

maybe exposed to ConnectInfo laster?

connect :: ConnectInfo -> IO MySQLConn Source

Establish a MySQL connection.

connectDetail :: ConnectInfo -> IO (Greeting, MySQLConn) Source

Establish a MySQL connection with Greeting back, so you can find server's version .etc.

decodeInputStream :: InputStream ByteString -> IO (InputStream Packet) Source

A specialized decodeInputStream here for speed

close :: MySQLConn -> IO () Source

Close a MySQL connection.

command :: MySQLConn -> Command -> IO OK Source

Send a Command which don't return a resultSet.

waitCommandReply :: InputStream Packet -> IO OK Source

readPacket :: InputStream Packet -> IO Packet Source

writeCommand :: Command -> OutputStream Packet -> IO () Source

writeIORef' :: IORef a -> a -> IO () Source