prisma / tiberius

TDS 7.2+ (Microsoft SQL Server) driver for Rust
Apache License 2.0
311 stars 113 forks source link

Cancel is not safety #300

Open gaoqiangz opened 1 year ago

gaoqiangz commented 1 year ago
let mut client = Client::connect(config, tcp.compat_write()).await?;

//cancel while executing
{
let rv = tokio::time::timeout(
    std::time::Duration::from_secs(3),
    client.simple_query("WAITFOR DELAY  '00:10'"),
)
.await;
println!("{:?}", rv);
}

//will never complete
{
let rv = client.simple_query("SELECT 'never complete'").await;
println!("{:?}", rv);
}