fix(db): graceful FTS5 fallback when Node.js build lacks FTS5 support (#1532) - #1625
Open
aniruddhaadak80 wants to merge 1 commit into
Open
fix(db): graceful FTS5 fallback when Node.js build lacks FTS5 support (#1532)#1625aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
…colbymchenry#1532) Official Node.js binaries do not compile FTS5 by default, causing codegraph init to fail with 'no such module: fts5'. Added runtime FTS5 detection: - Split schema execution to try FTS5 separately, skip on failure with warning - Added fts5Available flag to DatabaseConnection and QueryBuilder - Bulk-load and search paths skip FTS5 operations when unavailable - Search falls back to LIKE + fuzzy matching when FTS5 is missing
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.
What Problem This Solves
codegraph v1.5.0 uses Node.js built-in
node:sqliteand requires FTS5, but official Node.js binaries do not compile FTS5 by default. This causescodegraph initandcodegraph indexto fail on any standard Node.js installation withError: no such module: fts5.Why This Change Was Made
The schema at
src/db/schema.sql:117creates an FTS5 virtual table unconditionally. When FTS5 is not available in the SQLite build bundled with Node.js, the entire schema execution fails, preventing codegraph from functioning at all.User Impact
codegraph now works on Node.js builds without FTS5. When FTS5 is unavailable:
searchNodes)Evidence
node:sqliteuses SQLite compiled without FTS5fts5Availableflagsrc/db/index.ts(schema split + flag),src/db/queries.ts(search fallback)