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
Describe the bug
I want to run this query to get a count of the number of posts in the blog
let rowset = con.execute("SELECT COUNT(*) FROM posts;",&[]).map_err(|e| {println!("SQL ERROR: {e}");BenwisAppError::NotFound})?;let count = rowset.rows().nth(0).map(|row| {
row.get::<i64>("COUNT(*)").unwrap().to_owned()}).unwrap_or(0);
This runs fine locally, but on the server it panicked. Some debugging ensued, and I discovered that the column name returned from the local version is COUNT(*) and the cloud version is COUNT (*). That extra space is what threw me for a loop.
Frequency of the bug
Please check one:
Consistent repro
Intermittent repro
No repro
Set-up information
Please share the version of Spin used when the bug occurred. You can find the version of Spin by running spin -V.
Spin 2.4.2
The text was updated successfully, but these errors were encountered:
Thanks for flagging this @benwis! Per the linked issue, this is now fixed in Turso/libsql, but will take a little while to roll out to their production environment. In the meantime the proposed workaround is to do a SELECT COUNT(*) AS <something> to force the column name to be predictable. (I think you already have your own workaround, but I wanted to capture this in case other folks ran into it.)
Describe the bug
I want to run this query to get a count of the number of posts in the blog
This runs fine locally, but on the server it panicked. Some debugging ensued, and I discovered that the column name returned from the local version is
COUNT(*)
and the cloud version isCOUNT (*)
. That extra space is what threw me for a loop.Frequency of the bug
Please check one:
Set-up information
Please share the version of Spin used when the bug occurred. You can find the version of Spin by running
spin -V
.Spin 2.4.2
The text was updated successfully, but these errors were encountered: