Add FROM clause support for UPDATE statements

This commit is contained in:
go-jet 2021-12-08 18:13:58 +01:00
parent 97c34fbb54
commit 72e8d7d584
11 changed files with 211 additions and 18 deletions

View file

@ -45,6 +45,7 @@ func (s *ClauseSelect) Serialize(statementType StatementType, out *SQLBuilder, o
// ClauseFrom struct
type ClauseFrom struct {
Name string
Tables []Serializer
}
@ -54,7 +55,11 @@ func (f *ClauseFrom) Serialize(statementType StatementType, out *SQLBuilder, opt
return
}
out.NewLine()
out.WriteString("FROM")
if f.Name != "" {
out.WriteString(f.Name)
} else {
out.WriteString("FROM")
}
out.IncreaseIdent()
for i, table := range f.Tables {