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

Method WriteDialect

rel/filter.go:56–83  ·  view source on GitHub ↗
(w expr.DialectWriter)

Source from the content-addressed store, hash-verified

54}
55
56func (m *FilterStatement) WriteDialect(w expr.DialectWriter) {
57
58 if m.Description != "" {
59 if !strings.Contains(m.Description, "\n") {
60 io.WriteString(w, "--")
61 io.WriteString(w, m.Description)
62 io.WriteString(w, "\n")
63 }
64 }
65 io.WriteString(w, "FILTER ")
66 m.Filter.WriteDialect(w)
67
68 if m.From != "" {
69 io.WriteString(w, " FROM ")
70 w.WriteIdentity(m.From)
71 }
72 if m.Limit > 0 {
73 io.WriteString(w, fmt.Sprintf(" LIMIT %d", m.Limit))
74 }
75 if len(m.With) > 0 {
76 io.WriteString(w, " WITH ")
77 HelperString(w, m.With)
78 }
79 if m.Alias != "" {
80 io.WriteString(w, " ALIAS ")
81 w.WriteIdentity(m.Alias)
82 }
83}
84
85// String representation of FilterStatement
86func (m *FilterStatement) String() string {

Callers 2

StringMethod · 0.95
FingerPrintIDMethod · 0.95

Calls 3

HelperStringFunction · 0.85
WriteDialectMethod · 0.65
WriteIdentityMethod · 0.65

Tested by

no test coverage detected