Repository navigation
fix: upgrade rusqlite 0.31 → 0.40 - #465
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-cli · BYOK · MIT |
ajianaz
force-pushed
the
fix/upgrade-rusqlite-0.40
branch
from
June 23, 2026 14:52
74a3c68 to
6a4c69f
Compare
| .conn | ||
| .query_row("SELECT COUNT(*) FROM graph_nodes", [], |row| row.get(0)) | ||
| .map_err(|e| Error::db("count nodes", e))?; | ||
| .query_row("SELECT COUNT(*) FROM graph_nodes", [], |row| { |
| "SELECT COUNT(*) FROM memories WHERE namespace = ?1 AND last_accessed IS NULL", | ||
| params![ns], | ||
| |row| row.get(0), | ||
| |row| row.get::<_, i64>(0), |
| "SELECT COUNT(*) FROM memories WHERE namespace = ?1", | ||
| params![ns], | ||
| |row| row.get(0), | ||
| |row| row.get::<_, i64>(0), |
| let memory_count: usize = | ||
| self.conn | ||
| .query_row( | ||
| "SELECT COUNT(DISTINCT memory_id) FROM room_memories WHERE room_id = ?1", |
| Ok(TagInfo { | ||
| name: row.get(0)?, | ||
| count: row.get(1)?, | ||
| count: row.get::<_, i64>(1)? as usize, |
Breaking change in rusqlite 0.32+: usize no longer implements FromSql/ToSql. All COUNT(*) results and LIMIT/OFFSET bindings must use i64 explicitly. Changes: - COUNT(*) queries: row.get::<_, i64>(0) → cast as usize - LIMIT/OFFSET params: limit as i64, offset as i64 - TagInfo.count, RoomStats.memory_count: i64 intermediate - count_by_tag: refactored to i64 match → Ok(count as usize) All 271 tests pass.
ajianaz
force-pushed
the
fix/upgrade-rusqlite-0.40
branch
from
June 23, 2026 15:00
6a4c69f to
6d736e1
Compare
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
Breaking change in rusqlite 0.32+: usize no longer implements FromSql/ToSql. All COUNT(*) results and LIMIT/OFFSET bindings must use i64 explicitly. Changes: - COUNT(*) queries: row.get::<_, i64>(0) → cast as usize - LIMIT/OFFSET params: limit as i64, offset as i64 - TagInfo.count, RoomStats.memory_count: i64 intermediate - count_by_tag: refactored to i64 match → Ok(count as usize) All 271 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CorIn (sister project) uses rusqlite 0.40. To add uteke-core as a path/git dependency without version conflicts, uteke-core must use the same version.
Breaking Change in rusqlite ≥0.32
usizeno longer implementsFromSql/ToSql. AllCOUNT(*)results andLIMIT/OFFSETbindings must usei64explicitly.Changes (9 files)
COUNT(*)queries:row.get::<_, i64>(0)→ castas usizeLIMIT/OFFSETparams:limit as i64,offset as i64TagInfo.count,RoomStats.memory_count: i64 intermediatecount_by_tag: refactored to i64 match →Ok(count as usize)Tests
All 271 tests pass ✅