Skip to content

Commit

Permalink
fix(statistics): clickhouse-rs changed date(time) typing again
Browse files Browse the repository at this point in the history
  • Loading branch information
ashhhleyyy committed Dec 21, 2024
1 parent 20f9da6 commit abf2d97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/statistics/database.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use chrono::{DateTime, Utc};
use chrono::{DateTime, NaiveDate, Utc};
use chrono_tz::Tz;
use clickhouse_rs::{row, Block, Pool};
use tracing::warn;
Expand Down Expand Up @@ -407,7 +407,7 @@ impl StatisticDatabaseController {
let rows = result.rows();
let mut data = Vec::new();
for row in rows {
let date: DateTime<Tz> = row.get("date")?;
let date: NaiveDate = row.get("date")?;
let value: u64 = row.get("value")?;
data.push(Datapoint { date, value });
}
Expand Down
4 changes: 2 additions & 2 deletions src/statistics/model.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::HashMap;

use chrono::DateTime;
use chrono::NaiveDate;
use chrono::Utc;
use chrono_tz::Tz;
use clickhouse_rs::Pool;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
Expand Down Expand Up @@ -138,7 +138,7 @@ pub struct StatisticCounts<T> {

#[derive(Serialize)]
pub struct Datapoint {
pub date: DateTime<Tz>,
pub date: NaiveDate,
pub value: u64,
}

Expand Down

0 comments on commit abf2d97

Please sign in to comment.