2025-03-17 18:14:15 +00:00
|
|
|
package queryapi
|
2025-01-15 19:45:51 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
2025-03-05 12:05:46 +00:00
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
"queryorchestration/internal/client"
|
2025-01-20 13:31:48 +00:00
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
2025-01-15 19:45:51 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-14 17:59:04 +00:00
|
|
|
// Query parsing functions have been removed.
|
|
|
|
|
// See remove_query_plan.md for details.
|
2025-01-20 13:31:48 +00:00
|
|
|
|
|
|
|
|
func parseStringToUUIDArray(sids *[]string) (*[]uuid.UUID, error) {
|
|
|
|
|
var ids []uuid.UUID
|
|
|
|
|
if sids != nil {
|
|
|
|
|
ids = make([]uuid.UUID, len(*sids))
|
|
|
|
|
for index, id := range *sids {
|
|
|
|
|
parsedID, err := uuid.Parse(id)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, errors.New("invalid required id")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ids[index] = parsedID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &ids, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
2025-02-20 19:02:44 +00:00
|
|
|
|
2025-03-10 11:03:00 +00:00
|
|
|
func parseClientStatus(status client.Status) ClientStatus {
|
2025-02-20 19:02:44 +00:00
|
|
|
switch status {
|
2025-03-10 11:03:00 +00:00
|
|
|
case client.IN_SYNC:
|
2025-02-20 19:02:44 +00:00
|
|
|
return INSYNC
|
2025-03-10 11:03:00 +00:00
|
|
|
case client.NOT_SYNCING:
|
|
|
|
|
return NOTSYNCING
|
2025-02-20 19:02:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NOTSYNCED
|
|
|
|
|
}
|