Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions sqlite-cloud/_nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,41 @@ const sidebarNav: SidebarNavStruct = [
{ title: "Overview", filePath: "ai-overview", type: "inner", level: 0 },
{ title: "SQLite-AI", filePath: "sqlite-ai", type: "inner", level: 0 },
{ title: "SQLite-JS", filePath: "sqlite-js", type: "inner", level: 0 },
{ title: "SQLite-Sync", filePath: "sqlite-sync", type: "inner", level: 0 },
{ title: "SQLite-Sync", type: "inner", level: 0 },
{ title: "Introduction", filePath: "sqlite-sync-introduction", type: "inner", level: 1 },
{ title: "Getting Started", filePath: "sqlite-sync-getting-started", type: "inner", level: 1 },
{ title: "Best Practices", filePath: "sqlite-sync-best-practices", type: "inner", level: 1 },
{ title: "Quick Starts", type: "inner", level: 1 },
{ title: "Android", filePath: "sqlite-sync-quick-start-android", type: "inner", level: 2 },
{ title: "iOS", filePath: "sqlite-sync-quick-start-ios", type: "inner", level: 2 },
{ title: "Linux", filePath: "sqlite-sync-quick-start-linux", type: "inner", level: 2 },
{ title: "macOS", filePath: "sqlite-sync-quick-start-macos", type: "inner", level: 2 },
{ title: "React Native Expo", filePath: "sqlite-sync-quick-start-expo", type: "inner", level: 2 },
{ title: "WASM", filePath: "sqlite-sync-quick-start-wasm", type: "inner", level: 2 },
{ title: "Windows", filePath: "sqlite-sync-quick-start-windows", type: "inner", level: 2 },
{ title: "API Reference", type: "inner", level: 1 },
{ title: "cloudsync_init", filePath: "sqlite-sync-api-cloudsync-init", type: "inner", level: 2 },
{ title: "cloudsync_enable", filePath: "sqlite-sync-api-cloudsync-enable", type: "inner", level: 2 },
{ title: "cloudsync_disable", filePath: "sqlite-sync-api-cloudsync-disable", type: "inner", level: 2 },
{ title: "cloudsync_is_enabled", filePath: "sqlite-sync-api-cloudsync-is-enabled", type: "inner", level: 2 },
{ title: "cloudsync_cleanup", filePath: "sqlite-sync-api-cloudsync-cleanup", type: "inner", level: 2 },
{ title: "cloudsync_terminate", filePath: "sqlite-sync-api-cloudsync-terminate", type: "inner", level: 2 },
{ title: "cloudsync_version", filePath: "sqlite-sync-api-cloudsync-version", type: "inner", level: 2 },
{ title: "cloudsync_siteid", filePath: "sqlite-sync-api-cloudsync-siteid", type: "inner", level: 2 },
{ title: "cloudsync_db_version", filePath: "sqlite-sync-api-cloudsync-db-version", type: "inner", level: 2 },
{ title: "cloudsync_uuid", filePath: "sqlite-sync-api-cloudsync-uuid", type: "inner", level: 2 },
{ title: "cloudsync_begin_alter", filePath: "sqlite-sync-api-cloudsync-begin-alter", type: "inner", level: 2 },
{ title: "cloudsync_commit_alter", filePath: "sqlite-sync-api-cloudsync-commit-alter", type: "inner", level: 2 },
{ title: "cloudsync_network_init", filePath: "sqlite-sync-api-cloudsync-network-init", type: "inner", level: 2 },
{ title: "cloudsync_network_cleanup", filePath: "sqlite-sync-api-cloudsync-network-cleanup", type: "inner", level: 2 },
{ title: "cloudsync_network_set_token", filePath: "sqlite-sync-api-cloudsync-network-set-token", type: "inner", level: 2 },
{ title: "cloudsync_network_set_apikey", filePath: "sqlite-sync-api-cloudsync-network-set-apikey", type: "inner", level: 2 },
{ title: "cloudsync_network_has_unsent_changes", filePath: "sqlite-sync-api-cloudsync-network-has-unsent-changes", type: "inner", level: 2 },
{ title: "cloudsync_network_send_changes", filePath: "sqlite-sync-api-cloudsync-network-send-changes", type: "inner", level: 2 },
{ title: "cloudsync_network_check_changes", filePath: "sqlite-sync-api-cloudsync-network-check-changes", type: "inner", level: 2 },
{ title: "cloudsync_network_sync", filePath: "sqlite-sync-api-cloudsync-network-sync", type: "inner", level: 2 },
{ title: "cloudsync_network_reset_sync_version", filePath: "sqlite-sync-api-cloudsync-network-reset-sync-version", type: "inner", level: 2 },
{ title: "cloudsync_network_logout", filePath: "sqlite-sync-api-cloudsync-network-logout", type: "inner", level: 2 },
{ title: "SQLite-Vector", filePath: "sqlite-vector", type: "inner", level: 0 },
{ title: "MCP (Model Context Protocol)", filePath: "mcp-server", type: "inner", level: 0 },

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

{ title: "SQLite", type: "inner", level: 0, href: "/docs/sqlite/" },
{ title: "SQLite", type: "inner", level: 0, href: "/docs/sqlite" },
];

