mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-27 20:04:23 +01:00
add pragma autovacuum_mode to simulator
This commit is contained in:
@@ -16,3 +16,4 @@ pub mod predicate;
|
||||
pub mod select;
|
||||
pub mod transaction;
|
||||
pub mod update;
|
||||
pub mod pragma;
|
||||
|
||||
28
sql_generation/model/query/pragma.rs
Normal file
28
sql_generation/model/query/pragma.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
pub enum Pragma {
|
||||
AutoVacuumMode(VacuumMode),
|
||||
}
|
||||
|
||||
pub enum VacuumMode {
|
||||
None,
|
||||
Incremental,
|
||||
Full,
|
||||
}
|
||||
|
||||
impl Display for Pragma {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Pragma::AutoVacuumMode(vacuum_mode) => {
|
||||
let mode = match vacuum_mode {
|
||||
VacuumMode::None => "none",
|
||||
VacuumMode::Incremental => "incremental",
|
||||
VacuumMode::Full => "full",
|
||||
};
|
||||
|
||||
write!(f, "PRAGMA auto_vacuum={mode} ")?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user