Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SQL Server Compatibility

PropertyValue
Repositoryprisma/tiberius
Version0.12.x
TypePure Rust TDS protocol implementation
Maintained byPrisma team

TDS Protocol Support

  • TDS 7.2 (SQL Server 2008)
  • TDS 7.3 (SQL Server 2008 R2)
  • TDS 7.4 (SQL Server 2012+)

Features

  • Pure Rust (no C dependencies)
  • Async-only (Tokio)
  • Cross-platform (macOS, Linux, Windows)
  • Active maintenance

TLS/SSL Compatibility

SQL Server 2008 R2 uses TLS 1.0/1.1 which is disabled by default in modern systems. Rust’s rustls does not support these deprecated protocols.

Solution: Disable Encryption

For internal network access, disable TLS encryption:

#![allow(unused)]
fn main() {
let mut config = Config::new();
config.host("your_host");
config.port(1433);
config.authentication(AuthMethod::sql_server("user", "password"));
config.database("your_database");
config.trust_cert();
config.encryption(EncryptionLevel::NotSupported);
}

This is the same approach as Python’s Encrypt=no connection string option.

Alternative: Use native-tls Backend

[dependencies]
tiberius = { version = "0.12", default-features = false, features = ["tds73", "native-tls"] }

Then configure OpenSSL to allow legacy TLS:

export OPENSSL_CONF=/path/to/openssl-legacy.cnf

Comparison with Python (pyodbc)

FeatureRust (tiberius)Python (pyodbc)
SQL Server SupportTDS 7.2-7.4Via ODBC driver
TLS 1.0 WorkaroundEncryptionLevel::NotSupportedEncrypt=no
Performance~5-7x fasterBaseline
Memory~10 MB~50 MB
DependenciesPure RustPython + ODBC driver
AsyncNative (Tokio)No native async
Type SafetyCompile-timeRuntime (Pydantic)
DeploymentSingle binaryComplex

Current Configuration

[dependencies]
tiberius = { version = "0.12", features = ["tds73", "chrono", "rust_decimal"] }
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["compat"] }

Migration Path

When migrating to modern SQL Server (2016+) or PostgreSQL, full TLS 1.2+ encryption can be enabled.