mssqlrust 1.0.2

Lightweight Rust library for Microsoft SQL Server using dataset and datatable
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use async_trait::async_trait;

use crate::dataset::DataSet;

use crate::infrastructure::mssql::SqlConnection;

#[async_trait]
pub trait QueryExecutor {
    async fn query(&mut self, sql: &str, params: Vec<Box<dyn tiberius::ToSql + Send + Sync>>) -> Result<DataSet>;
}

#[async_trait]
impl QueryExecutor for SqlConnection {
    async fn query(&mut self, sql: &str, params: Vec<Box<dyn tiberius::ToSql + Send + Sync>>) -> Result<DataSet> {
        self.execute(sql, params).await
    }
}