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

Function resourceExists

backend/component/export/resources.go:359–374  ·  view source on GitHub ↗
(dbMetadata *model.DatabaseMetadata, resource base.SchemaResource)

Source from the content-addressed store, hash-verified

357}
358
359func resourceExists(dbMetadata *model.DatabaseMetadata, resource base.SchemaResource) bool {
360 schema := dbMetadata.GetSchemaMetadata(resource.Schema)
361 if schema == nil {
362 return false
363 }
364 if schema.GetTable(resource.Table) != nil {
365 return true
366 }
367 if schema.GetView(resource.Table) != nil {
368 return true
369 }
370 if schema.GetMaterializedView(resource.Table) != nil {
371 return true
372 }
373 return false
374}

Callers 3

getResourcesForMySQLFunction · 0.85
getResourcesForPostgresFunction · 0.85
getResourcesForRedshiftFunction · 0.85

Calls 4

GetSchemaMetadataMethod · 0.80
GetMaterializedViewMethod · 0.80
GetTableMethod · 0.45
GetViewMethod · 0.45

Tested by

no test coverage detected