chore: change test query to macro
This commit is contained in:
parent
9ca904f943
commit
a5bca1852b
|
|
@ -363,14 +363,14 @@ mod test {
|
||||||
|
|
||||||
assert_eq!(contents.len(), 1);
|
assert_eq!(contents.len(), 1);
|
||||||
|
|
||||||
let tokens: i64 = sqlx::query(
|
let tokens = sqlx::query_scalar!(
|
||||||
"SELECT index_tokens_consumed from af_workspace_ai_usage WHERE workspace_id = $1",
|
"SELECT index_tokens_consumed from af_workspace_ai_usage WHERE workspace_id = $1",
|
||||||
|
workspace_id
|
||||||
)
|
)
|
||||||
.bind(workspace_id)
|
|
||||||
.fetch_one(&db)
|
.fetch_one(&db)
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get(0);
|
.unwrap_or(0);
|
||||||
assert_ne!(tokens, 0);
|
assert_ne!(tokens, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue