Skip to content

docs: Phase 11.12 — promote concurrent-writes-plan.md to canonical reference (SQLR-22)#132

Merged
joaoh82 merged 1 commit into
mainfrom
worktree-phase-11-12-docs
May 11, 2026
Merged

docs: Phase 11.12 — promote concurrent-writes-plan.md to canonical reference (SQLR-22)#132
joaoh82 merged 1 commit into
mainfrom
worktree-phase-11-12-docs

Conversation

@joaoh82
Copy link
Copy Markdown
Owner

@joaoh82 joaoh82 commented May 11, 2026

Summary

  • Closes plan-doc §10.9 (the docs slice). Phase 11 (concurrent writes via MVCC + BEGIN CONCURRENT, SQLR-22) is now shipped end-to-end through 11.12 — every shipped sub-phase had been updating the plan-doc piecemeal; this slice promotes the user-facing surface into one canonical reference.
  • New runnable example at examples/rust/concurrent_writers.rs — two sibling Connections, interleaved BEGIN CONCURRENTs, exercising both the disjoint-row happy path and the same-row retry. Verified end-to-end: alice ends at 100 + 10 + 5 + 50 = 165.
  • Every cross-reference in _index.md, supported-sql.md, embedding.md, roadmap.md, design-decisions.md, and examples/README.md updated to point at the canonical doc; the plan-doc stays as the historical design record with a redirect banner.

New canonical reference: docs/concurrent-writes.md

TL;DR  →  Why MVCC  →  Quick start  →  Conceptual model
       →  SQL surface  →  Embedding API  →  REPL multi-handle demo
       →  Error semantics  →  Durability + recovery  →  Limitations

Covers the full Phase 11 user-facing surface: version chains, logical clock, commit validation, snapshot reads, PRAGMA journal_mode, BEGIN CONCURRENT rules, sibling handles via Connection::connect, the retry loop shape, per-SDK error mapping (SqlriteStatus::Busy, sqlrite.BusyError, errorKind('Busy'), sqlrite.ErrBusy), the .spawn / .use / .conns REPL meta-commands, WAL log-record durability and reopen replay, and the limitations and explicitly-parked follow-ups.

Worked example

$ cargo run --example concurrent_writers
=== Disjoint-row commits both succeed ===
  account 1 (alice): 110
  account 2 (bob): 120

=== Same-row commits: A wins, B retries ===
  B lost the race: Busy: write-write conflict on accounts/1: another transaction
  committed this row at ts=7 (after our begin_ts=6); transaction rolled back,
  retry with a fresh BEGIN CONCURRENT
  account 1 (alice): 165
  account 2 (bob): 120

Cross-ref refresh

File Change
docs/concurrent-writes-plan.md Redirect banner at the top; "Status" updated to shipped through 11.11a; §10.9 annotated with what landed in 11.12
docs/_index.md Phase 11 summary bullet refreshed; new "Concurrent writes" entry in the "Using SQLRite as a library" section
docs/supported-sql.md PRAGMA journal_mode + BEGIN CONCURRENT sections gain a "see concurrent-writes.md" callout; the "Not yet supported" entry for BEGIN CONCURRENT removed
docs/embedding.md Phase 11.4 section refreshed with canonical-doc + example pointer; "what's still ahead" turned into "what shipped after 11.4"
docs/roadmap.md Active-frontier blurb enumerates every shipped sub-phase + the parked follow-ups; 11.12 entry promoted to ✅ shipped
docs/design-decisions.md Phase 11 §12a–§12h gain a leading banner pointing readers at the canonical doc for the user-facing view
examples/README.md New entry alongside quickstart + hybrid-retrieval

What's still open in Phase 11

  • 11.10 — Indexes under MVCC (deferred-by-design, plan-doc §10.7; Turso explicitly punted on the same problem)
  • 11.11b — "N concurrent writers" bench workload + Go SDK cross-pool sibling shape (carved out from the original 11.11)
  • Checkpoint-drain follow-up — parked half of 11.9 — enables set_journal_mode(Mvcc → Wal) once MvStore can be drained

