tds-0.1.0.0: Pure Haskell TDS protocol implementation. Mainly for beam-mssql and beam-sybase

Safe HaskellNone
LanguageHaskell2010

Database.TDS.Proto

Contents

Synopsis

Documentation

data Sender Source #

Constructors

Client 
Server 
Instances
Show Sender Source # 
Instance details

Defined in Database.TDS.Proto

data ResponseInfo a Source #

Instances
Show a => Show (ResponseInfo a) Source # 
Instance details

Defined in Database.TDS.Proto

data ResponseType a Source #

Constructors

ResponseType 

Fields

Instances
Show a => Show (ResponseType a) Source # 
Instance details

Defined in Database.TDS.Proto

data StreamType Source #

Instances
Show StreamType Source # 
Instance details

Defined in Database.TDS.Proto

Misc data types

newtype SPID Source #

Constructors

SPID Word16 
Instances
Eq SPID Source # 
Instance details

Defined in Database.TDS.Proto

Methods

(==) :: SPID -> SPID -> Bool #

(/=) :: SPID -> SPID -> Bool #

Show SPID Source # 
Instance details

Defined in Database.TDS.Proto

Methods

showsPrec :: Int -> SPID -> ShowS #

show :: SPID -> String #

showList :: [SPID] -> ShowS #

Packets

Packet header

packetType :: PacketType sender resp d -> Word8 Source #

newtype PacketStatus (s :: Sender) Source #

Constructors

PacketStatus Word8 
Instances
Show (PacketStatus s) Source # 
Instance details

Defined in Database.TDS.Proto

Semigroup (PacketStatus s) Source # 
Instance details

Defined in Database.TDS.Proto

Monoid (PacketStatus s) Source # 
Instance details

Defined in Database.TDS.Proto

type family Packed (packed :: Bool) (a :: *) (b :: *) where ... Source #

Equations

Packed True a b = a 
Packed False a b = b 

data PacketHeader (sender :: Sender) (resp :: ResponseInfo *) (d :: *) where Source #

Constructors

PacketHeader 

Fields

Instances
Show (PacketHeader sender resp d) Source # 
Instance details

Defined in Database.TDS.Proto

Methods

showsPrec :: Int -> PacketHeader sender resp d -> ShowS #

show :: PacketHeader sender resp d -> String #

showList :: [PacketHeader sender resp d] -> ShowS #

mkPacketHeader :: PacketType sender resp d -> PacketStatus sender -> PacketHeader sender resp d Source #

writeHdr :: Ptr a -> PacketHeader Client resp d -> IO () Source #

readHdr :: PacketType sender resp d -> Ptr a -> IO (Maybe (PacketHeader sender resp d)) Source #

data Packet (sender :: Sender) (resp :: ResponseInfo *) (d :: *) (f :: * -> *) where Source #

Constructors

Packet 

Fields

Instances
Show d => Show (Packet sender resp d Identity) Source # 
Instance details

Defined in Database.TDS.Proto

Methods

showsPrec :: Int -> Packet sender resp d Identity -> ShowS #

show :: Packet sender resp d Identity -> String #

showList :: [Packet sender resp d Identity] -> ShowS #

mkPacket :: PacketHeader sender resp d -> d -> Packet sender resp d Identity Source #

packetEncoding :: Payload d => Packet sender resp d Identity -> Packet sender resp d PacketEncoding Source #

displayRequest :: Show d => Packet sender resp d Identity -> String Source #

Packet payloads

class Show pld => Payload pld where Source #

Associated Types

type PayloadStreaming pld :: StreamType Source #

getFixups :: Tardis fixup (Builder, Word) fixup Source #

fixup :: Monoid fixup => fixup -> Tardis fixup (Builder, Word) () Source #

emit :: Word -> Builder -> Tardis fixup (Builder, Word) () Source #

PRELOGIN Payload

data Nonce Source #

Constructors

Nonce !Word64 !Word64 !Word64 !Word64 
Instances
Show Nonce Source # 
Instance details

Defined in Database.TDS.Proto

