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
"UPDATE lists SET name = ?, created_at = datetime() WHERE owner_id = ? and id = ?",["update CHCHCHCHCH",connector.UserId,"0bf55412-d35b-4814-ade9-daea4865df96"]
Copy file name to clipboardExpand all lines: demos/CommandLine/README.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# PowerSync CLI demo app
1
+
# PowerSync CLI Demo App
2
2
3
3
This demo features a CLI-based table view that stays *live* using a *watch query*, ensuring the data updates in real time as changes occur.
4
4
To run this demo, you need to have one of our Node.js self-host demos ([Postgres](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs) | [MongoDB](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mongodb) | [MySQL](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mysql)) running, as it provides the PowerSync server that this CLI's PowerSync SDK connects to.
@@ -9,6 +9,28 @@ Changes made to the backend's source DB or to the self-hosted web UI will be syn
9
9
10
10
This essentially uses anonymous authentication. A random user ID is generated and stored in local storage. The backend returns a valid token which is not linked to a specific user. All data is synced to all users.
11
11
12
+
## Connection Options
13
+
14
+
By default, this demo uses the NodeConnector for connecting to the PowerSync server. However, you can swap this out with the SupabaseConnector if needed:
15
+
16
+
1. Copy the `.env.template` file to a new `.env` file:
17
+
```bash
18
+
# On Linux/macOS
19
+
cp .env.template .env
20
+
21
+
# On Windows
22
+
copy .env.template .env
23
+
```
24
+
25
+
2. Replace the necessary fields in the `.env` file with your Supabase and PowerSync credentials:
26
+
```
27
+
SUPABASE_URL=your_supabase_url
28
+
SUPABASE_ANON_KEY=your_supabase_anon_key
29
+
POWERSYNC_URL=your_powersync_url
30
+
```
31
+
32
+
3. Update your connector configuration to use SupabaseConnector instead of NodeConnector
33
+
12
34
## Getting Started
13
35
14
36
In the repo root, run the following to download the PowerSync extension:
@@ -29,4 +51,4 @@ To run the Command-Line interface:
0 commit comments