Copyright | (c) Winterland, 2016 |
---|---|
License | BSD |
Maintainer | drkoster@qq.com |
Stability | experimental |
Portability | PORTABLE |
Safe Haskell | None |
Language | Haskell2010 |
This is an internal module, the MySQLConn
type should not directly acessed to user.
- data MySQLConn = MySQLConn {
- mysqlRead :: !(InputStream Packet)
- mysqlWrite :: !(OutputStream Packet)
- mysqlCloseSocket :: IO ()
- isConsumed :: !(IORef Bool)
- data ConnectInfo = ConnectInfo {
- ciHost :: HostName
- ciPort :: PortNumber
- ciDatabase :: ByteString
- ciUser :: ByteString
- ciPassword :: ByteString
- defaultConnectInfo :: ConnectInfo
- bUFSIZE :: Int
- connect :: ConnectInfo -> IO MySQLConn
- connectDetail :: ConnectInfo -> IO (Greeting, MySQLConn)
- mkAuth :: ByteString -> ByteString -> ByteString -> Greeting -> Auth
- decodeInputStream :: InputStream ByteString -> IO (InputStream Packet)
- close :: MySQLConn -> IO ()
- ping :: MySQLConn -> IO OK
- command :: MySQLConn -> Command -> IO OK
- waitCommandReply :: InputStream Packet -> IO OK
- readPacket :: InputStream Packet -> IO Packet
- writeCommand :: Command -> OutputStream Packet -> IO ()
- guardUnconsumed :: MySQLConn -> IO ()
- writeIORef' :: IORef a -> a -> IO ()
- data NetworkException = NetworkException
- data UnconsumedResultSet = UnconsumedResultSet
- data ERRException = ERRException ERR
- data UnexpectedPacket = UnexpectedPacket Packet
Documentation
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
.
MySQLConn | |
|
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.
ConnectInfo | |
|
defaultConnectInfo :: ConnectInfo Source
A simple ConnectInfo
targeting localhost with user=root
and empty password.
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.
mkAuth :: ByteString -> ByteString -> ByteString -> Greeting -> Auth Source
decodeInputStream :: InputStream ByteString -> IO (InputStream Packet) Source
A specialized decodeInputStream
here for speed
waitCommandReply :: InputStream Packet -> IO OK Source
readPacket :: InputStream Packet -> IO Packet Source
writeCommand :: Command -> OutputStream Packet -> IO () Source
guardUnconsumed :: MySQLConn -> IO () Source
writeIORef' :: IORef a -> a -> IO () Source
data NetworkException Source