You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backups provide a robust solution for mitigating data loss and resolving data corruption issues. Backups are available for databases in all [Pro and Scale](https://www.sqlitecloud.io/pricing) projects.
14
+
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.
11
15
12
16
SQLite Cloud creates a full snapshot backup of your data once a day, and stores incremental changes once per second, on commodity object storage.
13
17
@@ -23,18 +27,11 @@ SQLite Cloud creates a full snapshot backup of your data once a day, and stores
23
27
## Getting Started
24
28
Setting up and managing backups in SQLite Cloud is designed to be straightforward, allowing you to implement robust data protection strategies effortlessly.
Click on a backup to begin the restore process. Select Yes to confirm the restoration, and your database will be restored to the selected point in time.
Edge functions let you define custom logic to run on the same nodes as your database files for ultra-fast performance.
10
12
@@ -15,11 +17,59 @@ Edge functions can be called remotely over HTTP or Websockets via API, or trigge
15
17
Turning on linearizable reads ensures strong consistency, but may introduce some latency. When eventual consistency is sufficient, we recommend leaving linearizable reads off.
16
18
17
19
## Getting Started
18
-
1. Navigate to the Edge Functions page from your dashboard.
19
-
2. Under "Development", select "Edge Function", then click the "Create" button.
20
-
3. Write and test your function.
21
-
1. Select the database you want to access and an API key if necessary
22
-
2. When you're finished, click deploy.
20
+
21
+
This guide explains how to create, deploy, and test Edge Functions in the SQLite Cloud UI.
22
+
23
+
<VideoPlayersrc={edgeFunctions} />
24
+
25
+
26
+
27
+
1. Open the Edge Functions Section
28
+
- From the left-hand sidebar, click the **Edge Functions** icon.
29
+
- You will see the list of your functions on the left and the code editor on the right.
30
+
31
+
2. Create a New Function
32
+
- Click the **+** button next to *Filter functions...*.
33
+
- Choose the function type: **SQL**, **JavaScript**, or **TypeScript**.
34
+
- A new function (e.g., `function-1`) will appear in the list.
35
+
36
+
3. Write Your Function Code
37
+
- Use the editor to implement your logic.
38
+
- You can include request parameters, execute SQL queries, and return custom objects.
39
+
40
+
4. Select the Target Database
41
+
- At the bottom of the editor, choose the database (e.g., `chinook.sqlite`).
42
+
- You can search and switch databases if needed.
43
+
44
+
5. Deploy the Function
45
+
- Before testing, you must **Deploy** the function.
46
+
- Click the **Deploy** button in the bottom-right corner.
47
+
- The function is now active and ready to be tested.
48
+
49
+
6. Test the Function
50
+
- After deployment, click **Test**.
51
+
- A panel will open on the right where you can configure:
52
+
-**User** → choose a user with access to the selected database.
53
+
-**API Key** → select the appropriate key.
54
+
-**Request Body** → provide JSON input (e.g., `{ "filter": "a" }`).
- The response will be shown at the bottom of the test panel.
60
+
- It includes your custom message, the SQL results, and the request object.
61
+
62
+
8. Enable Linearizable Reads (Optional)
63
+
- If your database is frequently modified and you want strong consistency,
64
+
toggle **Linearizable** at the bottom before testing or deploying.
65
+
66
+
9. View the Function Details
67
+
- Switch to the **Details** tab to check deployment information.
68
+
- You can see:
69
+
- The **last deployed date and time**.
70
+
- The **Function URL**, which you can copy and use to call the function from external applications
71
+
72
+
23
73
24
74
#### Note:
25
75
Functions should return a JSON-serializable object with a data field:
@@ -32,22 +82,16 @@ return {
32
82
```
33
83
34
84
### Authorization
35
-
Edge functions that access your SQLite databases must be authorized via API key. You can automatically authorize an edge function on every call by assigning it an API key via the "API KEY" dropdown.
85
+
Edge functions that access your SQLite databases must be authorized via API key.
36
86
37
-
If no API key is assigned, an API key must be sent in the request url as a query parameter (`?apikey=YOUR_API_KEY`) or as an attribute in the request body (`{ apikey: YOUR_API_KEY }`).
87
+
An API key must be sent in the request url as a query parameter (`?apikey=YOUR_API_KEY`) or as an attribute in the request body (`{ apikey: YOUR_API_KEY }`).
38
88
39
89
### Execution
40
90
41
91
Edge functions can be called via HTTP GET and POST methods. You can pass additional values to your edge function in two ways:
42
92
- Query parameters: Accessible via `request.params`
43
93
- Request body: Accessible via `request.data`
44
94
45
-
### Testing
46
-
You may test the execution of edge functions by clicking the "Test" command.
47
-
48
-
You are not required to supply an API key when testing your edge function in the console. The function will run using the dashboard user privileges.
**Webhooks** are HTTP callbacks that allow your applications to receive real-time notifications when specific events occur. In the context of SQLite Cloud, webhooks make it easy to build reactive systems by automatically sending notifications when data changes happen within your databases.
10
13
11
14
## Real-Time Notifications for Database Writes
12
15
16
+
13
17
Use the **Webhooks panel** to effortlessly create real-time notifications for write operations—such as inserts, updates, or deletes—within your SQLite Cloud database.
14
18
15
19
For example, you can configure SQLite Cloud to notify a [webhook.site](https://webhook.site) endpoint every time a write operation occurs on the `albums` table of the `chinook.sqlite` database.
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.
13
12
14
13
## Writing data with the SQLite Cloud UI
15
-
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.
14
+
Navigate to the Studio tab from the left-hand navigation. From here, you can run SQL commands directly on your cluster.
15
+
If needed, use the dropdown menus to select the database and table where you want to insert or update data.
16
+
17
+
Alternatively, you can also interact directly with the table view to add new records or update existing ones without writing SQL manually.
0 commit comments