Skip to content

Commit d35bf9a

Browse files
committed
clean up initial flow
1 parent f8f654c commit d35bf9a

File tree

4 files changed

+25
-27
lines changed

4 files changed

+25
-27
lines changed

sqlite-cloud/_nav.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const sidebarNav: SidebarNavStruct = [
44
{ title: "", type: "primary" },
55
{ title: "Introduction", type: "secondary", icon: "docs-star" },
66
{ title: "Getting Started", href: "/docs/sqlite-cloud", type: "inner", level: 0 },
7-
{ title: "Fundamentals", type: "inner", level: 0 },
87
{ title: "Connecting", filePath: "connect-cluster", type: "inner", level: 1 },
98
{ title: "Creating a database", filePath: "create-database", type: "inner", level: 1 },
109
{ title: "Writing data", filePath: "write-data", type: "inner", level: 1 },

sqlite-cloud/connect-cluster.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +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-
For this reason, we strongly recommend connecting to your cluster via your project connection string. To retrieve your project connection string, navigate to the **Nodes** page and click on any node.
12-
{/* ![Project connection string modal](@docs-website-assets/connect-cluster-1.png) */}
11+
To retrieve your project connection string, click the "Connect" button at the bottom of the left sidebar navigation.
1312

1413
Copy the connection string and use it with a client library to connect to your cluster.
1514

@@ -63,4 +62,5 @@ conn.close()
6362
```
6463

6564
## Next Steps
65+
- [Creating a database](/docs/create-database)
6666
- [Writing data](/docs/write-data)

sqlite-cloud/create-database.mdx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,23 @@ slug: create-database
88

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

11-
## Importing an existing SQLite database
12-
SQLite Cloud allows you to import existing SQLite databases into the platform.
11+
## Uploading an existing SQLite Database
12+
### Via HTTP API
13+
You can upload an existing SQLite database to your cluster using the SQLite Cloud UI or the Weblite API.
1314

14-
Note that you can download, modify, and re-upload the database file at any time. You can also upload encrypted SQLite databases if you used the official SEE SQLite encryption extension.
15+
To upload a local SQLite database via weblite, make a POST request to the `/v2/weblite/<database-name>.sqlite` endpoint.
1516

17+
```bash
18+
curl -X 'POST' \
19+
'https://<your-project-id>.sqlite.cloud:8090/v2/weblite/<database-name>.sqlite' \
20+
-H 'accept: application/json' \
21+
-H 'Authorization: Bearer sqlitecloud://<your-project-id>.sqlite.cloud:8860?apikey=<your-api-key>' \
22+
-d ''
23+
```
24+
25+
To upload a local SQLite database via the SQLite Cloud UI, navigate to the Database tab in the left-hand navigation. Click the "Upload Database" button and select your local SQLite database.
26+
27+
### Via Dashboard UI
1628
To import a database from the UI, navigate to the Databases tab and click the "Upload Database" button.
1729
![Dashbord Upload Database](@docs-website-assets/introduction/dashboard_upload_db.png)
1830

@@ -51,3 +63,5 @@ createDatabase().then((res) => console.log(res));
5163
// "OK"
5264
```
5365

66+
## Next Steps
67+
- [Writing data](/docs/write-data)

sqlite-cloud/write-data.mdx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ slug: write-data
88

99
After you've created a database in SQLite Cloud, you can start writing data to it. You can write data to your cluster using the SQLite Cloud UI, API, or client libraries.
1010

11-
## Upload an existing SQLite Database
12-
You can upload an existing SQLite database to your cluster using the SQLite Cloud UI or the Weblite API.
13-
14-
To upload a local SQLite database via weblite, make a POST request to the `/v2/weblite/<database-name>.sqlite` endpoint.
15-
16-
```bash
17-
curl -X 'POST' \
18-
'https://<your-project-id>.sqlite.cloud:8090/v2/weblite/<database-name>.sqlite' \
19-
-H 'accept: application/json' \
20-
-H 'Authorization: Bearer sqlitecloud://<your-project-id>.sqlite.cloud:8860?apikey=<your-api-key' \
21-
-d ''
22-
```
23-
24-
To upload a local SQLite database via the SQLite Cloud UI, navigate to the Database tab in the left-hand navigation. Click the "Upload Database" button and select your local SQLite database.
25-
2611
## Writing data with the SQLite Cloud UI
2712
Navigate to the console tab in the left-hand navigation. From here, you can run SQL commands against your cluster. Use the optional dropdown menus to select a database and table.
2813

@@ -31,11 +16,11 @@ Navigate to the console tab in the left-hand navigation. From here, you can run
3116
### Example
3217
```sql
3318
-- If you haven't selected a database yet, run the USE DATABASE command
34-
USE DATABASE mydatabase.sqlite;
19+
USE DATABASE <your-database-name>.sqlite;
3520
-- Create your table
36-
CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_name TEXT NOT NULL, sc_year INTEGER NOT NULL, image BLOB);
21+
CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_make TEXT NOT NULL, sc_year INTEGER NOT NULL);
3722
-- Insert data into your table
38-
INSERT INTO sports_cars (sc_name, sc_year, image) VALUES ('Ferrari', 2021, 'https://example.com/ferrari.jpg');
23+
INSERT INTO sports_cars (sc_make, sc_year) VALUES ('Ferrari', 2021);
3924
```
4025

4126
## Writing data with the Weblite API
@@ -56,10 +41,10 @@ To write data to your cluster using a client library, use the INSERT INTO SQL co
5641
import { Database } from '@sqlitecloud/drivers';
5742

5843
const db = new Database('sqlitecloud://<your-project-id>.sqlite.cloud:<your-host-port>?apikey=<your-api-key>')
59-
db.exec('USE DATABASE mydatabase.sqlite;')
60-
db.exec('CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_name TEXT NOT NULL, sc_year INTEGER NOT NULL, image BLOB);')
44+
db.exec('USE DATABASE <your-database-name>.sqlite;')
45+
db.exec('CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_make TEXT NOT NULL, sc_year INTEGER NOT NULL);')
6146
db.commit()
62-
const insertData = async () => await db.sql`INSERT INTO sports_cars (sc_name, sc_year, image) VALUES ('Ferrari', 2021, 'https://example.com/ferrari.jpg');`;
47+
const insertData = async () => await db.sql`INSERT INTO sports_cars (sc_make, sc_year) VALUES ('Ferrari', 2021);`;
6348

6449
insertData().then((res) => console.log(res));
6550
// "OK"

0 commit comments

Comments
 (0)