mysql-haskell-0.1.0.0: pure haskell MySQL driver

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

Database.MySQL.Protocol.Packet

Description

MySQL packet decoder&encoder, and varities utility.

Synopsis

Documentation

data Packet Source

MySQL packet type

Constructors

Packet 

Fields

pLen :: !Int
 
pSeqN :: !Word8
 
pBody :: !ByteString
 

decodeFromPacket :: Binary a => Packet -> IO a Source

Decoding packet inside IO, throw DecodePacketException on fail parsing, here we choose stability over correctness by omit incomplete consumed case: if we successful parse a packet, then we don't care if there're bytes left.

getFromPacket :: Get a -> Packet -> IO a Source

encodeToPacket :: Binary a => Word8 -> a -> Packet Source

data OK Source

You may get interested in OK packet because it provides information about successful operations.

Constructors

OK 

Fields

okAffectedRows :: !Int

affected row number

okLastInsertID :: !Int

last insert's ID

okStatus :: !Word16
 
okWarningCnt :: !Word16
 

Instances

getOK :: Get OK Source

putOK :: OK -> Put Source

data ERR Source

Constructors

ERR 

Instances

putERR :: ERR -> Put Source

data EOF Source

Constructors

EOF 

Instances

putEOF :: EOF -> Put Source

getWord24be :: Get Word24 Source

getInt24be :: Get Int24 Source