Skip to content

fix: upgrade rusqlite 0.31 → 0.40 - #465

Merged
ajianaz merged 1 commit into
developfrom
fix/upgrade-rusqlite-0.40
Jun 23, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/upgrade-rusqlite-0.40

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

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

usize no longer implements FromSql/ToSql. All COUNT(*) results and LIMIT/OFFSET bindings must use i64 explicitly.

Changes (9 files)

  • 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)

Tests

All 271 tests pass ✅

@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz force-pushed the fix/upgrade-rusqlite-0.40 branch from 74a3c68 to 6a4c69f Compare June 23, 2026 14:52
.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
ajianaz force-pushed the fix/upgrade-rusqlite-0.40 branch from 6a4c69f to 6d736e1 Compare June 23, 2026 15:00
@ajianaz
ajianaz merged commit c933dec into develop Jun 23, 2026
8 checks passed
@ajianaz
ajianaz deleted the fix/upgrade-rusqlite-0.40 branch June 23, 2026 15:02
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants