MCPcopy Index your code
hub / github.com/bytebase/bytebase / createMaterializedViewDDL

Function createMaterializedViewDDL

backend/plugin/parser/redshift/completion.go:193–205  ·  view source on GitHub ↗
(schemaName, viewName, definition string)

Source from the content-addressed store, hash-verified

191}
192
193func createMaterializedViewDDL(schemaName, viewName, definition string) string {
194 definition = strings.TrimSpace(definition)
195 definition = strings.TrimSuffix(definition, ";")
196 if strings.HasPrefix(strings.ToUpper(definition), "CREATE ") {
197 return definition + ";"
198 }
199 return fmt.Sprintf(
200 "CREATE MATERIALIZED VIEW %s.%s AS %s;",
201 quoteIdent(schemaName),
202 quoteIdent(viewName),
203 definition,
204 )
205}
206
207func columnListDDL(columns []*storepb.ColumnMetadata) string {
208 columnDefs := make([]string, 0, len(columns))

Callers 1

buildCompletionCatalogFunction · 0.85

Calls 1

quoteIdentFunction · 0.70

Tested by

no test coverage detected