MCPcopy
hub / github.com/ent/ent / Query

Method Query

dialect/sql/builder.go:124–137  ·  view source on GitHub ↗

Query returns query representation of a `CREATE VIEW` statement. CREATE VIEW [IF NOT EXISTS] name AS (view definition)

()

Source from the content-addressed store, hash-verified

122//
123// (view definition)
124func (v *ViewBuilder) Query() (string, []any) {
125 v.WriteString("CREATE VIEW ")
126 if v.exists {
127 v.WriteString("IF NOT EXISTS ")
128 }
129 v.writeSchema(v.schema)
130 v.Ident(v.name)
131 if len(v.columns) > 0 {
132 v.Pad().Wrap(func(b *Builder) { b.JoinComma(v.columns...) })
133 }
134 v.WriteString(" AS ")
135 v.Join(v.as)
136 return v.String(), v.args
137}
138
139// InsertBuilder is a builder for `INSERT INTO` statement.
140type InsertBuilder struct {

Callers

nothing calls this directly

Calls 8

WriteStringMethod · 0.80
writeSchemaMethod · 0.80
IdentMethod · 0.80
WrapMethod · 0.80
PadMethod · 0.80
JoinCommaMethod · 0.80
JoinMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected