MCPcopy Create free account
hub / github.com/bytebase/bytebase / finalEmitOrder

Function finalEmitOrder

backend/plugin/db/starrocks/dump.go:216–229  ·  view source on GitHub ↗

finalEmitOrder returns the views and materialized views in the order their real definitions must be emitted: all regular views first, then materialized views, each group keeping its original relative order. information_schema.tables is unordered, and a materialized view can be defined on a regular v

(tables []*TableSchema)

Source from the content-addressed store, hash-verified

214// another materialized view (nested async MVs) is not yet dependency-ordered and could
215// restore inactive if listed before its parent — tracked in BYT-9718.
216func finalEmitOrder(tables []*TableSchema) []*TableSchema {
217 var views, materializedViews []*TableSchema
218 for _, tbl := range tables {
219 switch tbl.TableType {
220 case viewTableType:
221 views = append(views, tbl)
222 case materializedViewType:
223 materializedViews = append(materializedViews, tbl)
224 default:
225 // Base tables and any other types are emitted elsewhere; skip here.
226 }
227 }
228 return append(views, materializedViews...)
229}
230
231// dropPlaceholderStmt returns the statement that drops the temporary placeholder emitted
232// for a view or materialized view before its real definition. The placeholder is always a

Callers 2

DumpMethod · 0.85

Calls

no outgoing calls