Skip to content

MiniSearch fallback strategy for better-sqlite3 FTS #23

Description

@themightychris

The read-api plan calls out a MiniSearch fallback when better-sqlite3 (native bindings) is unavailable on a deploy target. The current implementation in apps/api/src/store/fts.ts only uses better-sqlite3; the fallback was not built, on the grounds that surfacing a clear error at boot is better than silently degrading to a less powerful search backend.

Decision needed:

  • Confirm "surface the error" is the right policy long-term (cheaper to ensure native deps build on every target than to maintain two engines)
  • Or implement a MiniSearch fallback behind the same FtsEngine interface and gate it on a flag (e.g. an env var or a runtime probe)

Relevant files:

  • apps/api/src/store/fts.ts — current engine
  • plans/read-api.md — risk note
  • specs/architecture.md — "Full-text search — in-memory SQLite FTS5 (or MiniSearch fallback)"

Originated from PR #22 (read-api).

Activity

  1. themightychris commented on May 28, 2026

    @themightychris
    MemberAuthor

    Decision: fail-loudly at boot is the final answer. Since we only deploy via Docker container, native better-sqlite3 bindings are guaranteed at every target — there's no scenario where the fallback would activate. The current behavior in apps/api/src/store/fts.ts (surface the error at boot) is correct as-is. Closing as decided; the spec line in architecture.md mentioning the fallback can be tightened in a follow-up if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions