mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-07-19 10:25:03 +00:00
23 lines
552 B
Rust
23 lines
552 B
Rust
use std::fmt::Display;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::{model::table::SimValue, SimulatorEnv};
|
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub(crate) struct Drop {
|
|
pub(crate) table: String,
|
|
}
|
|
|
|
impl Drop {
|
|
pub(crate) fn shadow(&self, env: &mut SimulatorEnv) -> Vec<Vec<SimValue>> {
|
|
env.tables.retain(|t| t.name != self.table);
|
|
vec![]
|
|
}
|
|
}
|
|
|
|
impl Display for Drop {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "DROP TABLE {}", self.table)
|
|
}
|
|
}
|