Skip to main content

surrealdb_expr/expr/statements/alter/
namespace.rs

1use surrealdb_types::{SqlFormat, ToSql};
2
3#[derive(Clone, Debug, Default, Eq, PartialEq, Hash)]
4/// Executes `ALTER NAMESPACE` operations for the current namespace.
5///
6/// Supported options:
7/// - `compact`: triggers a compaction of the current namespace keyspace.
8pub struct AlterNamespaceStatement {
9	/// When true, compacts the underlying storage for the namespace.
10	pub compact: bool,
11}
12
13impl ToSql for AlterNamespaceStatement {
14	fn fmt_sql(&self, f: &mut String, fmt: SqlFormat) {
15		let stmt: crate::sql::statements::alter::AlterNamespaceStatement = self.clone().into();
16		stmt.fmt_sql(f, fmt);
17	}
18}