use crate::{ast::Value, common::symbol::Symbol};
#[derive(Debug, Clone, PartialEq)]
pub enum ExecutionResult {
DatabaseCreated { name: Symbol },
DatabaseDropped { name: Symbol },
SchemaCreated { name: Symbol },
TableCreated { name: Symbol },
Inserted { name: Symbol, count: usize },
Selected { rows: Vec<Vec<Value>> },
}
impl ExecutionResult {
pub fn command_tag(&self) -> &'static str {
match self {
ExecutionResult::DatabaseCreated { .. } => "CREATE DATABASE",
ExecutionResult::DatabaseDropped { .. } => "DROP DATABASE",
ExecutionResult::SchemaCreated { .. } => "CREATE SCHEMA",
ExecutionResult::TableCreated { .. } => "CREATE TABLE",
ExecutionResult::Inserted { .. } => "INSERT TABLE",
ExecutionResult::Selected { .. } => "SELECT",
}
}
}