HasSampleInstances checks if there are sample instances in the database.
(ctx context.Context, workspaceID string)
| 548 | |
| 549 | // HasSampleInstances checks if there are sample instances in the database. |
| 550 | func (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: |
no test coverage detected