From d9f7454c99d93f53e6ff01e678e2abbb0b0e29c0 Mon Sep 17 00:00:00 2001 From: everpcpc Date: Sun, 7 Apr 2024 11:40:29 +0800 Subject: [PATCH] fix(core): make client scheme public (#378) --- core/src/client.rs | 5 +++-- driver/tests/driver/load.rs | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/src/client.rs b/core/src/client.rs index c155e0e0..05a44c54 100644 --- a/core/src/client.rs +++ b/core/src/client.rs @@ -50,11 +50,12 @@ static VERSION: Lazy = Lazy::new(|| { #[derive(Clone)] pub struct APIClient { pub cli: HttpClient, - scheme: String, - endpoint: Url, + pub scheme: String, pub host: String, pub port: u16, + endpoint: Url, + auth: Arc, tenant: Option, diff --git a/driver/tests/driver/load.rs b/driver/tests/driver/load.rs index ccc90869..488ae9da 100644 --- a/driver/tests/driver/load.rs +++ b/driver/tests/driver/load.rs @@ -36,9 +36,9 @@ async fn prepare_client(presigned: bool) -> Option { Some(client) } -async fn prepare_table(client: &Client) -> String { +async fn prepare_table(client: &Client, prefix: &str) -> String { let conn = client.get_conn().await.unwrap(); - let table = format!("books_{}", Utc::now().format("%Y%m%d%H%M%S%9f")); + let table = format!("books_{}_{}", prefix, Utc::now().format("%Y%m%d%H%M%S%9f")); let sql = format!( "CREATE TABLE `{}` ( title VARCHAR NULL, @@ -121,7 +121,7 @@ async fn check_result(table: &str, client: &Client) { #[tokio::test] async fn load_csv_with_presign() { if let Some(client) = prepare_client(true).await { - let table = prepare_table(&client).await; + let table = prepare_table(&client, "load_csv_with_presign").await; prepare_data_with_file(&table, "csv", &client).await; check_result(&table, &client).await; } @@ -130,7 +130,7 @@ async fn load_csv_with_presign() { #[tokio::test] async fn load_csv_without_presign() { if let Some(client) = prepare_client(false).await { - let table = prepare_table(&client).await; + let table = prepare_table(&client, "load_csv_without_presign").await; prepare_data_with_file(&table, "csv", &client).await; check_result(&table, &client).await; } @@ -139,7 +139,7 @@ async fn load_csv_without_presign() { #[tokio::test] async fn stream_load_with_presign() { if let Some(client) = prepare_client(true).await { - let table = prepare_table(&client).await; + let table = prepare_table(&client, "stream_load_with_presign").await; prepare_data(&table, &client).await; check_result(&table, &client).await; }