mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-30 20:00:36 +00:00
feat: copy database from (#3164)
* wip: impl COPY DATABASE FROM parser * wip: impl copy database from * wip: add some ut * wip: add continue_on_error option * test: add sqlness cases for copy database * fix: trailing newline * fix: typo * fix: some cr comments * chore: resolve confilicts * fix: some cr comments
This commit is contained in:
@@ -71,7 +71,7 @@ use session::context::QueryContextRef;
|
||||
use snafu::prelude::*;
|
||||
use sql::dialect::Dialect;
|
||||
use sql::parser::{ParseOptions, ParserContext};
|
||||
use sql::statements::copy::CopyTable;
|
||||
use sql::statements::copy::{CopyDatabase, CopyTable};
|
||||
use sql::statements::statement::Statement;
|
||||
use sqlparser::ast::ObjectName;
|
||||
pub use standalone::StandaloneDatanodeManager;
|
||||
@@ -487,8 +487,11 @@ pub fn check_permission(
|
||||
validate_param(©_table_from.table_name, query_ctx)?
|
||||
}
|
||||
},
|
||||
Statement::Copy(sql::statements::copy::Copy::CopyDatabase(stmt)) => {
|
||||
validate_param(&stmt.database_name, query_ctx)?
|
||||
Statement::Copy(sql::statements::copy::Copy::CopyDatabase(copy_database)) => {
|
||||
match copy_database {
|
||||
CopyDatabase::To(stmt) => validate_param(&stmt.database_name, query_ctx)?,
|
||||
CopyDatabase::From(stmt) => validate_param(&stmt.database_name, query_ctx)?,
|
||||
}
|
||||
}
|
||||
Statement::TruncateTable(stmt) => {
|
||||
validate_param(stmt.table_name(), query_ctx)?;
|
||||
|
||||
Reference in New Issue
Block a user