Remove redundant code
This commit is contained in:
parent
84fc58471d
commit
610d70378e
1 changed files with 2 additions and 36 deletions
|
|
@ -140,42 +140,6 @@ impl State {
|
|||
|
||||
Ok(count)
|
||||
}
|
||||
|
||||
// pub async fn interpret<Writer: ResponseWriter>(&mut self, db_path: &Path, response_writer: &mut Writer, operation: Operation) -> DbResult<()> {
|
||||
// use Operation::*;
|
||||
|
||||
// match operation {
|
||||
// Select(table_position, column_selection, maybe_condition) => {
|
||||
// let table: &Table = self.table_at(table_position);
|
||||
// let cursor = table.read().await?;
|
||||
|
||||
// response_writer.write_table_header(&table.schema, &column_selection).await.map_err(|e| RuntimeError::AnyhowError(e))?;
|
||||
// let count = match maybe_condition {
|
||||
// None => Self::select_all_rows(&table, cursor, response_writer, column_selection).await?,
|
||||
// Some(Condition::Eq(eq_column, value)) => Self::select_eq(&table, cursor, response_writer, column_selection, eq_column, value).await?
|
||||
// };
|
||||
// response_writer.write_command_complete(CompleteStatus::Select(count)).await.map_err(|e| RuntimeError::AnyhowError(e))
|
||||
// }
|
||||
// Insert(table_position, values) => {
|
||||
// let table: &mut Table = self.table_at_mut(table_position);
|
||||
// let cursor = table.write().await?;
|
||||
// todo!()
|
||||
// }
|
||||
// Delete(table_position, maybe_condition) => {
|
||||
// let table: &mut Table = self.table_at_mut(table_position);
|
||||
// let cursor = table.write().await?;
|
||||
// todo!()
|
||||
// }
|
||||
// CreateTable(table_schema) => {
|
||||
// let table = Table::new(table_schema, Path::new(db_path)).await?;
|
||||
// self.attach_table(table).await;
|
||||
// response_writer.write_command_complete(CompleteStatus::CreateTable).await.map_err(|e| RuntimeError::AnyhowError(e))
|
||||
// }
|
||||
// CreateIndex(table_position, column) => {
|
||||
// todo!()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
impl StateHandler {
|
||||
|
|
@ -216,6 +180,8 @@ impl StateHandler {
|
|||
}
|
||||
Delete(table_position, maybe_condition) => {
|
||||
let state = self.state.read().await;
|
||||
let mut table = state.table_at_mut(table_position).await;
|
||||
let cursor = table.write().await?;
|
||||
|
||||
todo!()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue