Skip to content

Commit

Permalink
fix(core): make client scheme public (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Apr 7, 2024
1 parent b01f9b8 commit d9f7454
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ static VERSION: Lazy<String> = 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<dyn Auth>,

tenant: Option<String>,
Expand Down
10 changes: 5 additions & 5 deletions driver/tests/driver/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ async fn prepare_client(presigned: bool) -> Option<Client> {
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,
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit d9f7454

Please sign in to comment.