Repository navigation
Conversation
FTS5 MATCH operator rejects bound parameters (question-mark placeholders). Drizzle's sql template tag parameterizes interpolated values, causing ftsSearch to silently return 0 rows. Also fixes double-quote identifier quoting: MATCH needs single-quoted string literals, not double-quoted identifiers. Use sql.raw() to inline the MATCH value as a SQL string literal.
|
@ddukki is attempting to deploy a commit to the joelhooks' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesFTS5 Query Escaping Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related issues
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @ddukki, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/joelhooks/swarm-tools/blob/main/CONTRIBUTING.md for more details. |
Problem
hivemind_findalways returns{ results: [], count: 0 }for FTS searches. Two bugs instore.ts:Bug 1: FTS5 MATCH uses double-quoted identifiers instead of string literals
packages/swarm-mail/src/memory/store.ts:336:In SQLite,
MATCH "hivemind"treats"hivemind"as a column reference (identifier), not a string literal. Should beMATCH 'hivemind'(single-quoted string literal).Bug 2: Drizzle
sqltemplate parameterization incompatible with FTS5 MATCHpackages/swarm-mail/src/memory/store.ts:368:Drizzle's
sqltemplate tag parameterizes interpolated values as?placeholders. FTS5's MATCH operator does not support bound parameters -- the expression must be a literal string in the SQL text. The query silently returns 0 rows.Changes
packages/swarm-mail/src/memory/store.ts-- Fix FTS5 MATCH quoting + parameterizationTwo changes:
sql.raw()to inline the value directly into SQL text, bypassing Drizzle's?parameterizationTesting
Summary by CodeRabbit