Crate tds_protocol

Crate tds_protocol 

Source
Expand description

§tds-protocol

Pure implementation of the MS-TDS (Tabular Data Stream) protocol used by Microsoft SQL Server.

This crate provides no_std compatible packet structures, token parsing, and serialization for TDS protocol versions 7.4 through 8.0.

§Features

  • std (default): Enable standard library support
  • alloc: Enable allocation without full std (requires alloc crate)

§Design Philosophy

This crate is intentionally IO-agnostic. It contains no networking logic and makes no assumptions about the async runtime. Higher-level crates build upon this foundation to provide async I/O capabilities.

§Example

use tds_protocol::{PacketHeader, PacketType, PacketStatus};

let header = PacketHeader {
    packet_type: PacketType::SqlBatch,
    status: PacketStatus::END_OF_MESSAGE,
    length: 100,
    spid: 0,
    packet_id: 1,
    window: 0,
};

Re-exports§

pub use error::ProtocolError;
pub use login7::FeatureExtension;
pub use login7::FeatureId;
pub use login7::Login7;
pub use login7::OptionFlags1;
pub use login7::OptionFlags2;
pub use login7::OptionFlags3;
pub use login7::TypeFlags;
pub use packet::DEFAULT_PACKET_SIZE;
pub use packet::MAX_PACKET_SIZE;
pub use packet::PACKET_HEADER_SIZE;
pub use packet::PacketHeader;
pub use packet::PacketStatus;
pub use packet::PacketType;
pub use prelogin::EncryptionLevel;
pub use prelogin::PreLogin;
pub use prelogin::PreLoginOption;
pub use rpc::ParamFlags;
pub use rpc::ProcId;
pub use rpc::RpcOptionFlags;
pub use rpc::RpcParam;
pub use rpc::RpcRequest;
pub use rpc::TypeInfo as RpcTypeInfo;
pub use sql_batch::SqlBatch;
pub use sql_batch::encode_sql_batch;
pub use sql_batch::encode_sql_batch_with_transaction;
pub use token::ColMetaData;
pub use token::Collation;
pub use token::ColumnData;
pub use token::Done;
pub use token::DoneInProc;
pub use token::DoneProc;
pub use token::DoneStatus;
pub use token::EnvChange;
pub use token::EnvChangeType;
pub use token::EnvChangeValue;
pub use token::FeatureExtAck;
pub use token::FedAuthInfo;
pub use token::LoginAck;
pub use token::NbcRow;
pub use token::Order;
pub use token::RawRow;
pub use token::ReturnValue;
pub use token::ServerError;
pub use token::ServerInfo;
pub use token::SessionState;
pub use token::SspiToken;
pub use token::Token;
pub use token::TokenParser;
pub use token::TokenType;
pub use token::TypeInfo;
pub use types::ColumnFlags;
pub use types::TypeId;
pub use types::Updateable;
pub use version::TdsVersion;

Modules§

codec
Codec utilities for TDS protocol encoding and decoding.
error
Protocol-level error types.
login7
TDS LOGIN7 packet construction.
packet
TDS packet header definitions.
prelogin
TDS pre-login packet handling.
rpc
RPC (Remote Procedure Call) request encoding.
sql_batch
SQL batch request encoding.
token
TDS token stream definitions.
types
TDS data type definitions.
version
TDS protocol version definitions.