sqlite-sync-core
A production-grade, turn-key synchronization system for SQLite.
sqlite-sync-core provides a powerful, local-first synchronization engine that works seamlessly across multi-peer networks. It handles the "hard parts" of sync (vector clocks, causality, delta bundles, and conflict resolution) while providing a simple, turn-key interface for developers.
🚀 Turn-Key Synchronization
You can launch a full synchronization node in one command. No infrastructure required.
16-Second Setup (CLI)
# Install the package
pip install sqlite-sync-core
# Start a node and sync the 'tasks' table automatically
sqlite-sync start app.db --name Device-A --table tasks
Automatic Multi-Peer Sync
Nodes automatically discover each other on the local network (P2P) and synchronize state in the background without any manual peer configuration.
# On Device A
sqlite-sync start app.db --name Device-A --table tasks --port 8000
# On Device B (auto-discovers Device A)
sqlite-sync start app.db --name Device-B --table tasks --port 8001
🏗️ Enterprise Features
- Multi-Peer Orchestration: Automatically scales sync across N devices.
- P2P Discovery: Zero-config peer-to-peer discovery on LAN.
- Automatic Resolution: Configurable strategies like Last-Write-Wins and Field-Level Merge.
- Schema Evolution: Built-in migrations that sync across the network.
- Transport Agnostic: Works over HTTP, WebSockets, or file transfer.
Technical Usage (Library)
Initialize a Node in Code
from sqlite_sync import SyncNode
node = SyncNode(
db_path="app.db",
device_name="MobileApp",
sync_interval=10 # Sync every 10 seconds
)
await node.start()
node.enable_sync_for_table("users")
Safe Schema Migrations
# Safely add a column that will sync to all other peers
sqlite-sync migrate app.db --table tasks --add-column priority --type INTEGER
Core Invariants
| # | Invariant | Description |
|---|---|---|
| 1 | Causal consistency | Vector clocks ensure the correct order of operations. |
| 2 | Deterministic Replay | Identical sets of operations always result in identical state. |
| 3 | Conflict Tolerance | Detects and resolves conflicts explicitly and safely. |
| 4 | Offline-First | Entirely local-first design; works without cloud or internet. |
CLI Commands
| Command | Description |
|---|---|
start |
Start full sync node with P2P discovery |
init |
Initialize database for sync |
serve |
Start HTTP sync server (simple mode) |
sync |
Run sync with a specific peer |
status |
Show sync status and conflicts |
resolve |
Resolve conflicts interactively |
migrate |
Manage schema migrations |
peers |
Discover and manage peers |
snapshot |
Create database snapshot |
Start Command Options
sqlite-sync start <db_path> [OPTIONS]
Options:
--name, -n Device name for network discovery
--table, -t Tables to enable sync for (can repeat)
--port, -p Port to bind to (default: 8000)
--interval, -i Sync interval in seconds (default: 30)
--auto-discover Enable P2P discovery (default: enabled)
--daemon, -d Run as background daemon
Architecture
┌─────────────────────────────────┐
│ Your Sync System / App │
└───────────────┬─────────────────┘
│ Uses
┌───────────────▼─────────────────┐
│ sqlite-sync-core │
│ (Logging, Bundling, Clocks) │
└───────────────┬─────────────────┘
│ Persists to
┌───────────────▼─────────────────┐
│ SQLite Database │
└─────────────────────────────────┘
License
AGPL-3.0 for Open Source.
Commercial License available for enterprise use.
Contact shivaysinghrajput@proton.me for commercial licensing.
Built for developers who need a reliable sync foundation.
Metadata
Release files for sqlite-sync-core 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sqlite_sync_core-0.7.1.tar.gz | 103.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sqlite_sync_core-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 219.1 kB
Release files / sqlite_sync_core-0.7.1.tar.gz
| Download URL | sqlite_sync_core-0.7.1.tar.gz |
|---|---|
| Size | 103.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28ab2fa04e698202b11a771f451778ddf2918f03523077d8e71d2f314c82a1e7
|
|
BLAKE2b-256 checksum How to use checksums |
416e99546f91fa47e8f6352a97f0f448afdd8f76c8bec814e14e448a4f8d02f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / sqlite_sync_core-0.7.1-py3-none-any.whl
| Download URL | sqlite_sync_core-0.7.1-py3-none-any.whl |
|---|---|
| Size | 115.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6087e6dd8b2cab9fd728b2f4b84d926ec4052d446331122261d2a0aebd091e21
|
|
BLAKE2b-256 checksum How to use checksums |
4d00b2694fe57929be8be78f3af1ade1ff37707c0a1aa84e56326dd6e4870ffb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for sqlite-sync-core 0.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.