Fix rusqlite 0.38.0 compatibility: cast usize/u64 to i64 for database operations#2331
Conversation
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
There was a problem hiding this comment.
There were two ways #2330 (comment) could've been fixed, and I don't have any specific concern about the way chosen here, but I wanted to bring up the other way, just in case it should be considered. This PR description says:
Rusqlite 0.38.0 removed
FromSqlandToSqltrait implementations forusizeandu64types, causing compilation failures in thecorpusandqueryfeatures.
That's not entirely accurate. At least going by rusqlite/rusqlite#1732 (linked from the v0.38.0 announcement), the trait implementations were not removed from rusqlite, but instead placed behind a new fallible_uint feature flag.
So it seems to me that enabling that flag is another way this could've been fixed here. I don't know which way is better.
The context in rusqlite/rusqlite#1722 may be relevant. But it's not immediately obvious to me if the concerns apply to any use by gitoxide-core of rusqlite.
|
Thanks so much for checking this! Admittedly I didn't and just left it to the machine. In future, I will wait for you to take a look, like it was done before as well 😅. Is this a fix you want to do? I am also happy to fix it up otherwise. |
Sure! If I encounter problems, I'll let you know. |
As first seen for gitoxide in #2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in #2331 (modifying #2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - #2331 (review) - #2331 (comment)
This reverts the preceding two commits from GitoxideLabs#2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in GitoxideLabs#2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in GitoxideLabs#2331 (modifying GitoxideLabs#2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - GitoxideLabs#2331 (review) - GitoxideLabs#2331 (comment)
This reverts the preceding two commits from #2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in #2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in #2331 (modifying #2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - #2331 (review) - #2331 (comment)
This reverts the preceding two commits from GitoxideLabs#2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in GitoxideLabs#2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in GitoxideLabs#2331 (modifying GitoxideLabs#2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - GitoxideLabs#2331 (review) - GitoxideLabs#2331 (comment)
This reverts the preceding two commits from #2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in #2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in #2331 (modifying #2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - #2331 (review) - #2331 (comment)
This reverts the preceding two commits from GitoxideLabs#2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in GitoxideLabs#2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in GitoxideLabs#2331 (modifying GitoxideLabs#2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - GitoxideLabs#2331 (review) - GitoxideLabs#2331 (comment)
This reverts the preceding two commits from GitoxideLabs#2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in GitoxideLabs#2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in GitoxideLabs#2331 (modifying GitoxideLabs#2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - GitoxideLabs#2331 (review) - GitoxideLabs#2331 (comment)
This reverts the preceding two commits from GitoxideLabs#2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in GitoxideLabs#2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in GitoxideLabs#2331 (modifying GitoxideLabs#2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - GitoxideLabs#2331 (review) - GitoxideLabs#2331 (comment)
This reverts the preceding two commits from GitoxideLabs#2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in GitoxideLabs#2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in GitoxideLabs#2331 (modifying GitoxideLabs#2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - GitoxideLabs#2331 (review) - GitoxideLabs#2331 (comment)
This reverts the preceding two commits from #2331 (see discussion there). This prepares for a different, immediately forthcoming fix.
As first seen for gitoxide in #2330, upgrading `rusqlite` to 0.38.0 breaks compatibility with some of the types we use with it. This is due to a change in `rusqlite` that places conversions for `u64` and `usize` behind the new `fallible_uint` feature flag: - rusqlite/rusqlite#1722 - rusqlite/rusqlite#1732 We originally fixed this in #2331 (modifying #2330) by casting. This instead fixes it by enabling the new `fallible_uint` feature. For relevant details, see: - #2331 (review) - #2331 (comment)
Rusqlite 0.38.0 removed
FromSqlandToSqltrait implementations forusizeandu64types, causing compilation failures in thecorpusandqueryfeatures.Changes
usizeandu64values are now cast toi64when inserting/updating, and cast back when reading from the databasecrossbeam-channelto thequeryfeature (was only incorpusandestimate-hours)std::mem::replacewithstd::mem::taketo avoidRefMutlifetime conflictsExample
Note: The
queryfeature has a pre-existingSendtrait bound issue unrelated to these changes.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.