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

Function getResourcesForSnowflake

backend/component/export/resources.go:315–335  ·  view source on GitHub ↗
(
	ctx context.Context,
	storeInstance *store.Store,
	engine storepb.Engine,
	databaseName string,
	statement string,
	instance *store.InstanceMessage,
	getDatabaseMetadataFunc base.GetDatabaseMetadataFunc,
	listDatabaseNamesFunc base.ListDatabaseNamesFunc,
	getLinkedDatabaseMetadataFunc base.GetLinkedDatabaseMetadataFunc,
)

Source from the content-addressed store, hash-verified

313}
314
315func getResourcesForSnowflake(
316 ctx context.Context,
317 storeInstance *store.Store,
318 engine storepb.Engine,
319 databaseName string,
320 statement string,
321 instance *store.InstanceMessage,
322 getDatabaseMetadataFunc base.GetDatabaseMetadataFunc,
323 listDatabaseNamesFunc base.ListDatabaseNamesFunc,
324 getLinkedDatabaseMetadataFunc base.GetLinkedDatabaseMetadataFunc,
325) ([]base.SchemaResource, error) {
326 dataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_READ_ONLY)
327 adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
328 if dataSource == nil {
329 dataSource = adminDataSource
330 }
331 if dataSource == nil {
332 return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to find data source for instance: %s", instance.ResourceID))
333 }
334 return getResourcesForPostgres(ctx, storeInstance, engine, databaseName, statement, instance, "PUBLIC", getDatabaseMetadataFunc, listDatabaseNamesFunc, getLinkedDatabaseMetadataFunc)
335}
336
337func getResourcesForMSSQL(
338 ctx context.Context,

Callers 1

GetResourcesFunction · 0.85

Calls 3

getResourcesForPostgresFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected