Skip to content

Commit aeb41a9

Browse files
committed
update docs/postgresql markdowns
1 parent 9ae4364 commit aeb41a9

File tree

5 files changed

+70
-70
lines changed

5 files changed

+70
-70
lines changed

docs/postgresql/CLIENT.md

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,21 @@ Under the hood, SQLite Sync uses advanced **CRDT (Conflict-free Replicated Data
1010
- When they reconnect, all changes are **merged automatically and without conflicts**.
1111
- **No data loss. No overwrites. No manual conflict resolution.**
1212

13-
---
14-
1513
## IMPORTANT
1614

1715
- Make sure to use version **0.9.96 or newer**
1816
(verify with `SELECT cloudsync_version();`)
1917

2018
- Until v0.9.96 is released upstream, always use the development fork:
2119
https://github.com/sqliteai/sqlite-sync-dev
22-
and **not** the original repository:
20+
and **NOT** the original repository:
2321
https://github.com/sqliteai/sqlite-sync
2422

25-
- Updated example apps are available at:
26-
https://github.com/sqliteai/sqlite-sync-dev/tree/main/examples
27-
- sport-tracker-app (WASM), see [SPORT_APP_README_SUPABASE.md](SPORT_APP_README_SUPABASE.md) for more details
28-
- to-do-app (React)
29-
- React-Native (Expo): https://github.com/sqliteai/sqlite-sync-react-native
30-
- Remaining demos will be updated in the next days
31-
32-
---
23+
- Updated example apps are available [here](https://github.com/sqliteai/sqlite-sync-dev/tree/main/examples):
24+
- sport-tracker app (WASM), see [SPORT_APP_README_SUPABASE.md](SPORT_APP_README_SUPABASE.md) for more details
25+
- to-do app (Expo)
26+
- React Native Library: https://github.com/sqliteai/sqlite-sync-react-native
27+
- Remaining demos will be updated in the next days
3328

3429
## Conversion Between SQLite and PostgreSQL Tables
3530

@@ -140,9 +135,7 @@ SELECT cloudsync_init('notes');
140135
- [ ] Same column names and order
141136
- [ ] Same defaults (semantic match)
142137

143-
Database Schema Recommendations: https://github.com/sqliteai/sqlite-sync-dev?tab=readme-ov-file#database-schema-recommendations
144-
145-
---
138+
Please follow [these Database Schema Recommendations](https://github.com/sqliteai/sqlite-sync-dev?tab=readme-ov-file#database-schema-recommendations)
146139

147140
## Pre-built Binaries
148141

@@ -154,8 +147,6 @@ Download the appropriate pre-built binary for your platform from the official [R
154147
- Android
155148
- iOS
156149

157-
158-
159150
## Loading the Extension
160151

161152
```
@@ -166,34 +157,27 @@ Download the appropriate pre-built binary for your platform from the official [R
166157
SELECT load_extension('./cloudsync');
167158
```
168159

160+
## WASM Version -> React client-side
169161

170-
171-
## WASM Version
172-
162+
Make sure to install the extension tagged as **dev** and not **latest**
173163
```
174-
npm i sqlite-wasm@dev
164+
npm i @sqliteai/sqlite-wasm@dev
175165
```
176166

177-
Then follow the instructions available from https://www.npmjs.com/package/@sqliteai/sqlite-wasm
178-
179-
167+
Then follow the instructions from the [README](https://www.npmjs.com/package/@sqliteai/sqlite-wasm)
180168

181169
## Swift Package
182170

183171
You can [add this repository as a package dependency to your Swift project](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app#Add-a-package-dependency). After adding the package, you'll need to set up SQLite with extension loading by following steps 4 and 5 of [this guide](https://github.com/sqliteai/sqlite-extensions-guide/blob/main/platforms/ios.md#4-set-up-sqlite-with-extension-loading).
184172

185-
186-
187173
## Android Package
188174

189175
Add the [following](https://central.sonatype.com/artifact/ai.sqlite/sync.dev) to your Gradle dependencies:
190176

191177
```
192-
implementation 'ai.sqlite:sync.dev:0.9.92'
178+
implementation 'ai.sqlite:sync.dev:0.9.96'
193179
```
194180

195-
196-
197181
## Expo
198182

199183
Install the Expo package:
@@ -202,13 +186,9 @@ Install the Expo package:
202186
npm install @sqliteai/sqlite-sync-expo-dev
203187
```
204188

205-
Then follow the instructions from:
189+
Then follow the instructions from the [README](https://www.npmjs.com/package/@sqliteai/sqlite-sync-expo-dev)
206190

207-
https://www.npmjs.com/package/@sqliteai/sqlite-sync-expo-dev
208-
209-
210-
211-
## React/Node
191+
## Node -> React server-side
212192

213193
```js
214194
npm i better-sqlite3
@@ -227,8 +207,6 @@ console.log('Sync extension version:', version);" >> index.js
227207
node index.js
228208
```
229209

230-
---
231-
232210
## Naming Clarification
233211

234212
- **sqlite-sync** → Client-side SQLite extension

docs/postgresql/CLOUDSYNC.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Demo Deployment
22

3-
For the current demo, a single cloudsync node is deployed in **Europe** on Fly.io.
3+
For the current demo, a single CloudSync node is deployed in **Europe** on Fly.io.
44

55
If testing from other regions, latency will reflect this single-node deployment.
66
A production deployment would use **geographically distributed nodes with regional routing** for global coverage.
77

8-
---
9-
10-
### Fly.io
8+
## Fly.io
119

1210
Project Name: **cloudsync-staging**
1311
Fly.io App: https://fly.io/apps/cloudsync-staging
@@ -16,8 +14,6 @@ Logs: https://fly.io/apps/cloudsync-staging/monitoring
1614

1715
> Note: This is a **demo-only environment**, not intended for production use.
1816
19-
---
20-
2117
## Environment Variables
2218

2319
Edit in the Fly.io **Secrets** section:
@@ -35,8 +31,6 @@ Environment variables:
3531
- `CLOUDSYNC_SERVICE_PROJECT_ID` — project ID for service user
3632
- `CLOUDSYNC_SERVICE_DATABASE_CONNECTION_STRING` — service user DB connection
3733

38-
---
39-
4034
## Tables
4135

4236
- **cloudsync_jobs** — queue of asynchronous jobs
@@ -46,9 +40,7 @@ Environment variables:
4640

4741
- **cloudsync_artifacts** — blobs ready for client download
4842
- **cloudsync_metrics** — collected metrics
49-
- **cloudsync_push_tokens** — Expo push tokens
50-
51-
---
43+
- **cloudsync_push_tokens** — Expo push tokens
5244

5345
## Metrics
5446

docs/postgresql/README.md

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,57 @@ The **SQLite AI offline-sync solution** consists of three main components:
77

88
Together, these components provide a complete, production-grade **offline-first synchronization stack** for SQLite and PostgreSQL.
99

10+
1011
# SQLite Sync
1112

1213
**SQLite Sync** is a native SQLite extension that must be installed and loaded on all client devices.
1314
We provide prebuilt binaries for:
1415
* Desktop and mobile platforms
1516
* WebAssembly (WASM)
16-
* Popular frameworks including React, Expo, npm, and more
17-
18-
**Note:** The latest version (v0.9.96) is not yet available in the official SQLite Sync repository. Please use our development fork instead:[https://github.com/sqliteai/sqlite-sync-dev](https://github.com/sqliteai/sqlite-sync-dev)
17+
* Popular package managers and frameworks including React Native, Expo, Node, Swift PM and Android AAR
18+
19+
**Note:** The latest version (v0.9.96) is not yet available in the official SQLite Sync repository. Please use our development fork instead: [https://github.com/sqliteai/sqlite-sync-dev](https://github.com/sqliteai/sqlite-sync-dev)
20+
21+
<details>
22+
<summary>List of development fork binaries (v0.9.96)</summary>
23+
24+
### Android
25+
- [cloudsync-android-aar-0.9.96.aar](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-aar-0.9.96.aar)
26+
- [cloudsync-android-arm64-v8a-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-arm64-v8a-0.9.96.tar.gz)
27+
- [cloudsync-android-arm64-v8a-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-arm64-v8a-0.9.96.zip)
28+
- [cloudsync-android-armeabi-v7a-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-armeabi-v7a-0.9.96.tar.gz)
29+
- [cloudsync-android-armeabi-v7a-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-armeabi-v7a-0.9.96.zip)
30+
- [cloudsync-android-x86_64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-x86_64-0.9.96.tar.gz)
31+
- [cloudsync-android-x86_64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-android-x86_64-0.9.96.zip)
32+
33+
### Apple (iOS / macOS)
34+
- [cloudsync-apple-xcframework-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-apple-xcframework-0.9.96.zip)
35+
- [cloudsync-ios-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-ios-0.9.96.tar.gz)
36+
- [cloudsync-ios-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-ios-0.9.96.zip)
37+
- [cloudsync-ios-sim-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-ios-sim-0.9.96.tar.gz)
38+
- [cloudsync-ios-sim-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-ios-sim-0.9.96.zip)
39+
- [cloudsync-macos-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-macos-0.9.96.tar.gz)
40+
- [cloudsync-macos-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-macos-0.9.96.zip)
41+
- [cloudsync-macos-arm64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-macos-arm64-0.9.96.tar.gz)
42+
- [cloudsync-macos-arm64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-macos-arm64-0.9.96.zip)
43+
- [cloudsync-macos-x86_64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-macos-x86_64-0.9.96.tar.gz)
44+
- [cloudsync-macos-x86_64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-macos-x86_64-0.9.96.zip)
45+
46+
### Linux
47+
- [cloudsync-linux-arm64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-arm64-0.9.96.tar.gz)
48+
- [cloudsync-linux-arm64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-arm64-0.9.96.zip)
49+
- [cloudsync-linux-musl-arm64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-musl-arm64-0.9.96.tar.gz)
50+
- [cloudsync-linux-musl-arm64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-musl-arm64-0.9.96.zip)
51+
- [cloudsync-linux-musl-x86_64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-musl-x86_64-0.9.96.tar.gz)
52+
- [cloudsync-linux-musl-x86_64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-musl-x86_64-0.9.96.zip)
53+
- [cloudsync-linux-x86_64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-x86_64-0.9.96.tar.gz)
54+
- [cloudsync-linux-x86_64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-linux-x86_64-0.9.96.zip)
55+
56+
### Windows
57+
- [cloudsync-windows-x86_64-0.9.96.tar.gz](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-windows-x86_64-0.9.96.tar.gz)
58+
- [cloudsync-windows-x86_64-0.9.96.zip](https://github.com/sqliteai/sqlite-sync-dev/releases/download/0.9.96/cloudsync-windows-x86_64-0.9.96.zip)
59+
60+
</details>
1961

2062
### Architecture Refactoring
2163
The extension has been refactored to support both **SQLite** and **PostgreSQL** backends.
@@ -29,7 +71,7 @@ This modular design improves **portability**, **maintainability**, and **cross-d
2971
* Code coverage exceeds **90%**
3072
* PostgreSQL-specific code has its own dedicated test suite
3173

32-
Key Features
74+
### Key Features
3375
* Deep integration with SQLite — the default database for Edge applications
3476
* Built-in network layer exposed as ordinary SQLite functions
3577
* Cross-platform, language-agnostic payload format
@@ -45,7 +87,6 @@ Currently implemented CRDT algorithms:
4587
Additional CRDTs can be implemented if needed, though LWW covers most real-world use cases.
4688

4789

48-
4990
# CloudSync
5091

5192
**CloudSync** is a lightweight, stateless microservice responsible for synchronizing clients with central servers.
@@ -58,9 +99,7 @@ Additional CRDTs can be implemented if needed, though LWW covers most real-world
5899
* Collects operational metrics (connected devices, sync volume, traffic, etc.)
59100
* Exposes a complete **REST API**
60101

61-
62-
63-
Technology Stack
102+
### Technology Stack
64103

65104
* Written in **Go**
66105
* Built on the high-performance **Gin Web Framework**
@@ -69,23 +108,18 @@ Technology Stack
69108
* Stateless architecture enables horizontal scaling simply by adding nodes
70109
* Serialized job queue ensures **no job loss**, even after restarts
71110

72-
73-
74-
Observability
111+
### Observability
75112

76113
* Metrics dashboard available in [grafana-dashboard.json](grafana-dashboard.json)
77114

78115
* Additional logs available via the Fly.io monitoring dashboard
79116

80-
117+
### Demo Deployment
81118

82-
Demo Deployment
83-
84-
For the current demo, a single CloudSYnc node is deployed in **Europe** on Fly.io.
119+
For the current demo, a single CloudSync node is deployed in **Europe** on Fly.io.
85120
If testing from other regions, latency will reflect this single-node deployment. A production deployment would use **geographically distributed nodes with regional routing** for global coverage.
86121

87122

88-
89123
# Postgres Sync
90124

91125
**Postgres Sync** is a native PostgreSQL extension derived from SQLite Sync.
@@ -105,16 +139,14 @@ SQLite does not support schemas, while PostgreSQL does. To bridge this differenc
105139

106140
This preserves PostgreSQL-native organization while maintaining SQLite compatibility.
107141

108-
109-
110142
# Current Limitations
111143

112144
The PostgreSQL integration is actively evolving. Current limitations include:
113145

114146
* **User Impersonation**: The microservice currently applies server changes using the Supabase Admin user. In the next version, changes will be applied under the identity associated with the client’s JWT.
115147
* **Table Creation**: Tables must currently be created manually in PostgreSQL before synchronization. We are implementing automatic translation of SQLite CREATE TABLE statements to PostgreSQL syntax.
116-
* **Row-Level Security**: RLS is fully implemented for SQLite Cloud servers.PostgreSQL RLS integration is in progress and will be included in the final release.
117-
* **Beta Status**: While extensively tested, the PostgreSQL sync stack should currently be considered **beta software**. Please report any issues, we are committed to resolving them quickly.
148+
* **Row-Level Security**: RLS is fully implemented for SQLite Cloud servers. PostgreSQL RLS integration is in progress and will be included in the final release.
149+
* **Beta Status**: While extensively tested, the PostgreSQL sync stack should currently be considered **beta software**. Please report any issues; we are committed to resolving them quickly.
118150

119151
# Next
120152
* [CLIENT](CLIENT.md) installation and setup

docs/postgresql/SPORT_APP_README_SUPABASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A Vite/React demonstration app showcasing [**SQLite Sync (Dev)**](https://github
1313

1414
### 2. Database Setup
1515
1. Create database
16-
2. Execute the schema with [sport-tracker-schema-postgres.sql](sport-tracker-schema-postgres.sql).
16+
2. Execute the schema with [sport-tracker-schema-postgres.sql](../../examples/sport-tracker-app/sport-tracker-schema-postgres.sql).
1717
3. Enable CloudSync for all tables on the remote database with:
1818
```sql
1919
CREATE EXTENSION IF NOT EXISTS cloudsync;

docs/postgresql/SUPABASE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Supabase deployments.
1010
- Supabase stack running (CLI local or self-hosted)
1111
- The Supabase Postgres image tag in use (e.g. `public.ecr.aws/supabase/postgres:17.6.1.071`)
1212

13-
14-
1513
## Option A: Supabase CLI Local Stack
1614

1715
1) Start the stack once so the Postgres image is present:

0 commit comments

Comments
 (0)