Skip to content

Commit 8c24a40

Browse files
authored
Merge pull request #133 from sqlitecloud/stage
docs: update sqlite-sync
2 parents 1828c75 + eef6c01 commit 8c24a40

File tree

115 files changed

+2321
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2321
-374
lines changed

sqlite-cloud/_nav.ts

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,41 @@ const sidebarNav: SidebarNavStruct = [
77
{ title: "Overview", filePath: "ai-overview", type: "inner", level: 0 },
88
{ title: "SQLite-AI", filePath: "sqlite-ai", type: "inner", level: 0 },
99
{ title: "SQLite-JS", filePath: "sqlite-js", type: "inner", level: 0 },
10-
{ title: "SQLite-Sync", filePath: "sqlite-sync", type: "inner", level: 0 },
10+
{ title: "SQLite-Sync", type: "inner", level: 0 },
11+
{ title: "Introduction", filePath: "sqlite-sync-introduction", type: "inner", level: 1 },
12+
{ title: "Getting Started", filePath: "sqlite-sync-getting-started", type: "inner", level: 1 },
13+
{ title: "Best Practices", filePath: "sqlite-sync-best-practices", type: "inner", level: 1 },
14+
{ title: "Quick Starts", type: "inner", level: 1 },
15+
{ title: "Android", filePath: "sqlite-sync-quick-start-android", type: "inner", level: 2 },
16+
{ title: "iOS", filePath: "sqlite-sync-quick-start-ios", type: "inner", level: 2 },
17+
{ title: "Linux", filePath: "sqlite-sync-quick-start-linux", type: "inner", level: 2 },
18+
{ title: "macOS", filePath: "sqlite-sync-quick-start-macos", type: "inner", level: 2 },
19+
{ title: "React Native Expo", filePath: "sqlite-sync-quick-start-expo", type: "inner", level: 2 },
20+
{ title: "WASM", filePath: "sqlite-sync-quick-start-wasm", type: "inner", level: 2 },
21+
{ title: "Windows", filePath: "sqlite-sync-quick-start-windows", type: "inner", level: 2 },
22+
{ title: "API Reference", type: "inner", level: 1 },
23+
{ title: "cloudsync_init", filePath: "sqlite-sync-api-cloudsync-init", type: "inner", level: 2 },
24+
{ title: "cloudsync_enable", filePath: "sqlite-sync-api-cloudsync-enable", type: "inner", level: 2 },
25+
{ title: "cloudsync_disable", filePath: "sqlite-sync-api-cloudsync-disable", type: "inner", level: 2 },
26+
{ title: "cloudsync_is_enabled", filePath: "sqlite-sync-api-cloudsync-is-enabled", type: "inner", level: 2 },
27+
{ title: "cloudsync_cleanup", filePath: "sqlite-sync-api-cloudsync-cleanup", type: "inner", level: 2 },
28+
{ title: "cloudsync_terminate", filePath: "sqlite-sync-api-cloudsync-terminate", type: "inner", level: 2 },
29+
{ title: "cloudsync_version", filePath: "sqlite-sync-api-cloudsync-version", type: "inner", level: 2 },
30+
{ title: "cloudsync_siteid", filePath: "sqlite-sync-api-cloudsync-siteid", type: "inner", level: 2 },
31+
{ title: "cloudsync_db_version", filePath: "sqlite-sync-api-cloudsync-db-version", type: "inner", level: 2 },
32+
{ title: "cloudsync_uuid", filePath: "sqlite-sync-api-cloudsync-uuid", type: "inner", level: 2 },
33+
{ title: "cloudsync_begin_alter", filePath: "sqlite-sync-api-cloudsync-begin-alter", type: "inner", level: 2 },
34+
{ title: "cloudsync_commit_alter", filePath: "sqlite-sync-api-cloudsync-commit-alter", type: "inner", level: 2 },
35+
{ title: "cloudsync_network_init", filePath: "sqlite-sync-api-cloudsync-network-init", type: "inner", level: 2 },
36+
{ title: "cloudsync_network_cleanup", filePath: "sqlite-sync-api-cloudsync-network-cleanup", type: "inner", level: 2 },
37+
{ title: "cloudsync_network_set_token", filePath: "sqlite-sync-api-cloudsync-network-set-token", type: "inner", level: 2 },
38+
{ title: "cloudsync_network_set_apikey", filePath: "sqlite-sync-api-cloudsync-network-set-apikey", type: "inner", level: 2 },
39+
{ title: "cloudsync_network_has_unsent_changes", filePath: "sqlite-sync-api-cloudsync-network-has-unsent-changes", type: "inner", level: 2 },
40+
{ title: "cloudsync_network_send_changes", filePath: "sqlite-sync-api-cloudsync-network-send-changes", type: "inner", level: 2 },
41+
{ title: "cloudsync_network_check_changes", filePath: "sqlite-sync-api-cloudsync-network-check-changes", type: "inner", level: 2 },
42+
{ title: "cloudsync_network_sync", filePath: "sqlite-sync-api-cloudsync-network-sync", type: "inner", level: 2 },
43+
{ title: "cloudsync_network_reset_sync_version", filePath: "sqlite-sync-api-cloudsync-network-reset-sync-version", type: "inner", level: 2 },
44+
{ title: "cloudsync_network_logout", filePath: "sqlite-sync-api-cloudsync-network-logout", type: "inner", level: 2 },
1145
{ title: "SQLite-Vector", filePath: "sqlite-vector", type: "inner", level: 0 },
1246
{ title: "MCP (Model Context Protocol)", filePath: "mcp-server", type: "inner", level: 0 },
1347

@@ -581,7 +615,7 @@ const sidebarNav: SidebarNavStruct = [
581615
{ title: "CLI", type: "inner", level: 0 },
582616
{ title: "Introduction", filePath: "cli-commands", type: "inner", level: 1 },
583617

584-
{ title: "SQLite", type: "inner", level: 0, href: "/docs/sqlite/" },
618+
{ title: "SQLite", type: "inner", level: 0, href: "/docs/sqlite" },
585619
];
586620

587621
export default sidebarNav;

sqlite-cloud/architecture.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: architecture
88

99

1010
## Architecture
11-
SQLite Cloud uses the [Raft](https://raft.github.io) consensus algorithm to distribute your data changes across a cluster of computing systems, ensuring that each node in the cluster agrees upon the same series of state transitions. Raft implements consensus with a leader approach.
11+
SQLite Cloud uses the <a href="https://raft.github.io" target="_blank">Raft</a> consensus algorithm to distribute your data changes across a cluster of computing systems, ensuring that each node in the cluster agrees upon the same series of state transitions. Raft implements consensus with a leader approach.
1212

1313
SQLite Cloud is written in ANSI C and GO, and it works on most POSIX systems (Linux, *BSD, Mac OS X) and Windows.
1414

sqlite-cloud/multi-code-example.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import MultiCode from '@commons-components/Code/MultiCode.astro';
1010

1111
In this examples, we will show how to use the `MultiCode` component:
1212

13-
- [Here](https://github.com/sqlitecloud/website/blob/docs-stage/commons/components/Code/MultiCode.astro) the definition of the `MultiCode` component.
14-
- [Here](https://github.com/sqlitecloud/website/blob/docs-stage/commons/components/Code/Code.astro) the definition of the `Code` component that is used inside the `MultiCode` component.
13+
- <a href="https://github.com/sqlitecloud/website/blob/docs-stage/commons/components/Code/MultiCode.astro" target="_blank">Here</a> the definition of the `MultiCode` component.
14+
- <a href="https://github.com/sqlitecloud/website/blob/docs-stage/commons/components/Code/Code.astro" target="_blank">Here</a> the definition of the `Code` component that is used inside the `MultiCode` component.
1515

1616

1717
In these two files there are the TypeScript definitions usefull to know all the avaible properties.

sqlite-cloud/platform/_vector.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ insert into vec_items_slim
100100
```
101101

102102
## Performance considerations
103-
Free SQLite Cloud plans are not optimized for large-scale vector workloads. To speak to the team about upgrading your plan, [please reach out](https://www.sqlitecloud.io/support).
103+
Free SQLite Cloud plans are not optimized for large-scale vector workloads. To speak to the team about upgrading your plan, <a href="https://www.sqlitecloud.io/support" target="_blank">please reach out</a>.
104104

105105
## Next Steps
106106
Combined with [edge functions](/docs/edge-functions), SQLite Cloud's vector search capabilities make it a great choice for serverless RAG applications.

sqlite-cloud/platform/access-tokens.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ slug: access-tokens
88

99
Access Tokens let backend systems securely grant users, devices, tenants, etc. access to SQLite Cloud database and services (SQLite Sync, Weblite, etc.). These endpoints enable full token lifecycle management: creation, inspection, validation, update, and revocation. All endpoints require authentication. Use an **API Key** or an **Access Token** via the `Authorization` header.
1010

11-
The API Documentation for the Access Tokens API can be found in the **Weblite** section in the [Dashboard](https://dashboard.sqlitecloud.io).
11+
The API Documentation for the Access Tokens API can be found in the **Weblite** section in the <a href="https://dashboard.sqlitecloud.io" target="_blank">Dashboard</a>.
1212

1313
---
1414

1515
## Example Using SQLite Cloud Access Tokens with Google Login
1616

17-
In the repository on GitHub [sqlitecloud/examples](https://github.com/sqlitecloud/examples/tree/main/access-tokens-and-social-login), we created a simple app to demonstrate how to generate and use Access Tokens.
17+
In the repository on GitHub <a href="https://github.com/sqlitecloud/examples/tree/main/access-tokens-and-social-login" target="_blank">sqlitecloud/examples</a>, we created a simple app to demonstrate how to generate and use Access Tokens.
1818

1919
We’ll log in with Google, grab a token, and use it to interact with SQLite Cloud Weblite APIs. Here’s how it works.
2020

@@ -78,4 +78,4 @@ const res = await fetch("https://<your-project-url>/v2/weblite/sql", {
7878
...
7979
```
8080
81-
The result depends on the [Row Level Security](https://docs.sqlitecloud.io/docs/rls) policies you enabled for the tables.
81+
The result depends on the [Row Level Security](rls) policies you enabled for the tables.

sqlite-cloud/platform/backups.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';
1010
import enableDisableBackup from '@docs-website-assets/introduction/video/dashboard_enable_disable_backup.mp4';
1111
import restoreBackup from '@docs-website-assets/introduction/video/dashboard_restore_backup.mp4';
1212

13-
Backups provide a robust solution for mitigating data loss and resolving data corruption issues. Backups are available for databases in all [Dev, Pro and Startup](https://www.sqlitecloud.io/pricing) projects.
13+
Backups provide a robust solution for mitigating data loss and resolving data corruption issues. Backups are available for databases in all <a href="https://www.sqlitecloud.io/pricing" target="_blank">Dev, Pro and Startup</a> projects.
1414

1515
SQLite Cloud creates a full snapshot backup of your data once a day, and stores incremental changes once per second, on commodity object storage.
1616

sqlite-cloud/platform/edge-functions.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Edge functions let you define custom logic to run on the same nodes as your data
1414

1515
You can write edge functions directly in the SQLite Cloud dashboard using JavaScript, TypeScript, or SQL. Importing modules is not currently supported.
1616

17-
Edge functions can be called remotely over HTTP or Websockets via API, or triggered by database events via SQLite Cloud [Webhooks](https://docs.sqlitecloud.io/docs/webhooks). Each function runs in an isolated environment using the Bun runtime.
17+
Edge functions can be called remotely over HTTP or Websockets via API, or triggered by database events via SQLite Cloud <a href="https://docs.sqlitecloud.io/docs/webhooks" target="_blank">Webhooks</a>. Each function runs in an isolated environment using the Bun runtime.
1818

1919
Turning on linearizable reads ensures strong consistency, but may introduce some latency. When eventual consistency is sufficient, we recommend leaving linearizable reads off.
2020

@@ -81,7 +81,7 @@ return {
8181
}
8282
```
8383

84-
Select the database you would like to access from the "Database" dropdown, or select the database you want to use in your SQL query with the [USE command](https://docs.sqlitecloud.io/docs/database-commands).
84+
Select the database you would like to access from the "Database" dropdown, or select the database you want to use in your SQL query with the <a href="https://docs.sqlitecloud.io/docs/database-commands" target="_blank">USE command</a>.
8585

8686
```js
8787
const customers = await connection.sql`USE DATABASE chinook.sqlite; SELECT * FROM customers;`;
@@ -94,10 +94,10 @@ return {
9494
Environment variables can be accessed and stored with the ENV command. ENV variables are stored in the server settings file and are project-specific.
9595
Use the following commands to set and read values in your server settings file:
9696

97-
* [LIST ENV](https://docs.sqlitecloud.io/docs/settings-commands#list-env)
98-
* [SET ENV](https://docs.sqlitecloud.io/docs/settings-commands#set-env) key VALUE value
99-
* [GET ENV](https://docs.sqlitecloud.io/docs/settings-commands#get-env) key
100-
* [REMOVE ENV](https://docs.sqlitecloud.io/docs/settings-commands#remove-env) key
97+
* <a href="https://docs.sqlitecloud.io/docs/settings-commands#list-env" target="_blank">LIST ENV</a>
98+
* <a href="https://docs.sqlitecloud.io/docs/settings-commands#set-env" target="_blank">SET ENV</a> key VALUE value
99+
* <a href="https://docs.sqlitecloud.io/docs/settings-commands#get-env" target="_blank">GET ENV</a> key
100+
* <a href="https://docs.sqlitecloud.io/docs/settings-commands#remove-env" target="_blank">REMOVE ENV</a> key
101101

102102
You can also add environment variables in the UI by navigating to the "Environment Variables" section and clicking the "Create" button.
103103

sqlite-cloud/platform/extensions.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ These extensions are available for use in your SQLite Cloud databases.
1313
- **[SQLite-Vector](sqlite-vector)**: High performance vector storage extension for similarity search.
1414
- **[SQLite-Sync](sqlite-sync)**: Local-first extension for true local-first data synchronization for your applications.
1515
- **[SQLite-JS](sqlite-js)**: Enables JavaScript integration in SQLite for executing server-side logic.
16-
- **[Full-text Search 5](https://www.sqlite.org/fts5.html)**: Full-text search engine that allows you to search for text in a database.
17-
- **[JSON1](https://www.sqlite.org/json1.html)**: Allows you to easily store, query, and manipulate JSON data.
18-
- **[Math](https://www.sqlite.org/lang_mathfunc.html)**: Mathematical functions.
19-
- **[RTree](https://www.sqlite.org/rtree.html)**: R-Tree index for storing and querying spatial data.
20-
- **[Geopoly](https://www.sqlite.org/geopoly.html)**: A set of functions for working with geospatial data. For a complete guide, see the [comprehensive tutorial here](tutorial-geopoly).
16+
- **<a href="https://www.sqlite.org/fts5.html" target="_blank">Full-text Search 5</a>**: Full-text search engine that allows you to search for text in a database.
17+
- **<a href="https://www.sqlite.org/json1.html" target="_blank">JSON1</a>**: Allows you to easily store, query, and manipulate JSON data.
18+
- **<a href="https://www.sqlite.org/lang_mathfunc.html" target="_blank">Math</a>**: Mathematical functions.
19+
- **<a href="https://www.sqlite.org/rtree.html" target="_blank">RTree</a>**: R-Tree index for storing and querying spatial data.
20+
- **<a href="https://www.sqlite.org/geopoly.html" target="_blank">Geopoly</a>**: A set of functions for working with geospatial data. For a complete guide, see the [comprehensive tutorial here](tutorial-geopoly).
2121

22-
In the future, we plan to allow users to install their own extensions. If you have a specific extension you would like to use, please let us know by [adding to this issue](https://github.com/sqlitecloud/docs/issues/34).
22+
In the future, we plan to allow users to install their own extensions. If you have a specific extension you would like to use, please let us know by <a href="https://github.com/sqlitecloud/docs/issues/34" target="_blank">adding to this issue</a>.

sqlite-cloud/platform/offsync.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import devicesSync from '@docs-website-assets/introduction/video/dashboard_sync_
1313

1414
import Callout from "@commons-components/Information/Callout.astro";
1515

16-
OffSync is a powerful SQLite Cloud feature that enables true **local-first** data synchronization for your applications. Powered by the [SQLite Sync](https://github.com/sqliteai/sqlite-sync) extension, it allows you to build robust, offline-capable applications where data is stored and processed on edge devices and seamlessly synchronized with a central SQLite Cloud database.
16+
OffSync is a powerful SQLite Cloud feature that enables true **local-first** data synchronization for your applications. Powered by the <a href="https://github.com/sqliteai/sqlite-sync" target="_blank">SQLite Sync</a> extension, it allows you to build robust, offline-capable applications where data is stored and processed on edge devices and seamlessly synchronized with a central SQLite Cloud database.
1717

1818
This architecture is ideal for mobile apps, IoT devices, and any application requiring high availability and low latency, even with intermittent network connectivity. By leveraging Conflict-free Replicated Data Types (CRDTs), OffSync ensures that changes made offline are merged automatically and without conflicts when the device reconnects.
1919

sqlite-cloud/platform/rls.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Row-Level Security (RLS) allows you to define fine-grained access control polici
1818
RLS rules only affect users who are authenticated using [Access Tokens](/docs/access-tokens). Admins, APIKEYs, or other non-token users are not restricted by RLS.
1919
</Callout>
2020

21-
RLS is a powerful feature for building secure, multi-tenant applications. When combined with [SQLite Sync](https://github.com/sqliteai/sqlite-sync), it enables you to create robust **local-first apps** where user data is stored on the device for offline availability and superior performance.
21+
RLS is a powerful feature for building secure, multi-tenant applications. When combined with <a href="https://github.com/sqliteai/sqlite-sync" target="_blank">SQLite Sync</a>, it enables you to create robust **local-first apps** where user data is stored on the device for offline availability and superior performance.
2222

2323
This architecture simplifies development by allowing your application to interact with a local database while SQLite Cloud [OffSync](/docs/offsync) transparently handles the synchronization with a central database. RLS ensures that each user's data is securely isolated during this process. The centralized database can then be used for powerful business analytics and reporting across all tenants, without compromising individual data privacy.
2424

@@ -73,7 +73,7 @@ To help you create dynamic RLS policies, SQLite Cloud provides two functions to
7373

7474
These functions are particularly useful for creating policies that are based on user attributes.
7575

76-
For more information on Access Tokens, see the [Access Tokens documentation](/docs/access-tokens). The API Documentation for the Access Tokens API can be found in the Weblite section in the [Dashboard](https://dashboard.sqlitecloud.io/).
76+
For more information on Access Tokens, see the [Access Tokens documentation](/docs/access-tokens). The API Documentation for the Access Tokens API can be found in the Weblite section in the <a href="https://dashboard.sqlitecloud.io/" target="_blank">Dashboard</a>.
7777

7878
### OLD and NEW References
7979

@@ -260,7 +260,7 @@ This policy uses the `OLD` reference to check the value of the `status` column *
260260

261261
## Advanced: RLS and SQLite Sync
262262

263-
When using RLS in conjunction with [SQLite Sync](https://github.com/sqliteai/sqlite-sync), it's important to understand how they interact. The Sync protocol applies changes on a column-by-column basis, which can affect how `INSERT` and `UPDATE` policies are evaluated.
263+
When using RLS in conjunction with <a href="https://github.com/sqliteai/sqlite-sync" target="_blank">SQLite Sync</a>, it's important to understand how they interact. The Sync protocol applies changes on a column-by-column basis, which can affect how `INSERT` and `UPDATE` policies are evaluated.
264264

265265
To accommodate this, SQLite Cloud offers two modes for handling RLS during sync operations, configurable via the `rls_mode` server setting using the SQLite Cloud builtin command `SET KEY rls_mode TO <value>`.
266266

0 commit comments

Comments
 (0)