# SQLite-Sync

> Offline-first CRDT sync for SQLite databases that enables conflict-free replication across devices, syncing to SQLite Cloud, PostgreSQL, or Supabase with no backend to build.

SQLite-Sync is a multi-platform SQLite extension that turns any local SQLite database into a conflict-free, offline-first replica. Built by SQLite Cloud, Inc., it uses CRDT (Conflict-free Replicated Data Types) algorithms to guarantee that devices can write independently — even without a network connection — and merge all changes automatically when connectivity returns. It syncs to SQLite Cloud, PostgreSQL, or Supabase as the central backend.

## What It Is

SQLite-Sync is a database synchronization layer that extends SQLite with CRDT-based conflict resolution. Rather than requiring developers to build a custom sync protocol or backend, a single SQL function call (`cloudsync_init`) enables a table for sync, and `cloudsync_network_sync()` handles sending and receiving changes. The extension ships as a loadable SQLite module and is available for Linux, macOS, Windows, iOS, Android, and WebAssembly (WASM).

## How the CRDT Engine Works

The sync engine implements several CRDT algorithms — Causal-Length Set, Delete-Wins, Add-Wins, and Grow-Only Set — to handle concurrent edits deterministically. Key guarantees include:

- **No data loss**: devices update independently offline and all changes merge automatically on reconnect.
- **No conflicts**: deterministic merge means no manual conflict resolution is ever required.
- **No extra infrastructure**: a globally distributed network of CloudSync microservices handles routing, packaging, and delivery of changes between SQLite and other DBMS nodes.

A notable feature called **Block-Level LWW** splits text columns into individual lines and merges them independently, specifically designed to keep markdown files and AI agent memory in sync when multiple agents or devices edit different sections of the same document.

## Platform and Integration Support

SQLite-Sync is designed to fit into a wide range of runtimes:

- **Mobile**: Swift (iOS via Swift Package), Android (`ai.sqlite:sync` on Maven Central), Flutter (`sqlite_sync` on pub.dev)
- **Web**: WASM (`@sqliteai/sqlite-wasm` on npm)
- **Cross-platform JS**: Expo (`@sqliteai/sqlite-sync-expo`), React Native (`@sqliteai/sqlite-sync-react-native`)
- **Backend sync targets**: SQLite Cloud CloudSync, self-hosted PostgreSQL, self-hosted or cloud Supabase

Row-Level Security (RLS) is enforced server-side, allowing a single shared cloud database to serve multiple tenants where each client syncs only the rows it is authorized to see.

## Part of the SQLite AI Ecosystem

SQLite-Sync is one component in a broader suite of SQLite extensions maintained by SQLite Cloud, Inc. under the `sqliteai` GitHub organization. The ecosystem includes:

- **SQLite-AI**: on-device LLM inference and embeddings
- **SQLite-Agent**: autonomous AI agents running inside SQLite
- **SQLite-Memory**: persistent, searchable memory for agents
- **SQLite-Vector**: ANN vector search inside SQLite tables
- **SQLite-Columnar**: column-oriented analytics for OLAP queries
- **SQLite-JS**: custom SQLite functions written in JavaScript
- **SQLite-MCP**: call MCP tools directly from SQL queries

The managed backend for all of these is **SQLite Cloud**, which provides hosted infrastructure with auth, access control, edge functions, and observability.

## Update: Version 1.1.2

The latest release is version 1.1.2, published on July 14, 2026. The repository was last pushed to on July 27, 2026, and was created in May 2025, indicating active and rapid development. The project follows semantic versioning, with PATCH releases delivering bug fixes and performance improvements without API changes. The PostgreSQL extension surfaces only MAJOR.MINOR in its catalog version, making PATCH releases transparent binary upgrades. The GitHub repository has accumulated 540 stars and 23 forks since its creation.

## Features
- CRDT-based conflict-free sync
- Offline-first local writes
- Block-Level LWW for markdown and text columns
- Row-Level Security (server-enforced)
- Multi-platform support (iOS, Android, WASM, Linux, macOS, Windows)
- Sync to SQLite Cloud, PostgreSQL, or Supabase
- Single function call to enable sync
- No backend to build
- AI agent memory sync
- Automatic conflict resolution
- Built-in networking layer
- Multi-tenant support with RLS
- CRDT algorithms: Causal-Length Set, Delete-Wins, Add-Wins, Grow-Only Set

## Integrations
SQLite Cloud, PostgreSQL, Supabase, Swift / iOS, Android (Maven Central), Flutter (pub.dev), React Native, Expo, WebAssembly (WASM), npm, Drizzle Studio

## Platforms
WINDOWS, MACOS, LINUX, ANDROID, IOS, WEB, API, DEVELOPER_SDK, CLI

## Pricing
Freemium — Free tier available with paid upgrades

## Version
1.1.2

## Links
- Website: https://www.sqlite.ai
- Documentation: https://docs.sqlitecloud.io/
- Repository: https://github.com/sqliteai/sqlite-sync
- EveryDev.ai: https://www.everydev.ai/tools/sqlite-sync
