MCPcopy Create free account
hub / github.com/araddon/qlbridge / WriteDialect

Method WriteDialect

rel/sql.go:1871–1888  ·  view source on GitHub ↗
(w expr.DialectWriter)

Source from the content-addressed store, hash-verified

1869
1870func (m *SqlUpdate) Keyword() lex.TokenType { return lex.TokenUpdate }
1871func (m *SqlUpdate) WriteDialect(w expr.DialectWriter) {
1872 io.WriteString(w, "UPDATE ")
1873 w.WriteIdentity(m.Table)
1874 io.WriteString(w, " SET ")
1875 firstCol := true
1876 for key, val := range m.Values {
1877 if !firstCol {
1878 w.Write([]byte{',', ' '})
1879 }
1880 firstCol = false
1881 w.WriteIdentity(key)
1882 w.WriteValue(val.Value)
1883 }
1884 if m.Where != nil {
1885 io.WriteString(w, " WHERE ")
1886 m.Where.WriteDialect(w)
1887 }
1888}
1889func (m *SqlUpdate) String() string {
1890 w := expr.NewDefaultWriter()
1891 m.WriteDialect(w)

Callers 1

StringMethod · 0.95

Calls 3

WriteIdentityMethod · 0.65
WriteValueMethod · 0.65
WriteDialectMethod · 0.65

Tested by

no test coverage detected