Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Apr 24, 2024
1 parent 9183de8 commit d85d53b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ee/tabby-db/src/user_completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl DbConn {
.join(",");
Ok(sqlx::query_as(&format!(
r#"
SELECT CAST(STRFTIME('%s', DATE(user_completions.created_at)) AS TIMESTAMP) as start,
SELECT STRFTIME('%F %T', DATE(user_completions.created_at)) as start,
language,
SUM(1) as completions,
SUM(selects) as selects,
Expand Down Expand Up @@ -147,7 +147,7 @@ impl DbConn {
// Groups stats by day, round all timestamps to the begining of the day relative to `start`.
let res = sqlx::query_as(&format!(
r#"
SELECT CAST((STRFTIME('%s', ?1) + days_since_start * 3600 * 24) AS TIMESTAMP) as start,
SELECT DATETIME((STRFTIME('%s', ?1) + days_since_start * 3600 * 24), 'unixepoch') as start,
language,
COUNT(1) as completions,
SUM(selects) as selects,
Expand Down

0 comments on commit d85d53b

Please sign in to comment.