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

Method HasSampleInstances

backend/store/instance.go:550–560  ·  view source on GitHub ↗

HasSampleInstances checks if there are sample instances in the database.

(ctx context.Context, workspaceID string)

Source from the content-addressed store, hash-verified

548
549// HasSampleInstances checks if there are sample instances in the database.
550func (s *Store) HasSampleInstances(ctx context.Context, workspaceID string) (bool, error) {
551 instances, err := s.ListInstances(ctx, &FindInstanceMessage{
552 Workspace: workspaceID,
553 ResourceIDs: &[]string{"test-sample-instance", "prod-sample-instance"},
554 ShowDeleted: false,
555 })
556 if err != nil {
557 return false, err
558 }
559 return len(instances) > 0, nil
560}
561
562// DeleteInstance permanently purges a soft-deleted instance and all related resources.
563// This operation is irreversible and should only be used for:

Callers 3

StartIfExistMethod · 0.80
getServerInfoMethod · 0.80

Calls 1

ListInstancesMethod · 0.95

Tested by

no test coverage detected