55
66## Install Proton
77
8+ Please install Proton as a standalone server or via Docker. Make sure port 8123 is exposed for ` pront-rust-client ` to connect and run SQL.
9+
810### As a single binary
911
1012On Linux or Mac, you can install it via ` curl https://install.timeplus.com | sh `
@@ -18,10 +20,10 @@ In a separate terminal, connect to the server via `proton client` (Note: If you
1820### As a Docker container
1921
2022``` bash
21- docker run -d --pull always --name proton ghcr.io/timeplus-io/proton:latest
23+ docker run -d --pull always --name proton -p 8123:8123 -p 8463:8463 ghcr.io/timeplus-io/proton:latest
2224```
2325
24- Proton is automatically started. Open the terminal of the container, and run ` proton client `
26+ Proton is automatically started with port 8123 and 8463 exposed . Open the terminal of the container, and run ` proton client `
2527
2628
2729For detailed usage and more information, check out the documentation: https://docs.timeplus.com/proton
@@ -58,7 +60,7 @@ const FN_NAME: &str = "[prepare]:";
5860async fn main () -> Result <()> {
5961 println! (" {} Start" , FN_NAME );
6062
61- println! (" {}Build client" , FN_NAME );
63+ println! (" {} Build client" , FN_NAME );
6264 let client = ProtonClient :: new (" http://localhost:8123" );
6365
6466 println! (" {} Create stream if not exists" , FN_NAME );
@@ -74,28 +76,30 @@ async fn main() -> Result<()> {
7476
7577## Run the client code example
7678
79+ In the root folder of ` protno-rust-client `
80+
77811 ) Create a stream and insert some data
7882
7983```
80- cargo run --bin prepare
84+ cargo run --example prepare
8185```
8286
8387Expected output
8488
8589```
86- [prepare]: Start
90+ [prepare]:Start
8791[prepare]:Build client
88- [prepare]: Create stream if not exists
92+ [prepare]:Create stream if not exists
8993[prepare]:Insert data
9094[prepare]:Count inserted data
9195[prepare]:Inserted data: 1000
92- [prepare]: Stop
96+ [prepare]:Stop
9397```
9498
95992 ) Stream some data (fetch) and load all data at once (fetch_all)
96100
97101```
98- cargo run --bin main
102+ cargo run --example query
99103```
100104
101105Expected output
@@ -110,21 +114,21 @@ MyRow { no: 503, name: "foo" }
110114MyRow { no: 504, name: "foo" }
111115[main]:Fetch all data
112116[MyRowOwned { no: 500, name: "foo" }, MyRowOwned { no: 501, name: "foo" }, MyRowOwned { no: 502, name: "foo" }, MyRowOwned { no: 503, name: "foo" }, MyRowOwned { no: 504, name: "foo" }]
113- [main]: Stop
117+ [main]:Stop
114118```
115119
1161203 ) Cleanup and delete stream
117121
118122
119123```
120- cargo run --bin cleanup
124+ cargo run --example remove
121125```
122126
123127Expected output
124128
125129```
126- [prepare]: Start
130+ [prepare]:Start
127131[prepare]:Build client
128- [prepare]: Delete Stream
129- [prepare]: Stop
132+ [prepare]:Delete Stream
133+ [prepare]:Stop
130134```
0 commit comments