From 75e86b2c20e41d43c75713f0d9200394d19e615b Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Thu, 16 Oct 2025 14:26:58 -0400 Subject: [PATCH 1/3] Throw parse error on GENERATED constraint in create table when opening new db --- core/schema.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/schema.rs b/core/schema.rs index b744a99a5..a006b85ab 100644 --- a/core/schema.rs +++ b/core/schema.rs @@ -1635,6 +1635,9 @@ pub fn create_table(tbl_name: &str, body: &CreateTableBody, root_page: i64) -> R ast::ColumnConstraint::Check { .. } => { crate::bail_parse_error!("CHECK constraints are not yet supported"); } + ast::ColumnConstraint::Generated { .. } => { + crate::bail_parse_error!("GENERATED columns are not yet supported"); + } ast::ColumnConstraint::PrimaryKey { order: o, auto_increment, From 04c9eee4f1d6204b25bc6d1535c684bbb259c3cc Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Thu, 16 Oct 2025 14:27:22 -0400 Subject: [PATCH 2/3] Throw parse error on GENERATED constraint when creating new table --- core/translate/schema.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/translate/schema.rs b/core/translate/schema.rs index 152cca652..120ad5ce9 100644 --- a/core/translate/schema.rs +++ b/core/translate/schema.rs @@ -41,8 +41,14 @@ fn validate(body: &ast::CreateTableBody, connection: &Connection) -> Result<()> let col_i = &columns[i]; for constraint in &col_i.constraints { // don't silently ignore CHECK constraints, throw parse error for now - if let ast::ColumnConstraint::Check { .. } = constraint.constraint { - bail_parse_error!("CHECK constraints are not supported yet"); + match constraint.constraint { + ast::ColumnConstraint::Check { .. } => { + bail_parse_error!("CHECK constraints are not supported yet"); + } + ast::ColumnConstraint::Generated { .. } => { + bail_parse_error!("GENERATED columns are not supported yet"); + } + _ => {} } } for j in &columns[(i + 1)..] { From 9de9927b524f68569a641ecf4466790f101aad18 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Thu, 16 Oct 2025 14:47:40 -0400 Subject: [PATCH 3/3] fix clippy warning --- core/schema.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/core/schema.rs b/core/schema.rs index a006b85ab..c708b2f4d 100644 --- a/core/schema.rs +++ b/core/schema.rs @@ -1730,7 +1730,6 @@ pub fn create_table(tbl_name: &str, body: &CreateTableBody, root_page: i64) -> R }; foreign_keys.push(Arc::new(fk)); } - _ => {} } }