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

Method writeDialectDepth

rel/sql.go:1696–1711  ·  view source on GitHub ↗
(depth int, w expr.DialectWriter)

Source from the content-addressed store, hash-verified

1694
1695func (m *SqlWhere) Keyword() lex.TokenType { return m.Op }
1696func (m *SqlWhere) writeDialectDepth(depth int, w expr.DialectWriter) {
1697 if int(m.Op) == 0 && m.Source == nil && m.Expr != nil {
1698 m.Expr.WriteDialect(w)
1699 return
1700 }
1701 // Op = subselect or in etc
1702 // SELECT ... WHERE IN (SELECT ...)
1703 if int(m.Op) != 0 && m.Source != nil {
1704 io.WriteString(w, m.Op.String())
1705 io.WriteString(w, " (")
1706 m.Source.writeDialectDepth(depth+1, w)
1707 io.WriteString(w, ")")
1708 return
1709 }
1710 u.Errorf("unrecognized SqlWhere statement? %#v", m)
1711}
1712func (m *SqlWhere) WriteDialect(w expr.DialectWriter) { m.writeDialectDepth(0, w) }
1713func (m *SqlWhere) String() string {
1714 w := expr.NewDefaultWriter()

Callers 3

WriteDialectMethod · 0.95
writeDialectDepthMethod · 0.45
writeDialectDepthMethod · 0.45

Calls 3

ErrorfMethod · 0.80
WriteDialectMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected