Skip to content

Commit fbb9308

Browse files
author
Jove Zhong
committed
Update README.md
1 parent 4f2aa62 commit fbb9308

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,28 @@ const FN_NAME: &str = "[prepare]:";
7878

7979
#[tokio::main]
8080
async fn main() -> Result<()> {
81-
println!("{} Start", FN_NAME);
81+
println!("{}Start", FN_NAME);
8282

8383
println!("{}Build client", FN_NAME);
8484
let client = ProtonClient::new("http://localhost:8123");
8585

86-
println!("{} Create stream if not exists", FN_NAME);
86+
println!("{}Create stream if not exists", FN_NAME);
8787
create_stream(&client)
8888
.await
8989
.expect("[main]: Failed to create Stream");
9090

91-
println!("{} Stop", FN_NAME);
91+
println!("{}Stop", FN_NAME);
9292
Ok(())
93-
}
93+
}
94+
95+
pub async fn create_stream(client: &ProtonClient) -> Result<()> {
96+
client
97+
.execute_query("CREATE STREAM IF NOT EXISTS test_stream(no uint32, name string) ORDER BY no")
98+
.await
99+
}
94100
```
95101

102+
Check more examples [here](examples).
96103

97104
## What's next?
98105

0 commit comments

Comments
 (0)