refactor: move database client to test (#3820)

* remove `Database` in `cli export`

* move `Database` to tests-integration

* fix clippy

* move `DatabaseClient` along with `Database`

* `cli export` now use http api

* add TODO for `tests-integration` dependencies

* cleanup code

* 'cli export' test use http api

* remove unsed dependencies in cmd crate

* apply review comments and clean code

* remove unused methods

Signed-off-by: tison <wander4096@gmail.com>

---------

Signed-off-by: tison <wander4096@gmail.com>
Co-authored-by: tison <wander4096@gmail.com>
This commit is contained in:
dimbtp
2024-05-01 13:55:13 +08:00
committed by GitHub
parent 695746193b
commit 3b89b9ddd8
23 changed files with 239 additions and 789 deletions

View File

@@ -19,5 +19,7 @@ serde.workspace = true
serde_json.workspace = true
sqlness = { version = "0.5" }
tempfile.workspace = true
# TODO depend `Database` client
tests-integration.workspace = true
tinytemplate = "1.2"
tokio.workspace = true

View File

@@ -24,14 +24,13 @@ use std::time::Duration;
use async_trait::async_trait;
use client::error::ServerSnafu;
use client::{
Client, Database as DB, Error as ClientError, DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME,
};
use client::{Client, Error as ClientError, DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME};
use common_error::ext::ErrorExt;
use common_query::{Output, OutputData};
use common_recordbatch::RecordBatches;
use serde::Serialize;
use sqlness::{Database, EnvController, QueryContext};
use tests_integration::database::Database as DB;
use tinytemplate::TinyTemplate;
use tokio::sync::Mutex as TokioMutex;