fix usage of clickhouse http api.
@@ -45,19 +45,20 @@ impl HttpHandlerKind {
pub fn usage(&self, sock: SocketAddr) -> String {
match self {
HttpHandlerKind::Query => {
- let json = r#"{"foo": "bar"}"#;
format!(
r#" examples:
curl -u root: --request POST '{:?}/v1/query/' --header 'Content-Type: application/json' --data-raw '{{"sql": "SELECT avg(number) FROM numbers(100000000)"}}'
-echo '{}' "#,
- sock, json,
+"#,
+ sock,
)
}
HttpHandlerKind::Clickhouse => {
+ let json = r#"{"foo": "bar"}"#;
format!(
r#" examples:
-curl '{:?}/clickhouse/?query=INSERT%20INTO%20test%20FORMAT%20JSONEachRow' --data-binary @-"#,
- sock,
+echo 'create table test(foo string)' | curl -u root: '{:?}' --data-binary @-
+echo '{}' | curl -u root: '{:?}/?query=INSERT%20INTO%20test%20FORMAT%20JSONEachRow' --data-binary @-"#,
+ sock, json, sock,
)
}
}
