Skip to content

Commit bcc22f3

Browse files
kyleconroyclaude
andcommitted
Handle ASSUME keyword in ALTER TABLE ADD CONSTRAINT
Add parsing for ASSUME constraint type alongside CHECK in ALTER TABLE ADD CONSTRAINT statements. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9a96fab commit bcc22f3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

parser/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5414,8 +5414,8 @@ func (p *Parser) parseAlterCommand() *ast.AlterCommand {
54145414
cmd.ConstraintName = p.current.Value
54155415
p.nextToken()
54165416
}
5417-
// Parse CHECK
5418-
if p.currentIs(token.CHECK) {
5417+
// Parse CHECK or ASSUME
5418+
if p.currentIs(token.CHECK) || (p.currentIs(token.IDENT) && strings.ToUpper(p.current.Value) == "ASSUME") {
54195419
p.nextToken()
54205420
cmd.Constraint = &ast.Constraint{
54215421
Position: p.current.Pos,
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt7": true
4-
}
5-
}
1+
{}

0 commit comments

Comments
 (0)