rs-db-driver-sqlserver-tiberius 0.1.0
SQL Server: tiberius (the driver, re-exported, with a runnable example)
Install
cargo add rs-db-driver-sqlserver-tiberius --registry rupm
In Ruststudio: Packages, search for rs-db-driver-sqlserver-tiberius, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.
Versions
- 0.1.0 2026-11-23
README
# rs-db-driver-sqlserver-tiberius
SQL Server - tiberius: async TDS driver (pure Rust)
Add it with `rupm add rs-db-driver-sqlserver-tiberius` (or `cargo add rs-db-driver-sqlserver-tiberius --registry rupm`). The driver `tiberius` is re-exported as `rs_db_driver_sqlserver_tiberius::tiberius`.
Also serves: Azure SQL Database, Azure SQL Managed Instance
This driver is async: your project also needs an async runtime, for example `cargo add tokio --features macros,rt-multi-thread`.
## Example
```rust
use tiberius::{AuthMethod, Client, Config};
use tokio::net::TcpStream;
use tokio_util::compat::TokioAsyncWriteCompatExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut config = Config::new();
config.host("localhost");
config.port(1433);
config.authentication(AuthMethod::sql_server("sa", "YourStrong!Passw0rd"));
config.trust_cert(); // for a development server with a self-signed certificate
let tcp = TcpStream::connect(config.get_addr()).await?;
tcp.set_nodelay(true)?;
let mut client = Client::connect(config, tcp.compat_write()).await?;
let row = client.query("SELECT 1", &[]).await?.into_row().await?;
println!("the server answered {:?}", row.and_then(|r| r.get::<i32, _>(0)));
Ok(())
}
```