Skip to content

feat(sqlite): enable FTS5 and add a per-target shim build script - #53

Merged
espetro merged 2 commits into
mainfrom
feat/sqlite-fts5-per-target-shim
Nov 11, 2026
Merged

espetro merged 2 commits into
mainfrom
feat/sqlite-fts5-per-target-shim

Conversation

@espetro

@espetro espetro commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • The published build/libsqlite3-shim.a is built on Linux, so scriptc build --ffi node_modules/@cutils/sqlite/ffi.json fails to link on macOS (ELF archive) and cannot cross-compile to Windows or other arches.
  • SQLite is built without FTS5, so apps using CREATE VIRTUAL TABLE ... USING fts5 fail at runtime.

Fix

  • -DSQLITE_ENABLE_FTS5 in every build/test command.
  • scripts/build-shim.mjs --out <dir> [--target triple] [--cc] [--ar] builds the shim archive for one target and writes a matching ffi.json whose libraries points at it. It ships in the tarball. Works with cc on the host and CC="zig cc" AR="zig ar" for cross targets.

Verification

  • New tests: FTS5 virtual table round trip, and build-shim.mjs emitting archive and manifest.
  • On macOS arm64: node --test test/* 14/14 pass (shared lib built with -dynamiclib; build:shared still uses -Bsymbolic, Linux only), scriptc coverage gate 100%.
  • Cross: CC="zig cc" AR="zig ar" ... --target x86_64-windows-gnu produces a COFF archive.
  • Not run: the full pnpm test on Linux CI, ELF smoke on Linux.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Deploying cutilsjs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 57e6cec
Status: ✅  Deploy successful!
Preview URL: https://a5cc3805.cutilsjs.pages.dev
Branch Preview URL: https://feat-sqlite-fts5-per-target.cutilsjs.pages.dev

View logs

@espetro
espetro merged commit ea0f9ed into main Nov 11, 2026
3 checks passed
@espetro
espetro deleted the feat/sqlite-fts5-per-target-shim branch November 11, 2026 06:34
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.

1 participant