Skip to content

feat(sql): migrate engine rusqlite → gluesql-core, drop bundled SQLite (REQ-231)#586

Merged
avrabe merged 1 commit into
mainfrom
feat/231-gluesql-engine
Jun 25, 2026
Merged

feat(sql): migrate engine rusqlite → gluesql-core, drop bundled SQLite (REQ-231)#586
avrabe merged 1 commit into
mainfrom
feat/231-gluesql-engine

Conversation

@avrabe

@avrabe avrabe commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Implements REQ-231 / DD-069 — the SQL engine swap you greenlit after the verify-first prototype.

What changed

Replaces rusqlite (bundled SQLite C) with gluesql-core (pure Rust) behind the unchanged sql::query / plan_write API. The ephemeral staging DB is now gluesql memory-storage populated from the live store; gluesql's async execute is bridged via futures::executor::block_on (no async runtime).

Why

The bundled-SQLite C amalgamation compiled on every CI job — the per-job weight that compounded #567 runner contention (#582 sat ~40 min queued). gluesql-core is sqlparser + the engine, pure Rust, no cc. rusqlite + libsqlite3-sys are gone from the dependency tree.

Behavior is identical — all tests pass unchanged

  • core sql:: 7/7 (read SELECT/JOIN + write planning incl. NULL-aware diff)
  • cli sql_* 3/3 (V-closure read, write round-trip fidelity, atomic rejection)
  • serve sql_endpoint 1/1 (read + write-refused + cross-origin guard)
  • live rivet sql V-closure query confirmed on the repo; rivet validate PASS; fmt + clippy clean

Notes

  • Engine choice is gluesql-core (not the umbrella gluesql crate, which pulls every storage backend + cc — see DD-069).
  • snapshot() now sorts rows (gluesql doesn't guarantee order without ORDER BY) for stable change-detection.
  • Follow-on now enabled: a native gluesql Store/StoreMut over rivet's store (true virtual tables; INSERT/DELETE/fields/links writes without the staging-diff) — the path to Add document system and improve graph visualization #2.

🤖 Generated with Claude Code

…te (REQ-231)

Replaces rusqlite (bundled SQLite C) with gluesql-core (pure Rust) behind the
unchanged `sql::query`/`plan_write` API. The ephemeral staging db is now gluesql
memory-storage populated from the live store; gluesql's async `execute` is
bridged via `futures::executor::block_on` (no runtime). The CI build no longer
compiles the SQLite C amalgamation — the per-job weight that compounded #567
runner contention (DD-069).

Behavior is identical — all existing tests pass unchanged: core read+write
(sql:: 7/7), cli (sql_* 3/3 incl. round-trip fidelity + atomic rejection), serve
(sql_endpoint 1/1). rusqlite + libsqlite3-sys removed from the dependency tree.
Live V-closure query confirmed on the repo.

Follow-on (now enabled): a native gluesql `Store`/`StoreMut` over rivet's store
(true virtual tables; INSERT/DELETE/fields/links writes without the staging-diff).

Implements: REQ-231
Refs: DD-069, REQ-229, REQ-230
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📐 Rivet artifact delta

No artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/sql.rs 78.94% 32 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 61b35ad Previous: db5395b Ratio
traceability_matrix/1000 58804 ns/iter (± 305) 44278 ns/iter (± 867) 1.33
query/10000 343338 ns/iter (± 2702) 237633 ns/iter (± 3019) 1.44

This comment was automatically generated by workflow using github-action-benchmark.

@avrabe avrabe merged commit 59b99c0 into main Jun 25, 2026
27 of 28 checks passed
@avrabe avrabe deleted the feat/231-gluesql-engine branch June 25, 2026 04: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