explaingit

rbbydotdev/cr-sqlite

Analysis updated 2026-05-18

0RustAudience · developerComplexity · 5/5LicenseSetup · hard

TLDR

A SQLite extension fork that adds Fugue-based CRDT collaborative text editing, so multiple writers can edit the same field offline and merge changes without conflicts.

Mindmap

mindmap
  root((cr-sqlite fork))
    What it does
      Multi-writer SQLite
      Text CRDT
      Offline Sync
    Tech stack
      Rust
      SQLite
      WASM
    Concepts
      Fugue Algorithm
      Backing Rows
      Insertion Cache
    Demo
      Browser Editor
      Benchmark Page
      Peer Sync

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn any TEXT column in a SQLite database into a collaboratively editable field with one SQL function call.

USE CASE 2

Build a local-first web app where multiple users can edit the same document offline and sync later without conflicts.

USE CASE 3

Run the in-browser demo to see two peers typing into the same field with live convergence.

USE CASE 4

Benchmark how a Fugue-based text CRDT performs under sequential, mid-content, and bulk-insert typing scenarios.

What is it built with?

RustSQLiteWASMC

How does it compare?

rbbydotdev/cr-sqlite404-agent/codes-minerbakome-hub/bakome-crypto-quant-engine
Stars000
LanguageRustRustRust
Setup difficultyhardmoderateeasy
Complexity5/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Building the WASM demo requires Emscripten and Rust nightly, and the first build takes about 3 minutes to clone and compile dependencies.

MIT license: use, modify, and distribute freely, including commercially, as long as you keep the copyright notice.

In plain English

This is a fork, a modified copy, of an existing project called cr-sqlite, which stands for Convergent, Replicated SQLite. The original project adds multi-writer and conflict-resolution capabilities to SQLite, a widely used database that normally only handles one writer at a time. This fork extends it further by adding support for collaborative text editing, meaning multiple people can type into the same text field simultaneously and their changes will eventually merge together correctly, even if they were offline when editing. The core idea behind collaborative text editing is a CRDT, which stands for Conflict-free Replicated Data Type. This is an algorithm that guarantees two people editing the same document at the same time will always end up with the same result after their changes sync, so no one's edits get silently lost or corrupted. The specific algorithm used here is called Fugue. A single function, crsql_as_text_crdt, is all you need to turn any text column in your SQLite database into a Fugue-managed collaborative field. The project ships as a WASM extension, meaning it can run directly in a web browser without a server. There is a browser demo where you can open two editing panes, type into either, and watch them stay in sync. You can also take one peer offline, make diverging edits, then bring it back online to see convergence happen. A benchmark page measures how fast the system handles different typing scenarios, with individual keystrokes staying well under one millisecond even in large documents. The project is built in Rust with a C layer inherited from the upstream codebase, and is distributed under the MIT license.

Copy-paste prompts

Prompt 1
Explain what crsql_as_text_crdt does and show me how to register it on a TEXT column in my SQLite schema.
Prompt 2
Walk me through building the WASM version of this project with 'make wasm' and running the browser demo locally.
Prompt 3
What is a CRDT and how does the Fugue algorithm guarantee two offline editors converge to the same text?
Prompt 4
Show me how to run the property-based fuzz test suite to check multi-peer convergence invariants.

Frequently asked questions

What is cr-sqlite?

A SQLite extension fork that adds Fugue-based CRDT collaborative text editing, so multiple writers can edit the same field offline and merge changes without conflicts.

What language is cr-sqlite written in?

Mainly Rust. The stack also includes Rust, SQLite, WASM.

What license does cr-sqlite use?

MIT license: use, modify, and distribute freely, including commercially, as long as you keep the copyright notice.

How hard is cr-sqlite to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cr-sqlite for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.