Methods

showsPrec :: Int -> Nonce -> ShowS #

show :: Nonce -> String #

showList :: [Nonce] -> ShowS #

LOGIN7 Payload

newtype TDSVersion Source #

Constructors

TDSVersion 
Instances
Show TDSVersion Source # 
Instance details

Defined in Database.TDS.Proto

newtype ClientPID Source #

Constructors

ClientPID 
Instances
Show ClientPID Source # 
Instance details

Defined in Database.TDS.Proto

newtype ConnectionID Source #

Constructors

ConnectionID 
Instances
Show ConnectionID Source # 
Instance details

Defined in Database.TDS.Proto

newtype LCID Source #

12-bit Windows language code identifier

Constructors

LCID Word16 
Instances
Show LCID Source # 
Instance details

Defined in Database.TDS.Proto

Methods

showsPrec :: Int -> LCID -> ShowS #

show :: LCID -> String #

showList :: [LCID] -> ShowS #

newtype CollationVersion Source #

4-bit collation version

Constructors

CollationVersion Word8 

data ClientID Source #

Constructors

ClientID !Word16 !Word32 
Instances
Eq ClientID Source # 
Instance details

Defined in Database.TDS.Proto

Show ClientID Source # 
Instance details

Defined in Database.TDS.Proto

Packet decoders

data ResponseDecoder (streaming :: StreamType) (res :: *) where Source #

Constructors

DecodeBatchResponse :: (Ptr Word8 -> Word16 -> IO (Maybe res)) -> ResponseDecoder TokenlessStream res 
DecodeTokenStream :: (forall r. IO () -> Stream TokenStream IO r -> IO res) -> ResponseDecoder TokenStream res 

PRELOGIN response

Tokens

newtype DoneSts Source #

Constructors

DoneSts Word16 
Instances
Show DoneSts Source # 
Instance details

Defined in Database.TDS.Proto

newtype ProgVersion Source #

Constructors

ProgVersion Word32 
Instances
Show ProgVersion Source # 
Instance details

Defined in Database.TDS.Proto

data TokenStream f Source #

Constructors

OneToken !Token f 
ContParse !Token (ByteString IO () -> f) 
Instances
Functor TokenStream Source # 
Instance details

Defined in Database.TDS.Proto

Methods

fmap :: (a -> b) -> TokenStream a -> TokenStream b #

(<$) :: a -> TokenStream b -> TokenStream a #

Tabular results

data CharKind Source #

Constructors

NormalChar 
NationalChar 
Instances
Show CharKind Source # 
Instance details

Defined in Database.TDS.Proto

data PrecScale Source #

Constructors

PrecScale !Word8 !Word8 
Instances
Show PrecScale Source # 
Instance details

Defined in Database.TDS.Proto

data TypeLen Source #

Constructors

ByteLen 
ShortLen 
Instances
Show TypeLen Source # 
Instance details

Defined in Database.TDS.Proto

data RawColumn f where Source #

Constructors

RawColumn :: ColumnData -> ByteString IO () -> (ByteString IO () -> f) -> RawColumn f 
Instances
Functor RawColumn Source # 
Instance details

Defined in Database.TDS.Proto

Methods

fmap :: (a -> b) -> RawColumn a -> RawColumn b #

(<$) :: a -> RawColumn b -> RawColumn a #

Splitting packets

data SplitEncoding sender resp pld Source #

Constructors

LastPacket (Ptr () -> IO CSize) 
OnePacket (Ptr () -> IO (Packet sender resp pld (SplitEncoding sender resp))) 

type SplitPacket sender resp pld = Packet sender resp pld (SplitEncoding sender resp) Source #

KnownBool type class

class KnownBool (b :: Bool) where Source #

Methods

boolVal :: p b -> Bool Source #

Instances
KnownBool False Source # 
Instance details

Defined in Database.TDS.Proto

Methods

boolVal :: p False -> Bool Source #

KnownBool True Source # 
Instance details

Defined in Database.TDS.Proto

Methods

boolVal :: p True -> Bool Source #