Skip to content

Commit 06e3f96

Browse files
kyleconroyclaude
andcommitted
Preserve singular vs plural form for retention period units
DAY/DAYS, WEEK/WEEKS, MONTH/MONTHS, YEAR/YEARS are now mapped to Day/Days, Week/Weeks, Month/Months, Year/Years respectively. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 47a197d commit 06e3f96

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

parser/parse_ddl.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7231,19 +7231,25 @@ func (p *Parser) parseRetentionPeriodDefinition() (*ast.RetentionPeriodDefinitio
72317231
return nil, fmt.Errorf("expected number for retention period, got %s", p.curTok.Literal)
72327232
}
72337233

7234-
// Parse unit
7234+
// Parse unit - preserve singular vs plural from SQL syntax
72357235
unitVal := strings.ToUpper(p.curTok.Literal)
72367236
switch unitVal {
7237-
case "DAY", "DAYS":
7237+
case "DAY":
72387238
ret.Units = "Day"
7239-
case "WEEK", "WEEKS":
7239+
case "DAYS":
7240+
ret.Units = "Days"
7241+
case "WEEK":
72407242
ret.Units = "Week"
7243+
case "WEEKS":
7244+
ret.Units = "Weeks"
72417245
case "MONTH":
72427246
ret.Units = "Month"
72437247
case "MONTHS":
72447248
ret.Units = "Months"
7245-
case "YEAR", "YEARS":
7249+
case "YEAR":
72467250
ret.Units = "Year"
7251+
case "YEARS":
7252+
ret.Units = "Years"
72477253
default:
72487254
return nil, fmt.Errorf("unexpected unit %s for retention period", unitVal)
72497255
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"todo": true}
1+
{}

0 commit comments

Comments
 (0)