FromDataPoint needs Default

This commit is contained in:
Bryan Stitt 2023-02-21 21:28:50 -08:00 committed by yenicelik
parent 5b48d471bb
commit 163bbbafca

@ -17,9 +17,16 @@ use chrono::{DateTime, FixedOffset};
use fstrings::{f, format_args_f};
use hashbrown::HashMap;
use influxdb2::models::Query;
use influxdb2::{Client, FromDataPoint};
use influxdb2::FromDataPoint;
use serde_json::json;
#[derive(Debug, Default, FromDataPoint)]
pub struct AggregatedRpcAccounting {
field: String,
value: f64,
time: DateTime<FixedOffset>,
}
pub async fn query_user_stats<'a>(
app: &'a Web3ProxyApp,
bearer: Option<TypedHeader<Authorization<Bearer>>>,
@ -92,9 +99,9 @@ pub async fn query_user_stats<'a>(
|> yield(name: "mean")
"#);
let query = Query::new(query);
let query = Query::new(qs.to_string());
// let res: Vec<_> = influxdb_client.query(Some(query)).await?;
let res: Vec<AggregatedRpcAccounting> = influxdb_client.query(Some(query)).await?;
todo!();
}