From 5eca507867c829e8f5bced3bb4aa2e89a3e036cc Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Thu, 3 Jul 2025 12:53:15 +0200 Subject: [PATCH] fix type null spacing --- core/schema.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/schema.rs b/core/schema.rs index 152a7de35..55e453678 100644 --- a/core/schema.rs +++ b/core/schema.rs @@ -261,6 +261,9 @@ impl BTreeTable { sql.push_str(", "); } sql.push_str(column.name.as_ref().expect("column name is None")); + if !matches!(column.ty, Type::Null) { + sql.push(' '); + } sql.push_str(&column.ty.to_string()); if column.unique { @@ -1492,7 +1495,7 @@ mod tests { #[test] pub fn test_sqlite_schema() { - let expected = r#"CREATE TABLE sqlite_schema ( type TEXT, name TEXT, tbl_name TEXT, rootpage INTEGER, sql TEXT )"#; + let expected = r#"CREATE TABLE sqlite_schema (type TEXT, name TEXT, tbl_name TEXT, rootpage INTEGER, sql TEXT)"#; let actual = sqlite_schema_table().to_sql(); assert_eq!(expected, actual); }