Skip to content

Commit ea548ca

Browse files
kyleconroyclaude
andcommitted
Add VARYING and FOR REPLICATION parsing for procedures
- Parse VARYING keyword after CURSOR type for procedure parameters - Parse FOR REPLICATION after WITH options in CREATE PROCEDURE Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c476b26 commit ea548ca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

parser/parse_statements.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4565,6 +4565,15 @@ func (p *Parser) parseCreateProcedureStatement() (*ast.CreateProcedureStatement,
45654565
}
45664566
}
45674567

4568+
// Parse optional FOR REPLICATION
4569+
if strings.ToUpper(p.curTok.Literal) == "FOR" {
4570+
p.nextToken() // consume FOR
4571+
if strings.ToUpper(p.curTok.Literal) == "REPLICATION" {
4572+
stmt.IsForReplication = true
4573+
p.nextToken() // consume REPLICATION
4574+
}
4575+
}
4576+
45684577
// Expect AS
45694578
if p.curTok.Type == TokenAs {
45704579
p.nextToken()
@@ -4664,6 +4673,12 @@ func (p *Parser) parseProcedureParameters() ([]*ast.ProcedureParameter, error) {
46644673
}
46654674
}
46664675

4676+
// Parse optional VARYING (for CURSOR type)
4677+
if strings.ToUpper(p.curTok.Literal) == "VARYING" {
4678+
param.IsVarying = true
4679+
p.nextToken()
4680+
}
4681+
46674682
// Parse optional default value
46684683
if p.curTok.Type == TokenEquals {
46694684
p.nextToken()

0 commit comments

Comments
 (0)