Be stricter in demo mode with respect to schema alterations/deletions.

This commit is contained in:
Sebastian Jeltsch
2025-12-04 16:30:21 +01:00
parent 82b3180668
commit 5a912c31ea
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ pub async fn alter_index_handler(
State(state): State<AppState>,
Json(request): Json<AlterIndexRequest>,
) -> Result<Json<AlterIndexResponse>, Error> {
if state.demo_mode() && request.source_schema.name.name.starts_with("_") {
if state.demo_mode() {
return Err(Error::Precondition("Disallowed in demo".into()));
}
+1 -1
View File
@@ -42,7 +42,7 @@ pub async fn alter_table_handler(
State(state): State<AppState>,
Json(request): Json<AlterTableRequest>,
) -> Result<Json<AlterTableResponse>, Error> {
if state.demo_mode() && request.source_schema.name.name.starts_with("_") {
if state.demo_mode() {
return Err(Error::Precondition("Disallowed in demo".into()));
}
+1 -1
View File
@@ -26,7 +26,7 @@ pub async fn drop_index_handler(
Json(request): Json<DropIndexRequest>,
) -> Result<Json<DropIndexResponse>, Error> {
let index_name = QualifiedName::parse(&request.name)?;
if state.demo_mode() && index_name.name.starts_with("_") {
if state.demo_mode() {
return Err(Error::Precondition("Disallowed in demo".into()));
}
+1 -1
View File
@@ -28,7 +28,7 @@ pub async fn drop_table_handler(
Json(request): Json<DropTableRequest>,
) -> Result<Json<DropTableResponse>, Error> {
let unqualified_table_name = request.name.to_string();
if state.demo_mode() && unqualified_table_name.starts_with("_") {
if state.demo_mode() {
return Err(Error::Precondition("Disallowed in demo".into()));
}