use super::Statement;
#[derive(Debug, Clone)]
pub struct Pragma {
pub name: String,
pub value: Option<String>,
}
impl Statement {
pub fn pragma_enable_foreign_keys() -> Self {
Pragma {
name: "foreign_keys".to_string(),
value: Some("ON".to_string()),
}
.into()
}
pub fn pragma_disable_foreign_keys() -> Self {
Pragma {
name: "foreign_keys".to_string(),
value: Some("OFF".to_string()),
}
.into()
}
pub fn pragma(name: impl Into<String>, value: impl Into<String>) -> Self {
Pragma {
name: name.into(),
value: Some(value.into()),
}
.into()
}
}
impl From<Pragma> for Statement {
fn from(value: Pragma) -> Self {
Self::Pragma(value)
}
}