mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-29 22:14:23 +01:00
impl ToSqlString for DETACH stmt
This commit is contained in:
@@ -121,6 +121,7 @@ impl ToSqlString for ast::Stmt {
|
||||
create_virtual_table.to_sql_string(context)
|
||||
}
|
||||
Self::Delete(delete) => delete.to_sql_string(context),
|
||||
Self::Detach(name) => format!("DETACH {};", name.to_sql_string(context)),
|
||||
Self::Select(select) => format!("{};", select.to_sql_string(context)),
|
||||
_ => todo!(),
|
||||
}
|
||||
@@ -308,4 +309,10 @@ mod tests {
|
||||
test_create_view_arithmetic,
|
||||
"CREATE VIEW view_arithmetic AS SELECT name, salary * 1.1 AS adjusted_salary FROM employees;"
|
||||
);
|
||||
|
||||
|
||||
to_sql_string_test!(
|
||||
test_detach,
|
||||
"DETACH 'x.db';"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user