|
1 | 1 | use std::io::ErrorKind; |
2 | 2 |
|
3 | | -use crate::ast::ddl::alter_table::{AlterColumnAction, AlterTableAction, AlterTableQuery}; |
4 | | -use crate::ast::types::TableName; |
5 | | -use crate::errors::predule::ExecuteError; |
6 | | -use crate::errors::RRDBError; |
7 | | -use crate::executor::config::table::TableConfig; |
8 | | -use crate::executor::encoder::storage::StorageEncoder; |
9 | | -use crate::executor::predule::{ |
10 | | - ExecuteColumn, ExecuteColumnType, ExecuteField, ExecuteResult, ExecuteRow, Executor, |
| 3 | +use crate::engine::DBEngine; |
| 4 | +use crate::engine::ast::ddl::alter_table::{AlterColumnAction, AlterTableAction, AlterTableQuery}; |
| 5 | +use crate::engine::ast::types::TableName; |
| 6 | +use crate::engine::encoder::schema_encoder::StorageEncoder; |
| 7 | +use crate::engine::schema::table::TableSchema; |
| 8 | +use crate::engine::types::{ |
| 9 | + ExecuteColumn, ExecuteColumnType, ExecuteField, ExecuteResult, ExecuteRow, |
11 | 10 | }; |
| 11 | +use crate::errors::RRDBError; |
| 12 | +use crate::errors::predule::ExecuteError; |
12 | 13 |
|
13 | | -impl Executor { |
| 14 | +impl DBEngine { |
14 | 15 | pub async fn alter_table(&self, query: AlterTableQuery) -> Result<ExecuteResult, RRDBError> { |
15 | 16 | let encoder = StorageEncoder::new(); |
16 | 17 |
|
@@ -117,7 +118,7 @@ impl Executor { |
117 | 118 |
|
118 | 119 | match tokio::fs::read(&config_path).await { |
119 | 120 | Ok(data) => { |
120 | | - let table_config: Option<TableConfig> = |
| 121 | + let table_config: Option<TableSchema> = |
121 | 122 | encoder.decode(data.as_slice()); |
122 | 123 |
|
123 | 124 | match table_config { |
@@ -169,7 +170,7 @@ impl Executor { |
169 | 170 |
|
170 | 171 | match tokio::fs::read(&config_path).await { |
171 | 172 | Ok(data) => { |
172 | | - let table_config: Option<TableConfig> = |
| 173 | + let table_config: Option<TableSchema> = |
173 | 174 | encoder.decode(data.as_slice()); |
174 | 175 |
|
175 | 176 | match table_config { |
@@ -221,7 +222,7 @@ impl Executor { |
221 | 222 |
|
222 | 223 | match tokio::fs::read(&config_path).await { |
223 | 224 | Ok(data) => { |
224 | | - let table_config: Option<TableConfig> = |
| 225 | + let table_config: Option<TableSchema> = |
225 | 226 | encoder.decode(data.as_slice()); |
226 | 227 |
|
227 | 228 | match table_config { |
@@ -272,7 +273,7 @@ impl Executor { |
272 | 273 |
|
273 | 274 | match tokio::fs::read(&config_path).await { |
274 | 275 | Ok(data) => { |
275 | | - let table_config: Option<TableConfig> = |
| 276 | + let table_config: Option<TableSchema> = |
276 | 277 | encoder.decode(data.as_slice()); |
277 | 278 |
|
278 | 279 | match table_config { |
|
0 commit comments