Skip to content

Commit cdaf93a

Browse files
committed
Merge branch 'feat/clean-up-1' into jacob/update-architecture
2 parents 742b880 + 8fab76f commit cdaf93a

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

sqlite-cloud/_nav.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const sidebarNav: SidebarNavStruct = [
3838
{ title: "Weblite", filePath: "weblite", type: "inner", level: 0 },
3939
// { title: "Storage", type: "inner", level: 0 },
4040
// { title: "Partitioning", type: "inner", level: 0 },
41-
{ title: "Settings", filePath: "settings", type: "inner", level: 0 },
4241

4342
{ title: "SDKs", type: "secondary", icon: "docs-sdk" },
4443
{ title: "C/C++", type: "inner", level: 0 },

sqlite-cloud/connect-cluster.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ slug: connect-cluster
88

99
SQLite databases in SQLite Cloud are distributed across a cluster of nodes. Each cluster comes with a multi-region load balancer that routes traffic to the nearest appropriate node.
1010

11-
To retrieve your project connection string, click the "Connect" button at the bottom of the left sidebar navigation.
12-
13-
Copy the connection string and use it with a client library to connect to your cluster.
11+
Click "Connect" in the bottom left-hand corner of your dashboard to get your connection string to use with a SQLite Cloud client library.
1412

1513
## Connecting with JavaScript
1614
Here's an example of how you can connect to your cluster using the `@sqlitecloud/drivers` JavaScript client library:

sqlite-cloud/create-database.mdx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ status: publish
66
slug: create-database
77
---
88

9-
SQLite Cloud allows you to import existing SQLite Databases, or create a new database in SQLite Cloud by importing an existing SQLite database, or using the SQLite Cloud UI, API, or client libraries.
9+
You can import an existing SQLite databases, or create new databases using the SQLite Cloud UI, API, or client libraries.
1010

1111
## Uploading an existing SQLite Database
1212
### Via HTTP API
@@ -39,7 +39,7 @@ To create a new database from the SQLite Cloud UI, navigate to the Databases tab
3939
The default encoding is set to UTF-8, and the default page size is 4096KB.
4040

4141
### From the API
42-
To create a new database or upload an existing database via [Weblite](#), our REST API, you can make a request with the following parameters:
42+
To create a new database or upload an existing database via [Weblite](/docs/weblite), our REST API, you can make a request with the following parameters:
4343
```bash
4444
curl -X 'POST' \
4545
'https://<your-project-id>.sqlite.cloud:8090/v2/weblite/<database-name>.sqlite' \
@@ -49,18 +49,31 @@ curl -X 'POST' \
4949
```
5050

5151
### From client libraries
52-
To create a new database from a client library, use the CREATE DATABASE command.
52+
To create a new database from a client library, connect to your cluster using a connection string without a specified database.
53+
54+
Then, use the CREATE DATABASE command to create a new database.
55+
56+
To start using the database within the connection, you can use the `USE DATABASE` command.
5357

5458
```javascript
5559
import { Database } from '@sqlitecloud/drivers';
56-
60+
// note that no database name is specified in the connection string path
5761
const db = new Database('sqlitecloud://<your-project-id>.sqlite.cloud:<your-host-port>?apikey=<your-api-key>')
5862

5963
const createDatabase = async () => await db.sql`CREATE DATABASE <database-name>;`;
6064

6165
createDatabase().then((res) => console.log(res));
6266

6367
// "OK"
68+
69+
db.exec('USE DATABASE <database-name>;')
70+
71+
// now you can use the database
72+
const fetchAlbums = async () => await db.exec`SELECT * FROM albums;`;
73+
74+
fetchAlbums().then((albums) => console.log(albums));
75+
76+
// [{ Title: 'For Those About To Rock We Salute You', ... }, ...]
6477
```
6578

6679
## Next Steps

sqlite-cloud/index.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ status: publish
1010

1111
It has been designed from the ground up to ensure strong consistency across all nodes in a cluster while simultaneously managing the technical aspects of scaling, security, and data distribution. This ensures that you can focus on your core tasks while relying on SQLite Cloud to handle the complexities of managing your databases.
1212

13+
SQLite Cloud is built on the open source SQLite engine, ensuring complete feature parity. You get all of SQLite's core strengths: ACID compliance, support for complex SQL operations, and compatibility with the rich SQLite extension ecosystem.
14+
1315
You can access SQLite Cloud from the most popular programming languages or its REST API.
1416

17+
Like SQLite, each database in SQLite Cloud is a separate file, giving you flexible deployment options:
18+
19+
* Create separate databases for each customer in a multi-tenant application
20+
* Share a single database among multiple users with built-in access controls
21+
* Mix both approaches based on your application's needs
22+
1523
### Features
1624
SQLite Cloud provides a comprehensive suite of tools for building realtime, local-first, edge AI applications.
17-
* **Local Sync**: Read and write to your local SQLite database, then synchronize with the cloud and across devices in the background. (**alpha**)
18-
* **Offline-first**: Automatically resolve conflicts between devices and the cloud with CRDTs. (**alpha**)
19-
* **[Webhooks](/docs/webhooks)**: Send changes in your database to an external webhook or use to trigger actions.
20-
* **[Edge Functions](/docs/edge-functions)**: Run serverless functions next to your database. Trigger via HTTP endpoint or on database operations (INSERT, UPDATE, DELETE).
25+
* **[Webhooks](/docs/webhooks)**: Trigger edge functions or send change payloads via HTTP, Websockets, or on database events like INSERT, UPDATE, and DELETE.
26+
* **[Edge Functions](/docs/edge-functions)**: Run serverless functions on the same nodes that store your data for lightning-fast data access.
2127
* **[Pub/Sub](/docs/pub-sub)**: Subscribe to changes in your database to replicate data, power notifications, and build multiplayer experiences.
22-
* **[Weblite](/docs/weblite)**: Autogenerated REST APIs to interact with your database and edge functions.
28+
* **[Weblite](/docs/weblite)**: Autogenerated REST APIs to interact with the SQLite Cloud platform.
2329
* **[Query Analyzer](/docs/analyzer)**: Receive optimization recommendations for your queries to improve performance.
24-
* **Multi-region Load Balancer**: Connect from anywhere and SQLite Cloud automatically routes traffic to the nearest node for optimal performance.

sqlite-cloud/platform/edge-functions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ status: publish
66
slug: edge-functions
77
---
88

9-
Edge Functions are server-side functions that run directly within your database environment. Edge functions in SQLite Cloud ensure maximum performance and minimal latency by running functions on the same server as your database.
9+
Edge functions let you define custom logic to run on the same nodes as your database files for ultra-fast performance.
1010

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

sqlite-cloud/platform/settings.mdx

Lines changed: 0 additions & 11 deletions
This file was deleted.

sqlite-cloud/platform/webhooks.mdx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ status: publish
66
slug: webhooks
77
---
88

9-
Utilize the Webhooks panel to effortlessly establish real-time notifications for write operations within your SQLite database. In this instance, we'll seamlessly notify a webhook.site service each time a write operation occurs within the albums table of the chinook.sqlite database.
9+
Webhooks in SQLite Cloud are a powerful way to receive and send event-based notifications.
1010

11-
![Dashboard Projects](@docs-website-assets/introduction/dashboard_webhook_create.png)
11+
## Change Data Capture
12+
With change data webhooks, you can send notifications from SQLite Cloud to any HTTP endpoint when an insert, update or delete operation occurs on a specified database and/or table. The webhook payload includes the database name, table name, and the row data that was changed.
1213

13-
Upon creation, you'll receive a secret value that ensures the authenticity of each notification request.
14-
15-
![Dashboard Projects](@docs-website-assets/introduction/dashboard_webhook_create2.png)
16-
17-
Additionally, access a comprehensive list of all enabled webhooks for your project.
18-
19-
![Dashboard Projects](@docs-website-assets/introduction/dashboard_webhook_list.png)
14+
## Trigger Edge Functions
15+
Webhooks can also be used to trigger your edge functions, either via HTTP or Websockets request, or on a database event.

sqlite-cloud/write-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ INSERT INTO sports_cars (sc_make, sc_year) VALUES ('Ferrari', 2021);
2424
```
2525

2626
## Writing data with the Weblite API
27-
You can use the API to run SQL commands against your cluster.
27+
You can use the [Weblite API](/docs/weblite) to run SQL commands against your cluster. Here is an example cURL request:
2828

2929
```bash
3030
curl -X 'POST' \

0 commit comments

Comments
 (0)