From 816a8810e9e7fa6c7b20a2bfc0177802b6d58da9 Mon Sep 17 00:00:00 2001 From: apstndb <803393+apstndb@users.noreply.github.com> Date: Thu, 9 Jan 2025 23:16:31 +0900 Subject: [PATCH] Support FQNs in DMLs --- ast/ast.go | 6 +++--- parser.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ast/ast.go b/ast/ast.go index caf16acc..a7a4af53 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -3644,7 +3644,7 @@ type Insert struct { InsertOrType InsertOrType - TableName *Ident + TableName *Path Columns []*Ident Input InsertInput ThenReturn *ThenReturn // optional @@ -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 @@ -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 diff --git a/parser.go b/parser.go index f7596156..c28c68c3 100644 --- a/parser.go +++ b/parser.go @@ -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 @@ -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() @@ -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")