Skip to content

refactor: adopt shared sql-core plan layer from @worlds/sqlite - #38

Merged
EthanThatOneKid merged 4 commits into
mainfrom
adopt-sql-core
Aug 23, 2026
Merged

refactor: adopt shared sql-core plan layer from @worlds/sqlite#38
EthanThatOneKid merged 4 commits into
mainfrom
adopt-sql-core

Conversation

@EthanThatOneKid

Copy link
Copy Markdown
Contributor

Summary

Adopts the shared, driver-free SQL plan layer published in @worlds/sqlite@0.6.0 (./sql-core subpath), deleting this repo's duplicated twins: −261 lines.

What is now shared

  • sanitizeFtsQuery + FTS stopwords (was a byte-twin copy)
  • buildChunkFtsValue (was byte-identical; twin test removed — coverage lives upstream)
  • buildSearchResultId (docstring-only drift; upstream version adopted)
  • buildIncludeExcludeFilterClauses/generatePlaceholders/ColumnMapping filter-clause helpers
  • chunks_fts DDL, sync triggers, and idx_chunks_quad_id emitters

What stays LibSQL-local (by design)

  • Native vector dialect: vector F32_BLOB(n) column, idx_chunks_vector, vector32(?)/vector_top_k('idx_chunks_vector', ...) statements
  • In-SQL RRF fusion (single-statement keyword+vector CTE family — all three search branches kept verbatim, emitted SQL unchanged)
  • Column-per-position quads table + 7 covering indexes
  • Legacy FTS migration/backfill statements

Public API unchanged: sanitizeFtsQuery and buildChunkFtsValue remain exported from ./search-index.

Verification

  • deno task ci — fmt, lint, check, tests green including the parity suite (libsql agrees with the in-memory reference on the corpus)
  • deno task publish:dry — clean
  • Version 0.5.0 → 0.6.0 (new runtime dependency on jsr:@worlds/sqlite@^0.6.0)

@EthanThatOneKid

Copy link
Copy Markdown
Contributor Author

Status: parked, blocked by the org-wide CI teardown crash (#40). Local \deno task ci\ is fully green (Windows, deno 2.9.5), including the parity suite. Remote CI fails with exit 139 after every test passes — same signature as \main\ since the de-pin (#37/#39), independent of this diff. Will rebase/merge once the Deno resolution strategy lands. Worktree kept at \worktrees/worlds-libsql/adopt-sql-core\ (branch up to date with origin).

@EthanThatOneKid
EthanThatOneKid merged commit 57ac548 into main Aug 23, 2026
1 check passed
@EthanThatOneKid
EthanThatOneKid deleted the adopt-sql-core branch August 23, 2026 01:32
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