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
#pragma warning disable CS8618// Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
#pragma warning disable CS8618// Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
Copy file name to clipboardExpand all lines: demos/CommandLine/README.md
+32-2Lines changed: 32 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,36 @@ 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
+
> **Note for Supabase users:**
13
+
> If you are using `USE_SUPABASE=true`, this demo expects a valid, **already existing Supabase user**.
14
+
> You must provide their credentials via the `.env` file using `SUPABASE_USERNAME` and `SUPABASE_PASSWORD`.
15
+
16
+
## Connection Options
17
+
18
+
By default, this demo uses the NodeConnector for connecting to the PowerSync server. However, you can swap this out with the SupabaseConnector if needed
19
+
20
+
1. Copy the `.env.template` file to a new `.env` file:
21
+
```bash
22
+
# On Linux/macOS
23
+
cp .env.template .env
24
+
25
+
# On Windows
26
+
copy .env.template .env
27
+
```
28
+
29
+
2. Replace the necessary fields in the `.env` file with your Supabase and PowerSync credentials:
30
+
```
31
+
SUPABASE_URL=your-supabase-url
32
+
SUPABASE_ANON_KEY=your_anon_key_here
33
+
POWERSYNC_URL=your-powersync-url
34
+
BACKEND_URL=your-backend-url
35
+
SUPABASE_USERNAME=your-supabase-username
36
+
SUPABASE_PASSWORD=your-supabase-password
37
+
# Set to true if you want to use Supabase as the backend
38
+
# Set to false if you want to use the Powersync backend
39
+
USE_SUPABASE=false
40
+
```
41
+
12
42
## Getting Started
13
43
14
44
In the repo root, run the following to download the PowerSync extension:
@@ -29,4 +59,4 @@ To run the Command-Line interface:
0 commit comments