Skip to content

Commit

Permalink
Support FQNs in DMLs
Browse files Browse the repository at this point in the history
  • Loading branch information
apstndb committed Jan 9, 2025
1 parent d885fe3 commit 816a881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ type Insert struct {

InsertOrType InsertOrType

TableName *Ident
TableName *Path
Columns []*Ident
Input InsertInput
ThenReturn *ThenReturn // optional
Expand Down Expand Up @@ -3707,7 +3707,7 @@ type Delete struct {

Delete token.Pos // position of "DELETE" keyword

TableName *Ident
TableName *Path
As *AsAlias // optional
Where *Where
ThenReturn *ThenReturn // optional
Expand All @@ -3724,7 +3724,7 @@ type Update struct {

Update token.Pos // position of "UPDATE" keyword

TableName *Ident
TableName *Path
As *AsAlias // optional
Updates []*UpdateItem // len(Updates) > 0
Where *Where
Expand Down
6 changes: 3 additions & 3 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -4754,7 +4754,7 @@ func (p *Parser) parseInsert(pos token.Pos) *ast.Insert {
p.nextToken()
}

name := p.parseIdent()
name := p.parsePath()

p.expect("(")
var columns []*ast.Ident
Expand Down Expand Up @@ -4849,7 +4849,7 @@ func (p *Parser) parseDelete(pos token.Pos) *ast.Delete {
p.nextToken()
}

name := p.parseIdent()
name := p.parsePath()
as := p.tryParseAsAlias(withOptionalAs)
where := p.parseWhere()
thenReturn := p.tryParseThenReturn()
Expand All @@ -4864,7 +4864,7 @@ func (p *Parser) parseDelete(pos token.Pos) *ast.Delete {
}

func (p *Parser) parseUpdate(pos token.Pos) *ast.Update {
name := p.parseIdent()
name := p.parsePath()
as := p.tryParseAsAlias(withOptionalAs)

p.expect("SET")
Expand Down

0 comments on commit 816a881

Please sign in to comment.