File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -78,21 +78,28 @@ const FN_NAME: &str = "[prepare]:";
7878
7979#[tokio:: main]
8080async 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
You can’t perform that action at this time.
0 commit comments