(ctx context.Context, instanceID, databaseName string)
| 145 | } |
| 146 | |
| 147 | func (h *Handler) GetDatabaseMetadataFunc(ctx context.Context, instanceID, databaseName string) (string, *model.DatabaseMetadata, error) { |
| 148 | metadata, err := h.store.GetDBSchemaSnapshot(ctx, common.GetWorkspaceIDFromContext(ctx), instanceID, databaseName) |
| 149 | if err != nil { |
| 150 | return "", nil, errors.Wrap(err, "failed to get database schema") |
| 151 | } |
| 152 | if metadata == nil { |
| 153 | return "", nil, errors.Errorf("database %s schema for instance %s not found", databaseName, instanceID) |
| 154 | } |
| 155 | return databaseName, metadata, nil |
| 156 | } |
| 157 | |
| 158 | func (h *Handler) ListDatabaseNamesFunc(ctx context.Context, instanceID string) ([]string, error) { |
| 159 | if instanceID == "" { |
no test coverage detected