#![allow(non_snake_case)] #![cfg(feature = "polars")] use tokio::net::TcpStream; use tokio_util::compat::Compat; use ssql::prelude::*; use tiberius::Client; #[cfg(feature = "polars")] #[tokio::test] async fn data_frame() { let mut client = get_client().await; let df = Person::query().df(&mut client).await.unwrap(); dbg!(df); } pub async fn get_client() -> Client> { ssql::utils::get_client("username", "password", "host", "database").await } #[derive(ORM, Debug, Default)] #[ssql(table = CUSTOMER_LIST, schema = MASTER_DATA)] pub struct Customerlist { pub(crate) ship_to_id: Option, #[ssql(foreign_key = "DALI_DATA.SLOW_MOVING.stock_in_day")] pub(crate) ship_to: Option, pub(crate) volume: Option, pub(crate) container: Option, } #[derive(ORM, Debug, Default)] #[ssql(table = SLOW_MOVING, schema = DALI_DATA)] pub struct Test { pub(crate) stock_in_day: Option, pub(crate) total_value: Option, pub(crate) Week: Option, // pub(crate) Generated_Time: Option, } #[derive(ORM, Debug, Default)] #[ssql(table = Person)] pub struct Person { pub(crate) id: i32, pub(crate) Email: String, } #[derive(ORM, Debug, Default)] #[ssql(table = FORECAST, schema = UPDATED_DATA)] pub struct Fcst { pub(crate) Customer: Option, pub(crate) Material: Option, Dv: Option, Route: Option, TransitTime: Option, Plant: Option, }