hmssql
Safe HaskellNone
LanguageHaskell2010

Hmssql.Tds.Context

Description

Runtime state that affects how TDS messages are serialized and parsed.

Every get/put function in "Hmssql.Tds.*" takes a TdsContext so that protocol-version-dependent encodings are decided in one place.

Synopsis

Documentation

data TdsVersion Source #

Protocol versions this library can negotiate.

TDS 7.4 is the baseline (SQL Server 2017 and later, Azure SQL). TDS 8.0 is the same token stream over TLS from byte zero ("strict" encryption).

Constructors

Tds74 
Tds80 

tdsVersionWord :: TdsVersion -> Word32 Source #

The version DWORD sent in LOGIN7 (little-endian on the wire).

tdsVersionFromWord :: Word32 -> Maybe TdsVersion Source #

Interpret the version DWORD from LOGINACK (big-endian on the wire).

data TdsContext Source #

The protocol state a connection has negotiated, which the encoders and parsers take as an argument; connectionContext reads a connection's.

Constructors

TdsContext 

Fields

Instances

Instances details
Show TdsContext Source # 
Instance details

Defined in Hmssql.Tds.Context

Eq TdsContext Source # 
Instance details

Defined in Hmssql.Tds.Context

defaultTdsContext :: TdsContext Source #

TDS 7.4, 4096-byte packets, no transaction: what a connection starts from, and what the pure encoders are tested with.

minPacketSize :: Word32 Source #

The range of packet sizes, header included, that SQL Server negotiates (its network packet size option; MS-TDS 2.2.6.4 LOGIN7 PacketSize).

maxPacketSize :: Word32 Source #

The range of packet sizes, header included, that SQL Server negotiates (its network packet size option; MS-TDS 2.2.6.4 LOGIN7 PacketSize).

clampPacketSize :: Word32 -> Word32 Source #

The nearest packet size in minPacketSize .. maxPacketSize.