Test plan

  • cargo build --workspace --exclude sqlrite-desktop --exclude sqlrite-python --exclude sqlrite-nodejs --exclude sqlrite-benchmarks --all-targets
  • cargo test --workspace --exclude sqlrite-desktop --exclude sqlrite-python --exclude sqlrite-nodejs --exclude sqlrite-benchmarks — 615/615
  • cargo fmt --all -- --check
  • cargo clippy --workspace --exclude sqlrite-desktop --exclude sqlrite-python --exclude sqlrite-nodejs --exclude sqlrite-benchmarks --all-targets
  • cargo doc --workspace --exclude sqlrite-desktop --exclude sqlrite-python --exclude sqlrite-nodejs --exclude sqlrite-benchmarks --no-deps
  • cargo run --example concurrent_writers — verified retry path triggers and final balances are correct
  • CI green

🤖 Generated with Claude Code

…ference (SQLR-22)

Closes plan-doc §10.9 (the docs slice). Phase 11 (concurrent writes via
MVCC + BEGIN CONCURRENT, SQLR-22) is now shipped end-to-end through
11.12 — every shipped sub-phase had been updating the plan-doc
piecemeal; this slice promotes the user-facing surface into one
canonical reference and reshuffles cross-refs so callers stop bouncing
through the historical design record to find the SQL grammar or the
retry-loop shape.

New docs:
- docs/concurrent-writes.md — canonical user-facing reference: TL;DR,
  conceptual model (version chains, logical clock, commit validation,
  snapshot reads), SQL surface (PRAGMA journal_mode + BEGIN CONCURRENT
  + COMMIT/ROLLBACK rules), embedding API (sibling handles + retry
  loop + vacuum_mvcc), per-SDK error mapping table, REPL .spawn/.use/
  .conns demo, error semantics, durability + recovery (WAL log records,
  v3 format, clock seeding), limitations, references.

New example:
- examples/rust/concurrent_writers.rs — registered as
  `cargo run --example concurrent_writers`. Two sibling Connections
  via Connection::connect; runs (1) disjoint-row commits both succeed
  and (2) interleaved same-row commits where one wins and the other
  catches Busy + retries. Verified end-to-end: alice ends at
  100 + 10 + 5 + 50 = 165.

Updated cross-refs:
- docs/concurrent-writes-plan.md — redirect banner at the top pointing
  readers to the canonical doc; "Status" line updated to "shipped end-
  to-end through 11.11a"; plan-doc §10.9 entry annotated with what
  landed in 11.12.
- docs/_index.md — Phase 11 summary refreshed to "shipped end-to-end
  through 11.11a + 11.12 docs sweep"; new "Concurrent writes" entry
  in the "Using SQLRite as a library" section.
- docs/supported-sql.md — PRAGMA journal_mode and BEGIN CONCURRENT
  sections gain a "see concurrent-writes.md for the full reference"
  callout; the "Not yet supported" entry for BEGIN CONCURRENT removed
  (it ships).
- docs/embedding.md — Phase 11.4 section refreshed with a pointer at
  the canonical doc + the new example; "what's still ahead" turned
  into "what shipped after 11.4" with 11.5 → 11.11a captured.
- docs/roadmap.md — active-frontier blurb expanded to enumerate every
  shipped sub-phase + the explicitly parked follow-ups; Phase 11.12
  entry promoted to ✅ shipped.
- docs/design-decisions.md — Phase 11 §12a–§12h gain a leading banner
  pointing readers at the canonical doc for the user-facing view.
- examples/README.md — concurrent_writers entry added alongside
  quickstart + hybrid-retrieval.

Workspace: 615/615 Rust tests still pass; cargo fmt + clippy + doc
all clean. The new example builds + runs successfully.

What's still open in Phase 11:
- 11.10 — Indexes under MVCC (deferred-by-design, plan-doc §10.7)
- 11.11b — "N concurrent writers" bench workload + Go SDK cross-pool
  sibling shape (carved out from the original 11.11)
- Checkpoint-drain follow-up (parked half of 11.9 — enables
  set_journal_mode(Mvcc → Wal) once MvStore can be drained)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rust-sqlite Ready Ready Preview, Comment May 11, 2026 10:07am

Request Review

@joaoh82 joaoh82 merged commit 0d22d8c into main May 11, 2026
18 checks passed
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