-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6191f5
commit ce36abc
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Electric Bash Client | ||
|
||
A simple bash client for consuming Electric shape logs. This client can connect to any Electric shape URL and stream updates in real-time. | ||
|
||
## Requirements | ||
|
||
- bash | ||
- curl | ||
- jq (for JSON processing) | ||
|
||
## Usage | ||
|
||
```bash | ||
./client.bash 'YOUR_SHAPE_URL' | ||
``` | ||
|
||
For example: | ||
```bash | ||
./client.bash 'http://localhost:3000/v1/shape?table=notes' | ||
``` | ||
|
||
## Example Output | ||
|
||
When first connecting, you'll see the initial shape data: | ||
```json | ||
[ | ||
{ | ||
"key": "\"public\".\"notes\"/\"1\"", | ||
"value": { | ||
"id": "1", | ||
"title": "Example Note", | ||
"created_at": "2024-12-05 01:43:05.219957+00" | ||
}, | ||
"headers": { | ||
"operation": "insert", | ||
"relation": [ | ||
"public", | ||
"notes" | ||
] | ||
}, | ||
"offset": "0_0" | ||
} | ||
] | ||
``` | ||
|
||
Once caught up, the client switches to live mode and streams updates: | ||
``` | ||
Found control message | ||
Control value: up-to-date | ||
Shape is up to date, switching to live mode | ||
``` | ||
|
||
Any changes to the shape will be streamed in real-time. |