export default sidebarNav;
2 changes: 1 addition & 1 deletion sqlite-cloud/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: architecture


## Architecture
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.
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.

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

Expand Down
4 changes: 2 additions & 2 deletions sqlite-cloud/multi-code-example.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import MultiCode from '@commons-components/Code/MultiCode.astro';

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

- [Here](https://github.com/sqlitecloud/website/blob/docs-stage/commons/components/Code/MultiCode.astro) the definition of the `MultiCode` component.
- [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.
- <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.
- <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.


In these two files there are the TypeScript definitions usefull to know all the avaible properties.
Expand Down
2 changes: 1 addition & 1 deletion sqlite-cloud/platform/_vector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ insert into vec_items_slim
```

## Performance considerations
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).
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>.

## Next Steps
Combined with [edge functions](/docs/edge-functions), SQLite Cloud's vector search capabilities make it a great choice for serverless RAG applications.
Expand Down
6 changes: 3 additions & 3 deletions sqlite-cloud/platform/access-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ slug: access-tokens

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.

The API Documentation for the Access Tokens API can be found in the **Weblite** section in the [Dashboard](https://dashboard.sqlitecloud.io).
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>.

---

## Example Using SQLite Cloud Access Tokens with Google Login

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.
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.

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

Expand Down Expand Up @@ -78,4 +78,4 @@ const res = await fetch("https://<your-project-url>/v2/weblite/sql", {
...
```

The result depends on the [Row Level Security](https://docs.sqlitecloud.io/docs/rls) policies you enabled for the tables.
The result depends on the [Row Level Security](rls) policies you enabled for the tables.
2 changes: 1 addition & 1 deletion sqlite-cloud/platform/backups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import VideoPlayer from '@commons-components/Video/VideoPlayer.astro';
import enableDisableBackup from '@docs-website-assets/introduction/video/dashboard_enable_disable_backup.mp4';
import restoreBackup from '@docs-website-assets/introduction/video/dashboard_restore_backup.mp4';

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.
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.

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

Expand Down
12 changes: 6 additions & 6 deletions sqlite-cloud/platform/edge-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Edge functions let you define custom logic to run on the same nodes as your data

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

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.
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.

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

Expand Down Expand Up @@ -81,7 +81,7 @@ return {
}
```

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).
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>.

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

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

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

Expand Down
12 changes: 6 additions & 6 deletions sqlite-cloud/platform/extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ These extensions are available for use in your SQLite Cloud databases.
- **[SQLite-Vector](sqlite-vector)**: High performance vector storage extension for similarity search.
- **[SQLite-Sync](sqlite-sync)**: Local-first extension for true local-first data synchronization for your applications.
- **[SQLite-JS](sqlite-js)**: Enables JavaScript integration in SQLite for executing server-side logic.
- **[Full-text Search 5](https://www.sqlite.org/fts5.html)**: Full-text search engine that allows you to search for text in a database.
- **[JSON1](https://www.sqlite.org/json1.html)**: Allows you to easily store, query, and manipulate JSON data.
- **[Math](https://www.sqlite.org/lang_mathfunc.html)**: Mathematical functions.
- **[RTree](https://www.sqlite.org/rtree.html)**: R-Tree index for storing and querying spatial data.
- **[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).
- **<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.
- **<a href="https://www.sqlite.org/json1.html" target="_blank">JSON1</a>**: Allows you to easily store, query, and manipulate JSON data.
- **<a href="https://www.sqlite.org/lang_mathfunc.html" target="_blank">Math</a>**: Mathematical functions.
- **<a href="https://www.sqlite.org/rtree.html" target="_blank">RTree</a>**: R-Tree index for storing and querying spatial data.
- **<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).

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).
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>.
2 changes: 1 addition & 1 deletion sqlite-cloud/platform/offsync.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import devicesSync from '@docs-website-assets/introduction/video/dashboard_sync_

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

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.
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.

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.

Expand Down
6 changes: 3 additions & 3 deletions sqlite-cloud/platform/rls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Row-Level Security (RLS) allows you to define fine-grained access control polici
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.
</Callout>

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.
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.

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.

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

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

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/).
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>.

### OLD and NEW References

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

## Advanced: RLS and SQLite Sync

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.
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.

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>`.

Expand Down
Loading