| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- data TdsVersion
- tdsVersionWord :: TdsVersion -> Word32
- tdsVersionFromWord :: Word32 -> Maybe TdsVersion
- newtype TransactionDescriptor = TransactionDescriptor Word64
- data TdsContext = TdsContext {
- tdsVersion :: !TdsVersion
- tdsPacketSize :: !Word32
- tdsTransaction :: !(Maybe TransactionDescriptor)
- tdsUtf8Support :: !Bool
- tdsCollation :: !(Maybe ByteString)
- defaultTdsContext :: TdsContext
- minPacketSize :: Word32
- maxPacketSize :: Word32
- clampPacketSize :: Word32 -> Word32
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).
Instances
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).
newtype TransactionDescriptor Source #
The server's identifier for the session's transaction, from a transaction ENVCHANGE, which every request sends back in its ALL_HEADERS.
Constructors
| TransactionDescriptor Word64 |
Instances
| Show TransactionDescriptor Source # | |
Defined in Hmssql.Tds.Context Methods showsPrec :: Int -> TransactionDescriptor -> ShowS # show :: TransactionDescriptor -> String # showList :: [TransactionDescriptor] -> ShowS # | |
| Eq TransactionDescriptor Source # | |
Defined in Hmssql.Tds.Context Methods (==) :: TransactionDescriptor -> TransactionDescriptor -> Bool # (/=) :: TransactionDescriptor -> TransactionDescriptor -> Bool # | |
| Ord TransactionDescriptor Source # | |
Defined in Hmssql.Tds.Context Methods compare :: TransactionDescriptor -> TransactionDescriptor -> Ordering # (<) :: TransactionDescriptor -> TransactionDescriptor -> Bool # (<=) :: TransactionDescriptor -> TransactionDescriptor -> Bool # (>) :: TransactionDescriptor -> TransactionDescriptor -> Bool # (>=) :: TransactionDescriptor -> TransactionDescriptor -> Bool # max :: TransactionDescriptor -> TransactionDescriptor -> TransactionDescriptor # min :: TransactionDescriptor -> TransactionDescriptor -> TransactionDescriptor # | |
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
| Show TdsContext Source # | |
Defined in Hmssql.Tds.Context Methods showsPrec :: Int -> TdsContext -> ShowS # show :: TdsContext -> String # showList :: [TdsContext] -> ShowS # | |
| Eq TdsContext Source # | |
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.