Skip to content

Commit 8f1af78

Browse files
cpcloudclaude
andcommitted
fix(data): fix removeColumn regex for unquoted column names
Make the trailing separator character class optional (`?`) so removeColumn matches columns that are not quoted (e.g. `name text` instead of `` `name` text ``). Without this, the regex required a quote/separator char after the column name before matching whitespace, which fails for unquoted DDL fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4273f1c commit 8f1af78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/data/sqlite/ddlmod.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func (d *ddl) removeColumn(name string) bool {
339339
// Match column names that are quoted (backtick, single, double) or
340340
// unquoted, followed by whitespace and the column type definition.
341341
reg := regexp.MustCompile(
342-
"^[`'\" ]?" + regexp.QuoteMeta(name) + "[`'\" ]\\s",
342+
"^[`'\" ]?" + regexp.QuoteMeta(name) + "[`'\" ]?\\s",
343343
)
344344

345345
for i := 0; i < len(d.fields); i++ {

0 commit comments

Comments
 (0)