ms_tds/lib.rs
1//! `ms-tds` — pure-Rust TDS 7.4 client for Microsoft SQL Server.
2//!
3//! # STATUS: pre-alpha
4//!
5//! Compile-clean skeleton with partial implementation:
6//!
7//! * TDS packet framing (header + segmentation across `packet_size`)
8//! * PreLogin token round-trip
9//! * **TLS-in-TDS handshake tunneling** — `TlsTunnel` wraps rustls handshake
10//! records inside TDS PRELOGIN packets and flips to passthrough afterwards,
11//! so an encrypted SQL Server ("Encrypt = yes / Force Encryption") accepts
12//! the login. Post-handshake, TDS packet framing rides on top of the TLS
13//! layer unchanged.
14//! * Login7 with NTLM SSPI blob wrapping (INTEGRATED_SECURITY)
15//! * `TdsClient` `connect` / `login_ntlm` / `sql_batch` — the wire is driven
16//! but ROW / COLMETADATA decoding is not implemented, so `sql_batch` returns
17//! an empty `ResultSet` even when the server sends rows.
18//!
19//! # Minimal usage sketch
20//!
21//! ```no_run
22//! # async fn f() -> ms_tds::Result<()> {
23//! let mut c = ms_tds::TdsClient::connect("sql01", 1433, None).await?;
24//! c.login_ntlm("CORP", "svc_scan", "pw").await?;
25//! let _ = c.sql_batch(ms_tds::pentest::enum_linked_servers()).await?;
26//! # Ok(()) }
27//! ```
28
29#![deny(unsafe_code)]
30
31pub mod client;
32pub mod error;
33pub mod login7;
34pub mod packet;
35pub mod pentest;
36pub mod prelogin;
37pub mod tls;
38pub mod tls_tunnel;
39pub mod token;
40pub mod transport;
41
42pub use client::{Column, ResultSet, Row, TdsClient};
43pub use error::{Error, Result};
44pub use tls_tunnel::{TlsTunnel, TunnelMode};
45pub use transport::{AsyncStream, Transport};