MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / renderRefreshMaterializedView

Function renderRefreshMaterializedView

pkg/formatter/render.go:855–884  ·  view source on GitHub ↗
(r *ast.RefreshMaterializedViewStatement, opts ast.FormatOptions)

Source from the content-addressed store, hash-verified

853}
854
855func renderRefreshMaterializedView(r *ast.RefreshMaterializedViewStatement, opts ast.FormatOptions) string {
856 if r == nil {
857 return ""
858 }
859 f := newNodeFormatter(opts)
860 sb := f.sb
861
862 sb.WriteString(f.kw("REFRESH MATERIALIZED VIEW"))
863 sb.WriteString(" ")
864 if r.Concurrently {
865 sb.WriteString(f.kw("CONCURRENTLY"))
866 sb.WriteString(" ")
867 }
868 sb.WriteString(r.Name)
869
870 if r.WithData != nil {
871 sb.WriteString(f.clauseSep())
872 if *r.WithData {
873 sb.WriteString(f.kw("WITH DATA"))
874 } else {
875 sb.WriteString(f.kw("WITH NO DATA"))
876 }
877 }
878
879 if opts.AddSemicolon {
880 sb.WriteString(";")
881 }
882
883 return f.result()
884}
885
886func renderDrop(d *ast.DropStatement, opts ast.FormatOptions) string {
887 if d == nil {

Callers 1

FormatStatementFunction · 0.85

Calls 4

newNodeFormatterFunction · 0.85
kwMethod · 0.80
clauseSepMethod · 0.80
resultMethod · 0.80

Tested by

no test coverage detected