Skip to content

Commit 6655c5f

Browse files
committed
Fetch integer as i64
SQLite stores integers in 64 bit. If we try to get i32, it is just [cast internally](https://docs.rs/libsql/0.9.2/src/libsql/rows.rs.html#169-177) as i32. The logic for fallible int conversion is already written. This commit makes use of it and makes it explicit that we are actually retrieving an i64 from the database before converting it to our model type.
1 parent f477e90 commit 6655c5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/devolutions-pedm/src/db/libsql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Database for LibsqlConn {
4141
let version = self
4242
.query_one("SELECT version FROM pedm_schema_version", ())
4343
.await?
44-
.get::<i32>(0)?;
44+
.get::<i64>(0)?;
4545
Ok(i16::try_from(version)?)
4646
}
4747

0 commit comments

Comments
 (0)