-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Unknown SQlite error: unsupported type NULL of column #3 ("time") #1524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
v0.6.1 sqlite SELECT name, COUNT(tbl2.id) AS count
FROM tbl1
INNER JOIN tbl2 ON tbl1.id = tbl2.tbl1_id
GROUP BY id
|
What needs to be done to solve this issue? |
For anyone who comes across this issue, putting the // DOES NOT WORK
let Ok(count) = sqlx::query!("SELECT author_id, COUNT(author_id) AS count FROM messages WHERE guild_id=? GROUP BY author_id LIMIT 5",guild_id).fetch_one(db).await else {};
// WORKS
let Ok(count) = sqlx::query!("SELECT COUNT(author_id) AS count, author_id FROM messages WHERE guild_id=? GROUP BY author_id LIMIT 5",guild_id).fetch_one(db).await else {};``` |
This issue is not resolved though. SELECT MAX(amount) from table GROUP BY name; @fdietze: |
I'm still having this issue in 0.8.0 |
Same here (on 0.8.1), even the workaround above (specify function first) does not work. |
Unlike #1246 and #1350 This seems to be around function parsing in SQLite:
With a code snippet like:
( Note that it's SQLite specific feature that MAX function pairs with GROUP BY automatically. )
And a simplified schema like this:
The error also persists if one tries to override the type of the "MAX(time) as time" using the "time!" syntax.
Only tested with version v0.5.9
The text was updated successfully, but these errors were encountered: