You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pubstructStat{offering:String,count:u32}
sqlx::query_as!(Stat,r#" SELECT offerings.readable_name AS offering, COUNT(transactions.id) AS 'count!' FROM transactions INNER JOIN offerings ON offering_id = offerings.name WHERE timestamp BETWEEN ?1 AND ?2 GROUP BY offering_id; "#,
start,
end
)
This fails to compile:
error: unsupported type NULL of column #2 ("count!")
--> src/sql/stats.rs:16:2
|
16 | / sqlx::query_as!(
17 | | Stat,
18 | | r#"
19 | | SELECT offerings.readable_name AS offering, COUNT(transactions.id) AS 'count!'
... |
26 | | end
27 | | )
| |_____^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have this query:
This fails to compile:
Why does this fail and how can I fix this?
Beta Was this translation helpful? Give feedback.
All reactions