tds-protocol
Pure Rust implementation of the MS-TDS (Tabular Data Stream) protocol used by Microsoft SQL Server.
Overview
This crate provides low-level, no_std-compatible protocol primitives for TDS versions 7.4 through 8.0. It is intentionally IO-agnostic and contains no networking or async runtime code.
Features
no_stdcompatible - Works in embedded environments withalloc- Zero unsafe code - Memory-safe by construction
- Protocol complete - Supports TDS 7.4, 7.4.1, and 8.0
- Well-tested - Fuzz-tested packet parsing
Usage
This crate is primarily used internally by mssql-client. Direct usage is for advanced scenarios:
use ;
// Create a packet header
let header = new;
// Encode to bytes
let bytes = header.encode_to_bytes;
// Create PreLogin message
let prelogin = new
.with_encryption;
let encoded = prelogin.encode;
Modules
| Module | Description |
|---|---|
packet |
TDS packet header encoding/decoding |
prelogin |
Pre-login negotiation messages |
login7 |
LOGIN7 authentication packet |
token |
Response token parsing (DONE, ERROR, COLMETADATA, ROW, etc.) |
rpc |
Remote procedure call encoding |
sql_batch |
SQL batch request encoding |
types |
TDS type identifiers and flags |
version |
TDS version definitions |
Feature Flags
| Flag | Default | Description |
|---|---|---|
std |
Yes | Enable standard library |
alloc |
No | Enable allocation without std |
Protocol References
License
MIT OR Apache-2.0