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. To run this demo, you need to have one of our Node.js self-host demos (Postgres | MongoDB | MySQL) running, as it provides the PowerSync server that this CLI's PowerSync SDK connects to.
Changes made to the backend's source DB or to the self-hosted web UI will be synced to this CLI client (and vice versa).
By default, this demo uses the NodeConnector for connecting to the PowerSync server. However, you can swap this out with the SupabaseConnector if needed
-
Copy the
.env.templatefile to a new.envfile:# On Linux/macOS cp .env.template .env # On Windows copy .env.template .env
-
Replace the necessary fields in the
.envfile with your Supabase and PowerSync credentials.
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.
Note for Supabase users:
If you are usingUSE_SUPABASE=true, this demo expects a valid, already existing Supabase user.
You must provide their credentials via the.envfile usingSUPABASE_USERNAMEandSUPABASE_PASSWORD.
In the repo root, run the following to download the PowerSync extension:
dotnet run --project Tools/Setup Then switch into the demo's directory:
Install dependencies:
dotnet restoreTo run the Command-Line interface:
dotnet run Demo