15adaebfcd
DRAFT PR : WIP working through ideas for integration * movearound * attempttwo * openapi * further sanding * fix * start on tests * runthroughsingleconfig * somechanges * reflectissue * removeerrs * mostlyremovepanic * removeenv * noncfgtests * go * repo * fix service config test * add PWD to all * test fix * fix lint * todo for later * passingunittests * alltests * testlogger * testloggername * clean
22 lines
421 B
Go
22 lines
421 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"queryorchestration/internal/database"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
func (s *Service) Get(ctx context.Context, id uuid.UUID) (*Client, error) {
|
|
client, err := s.cfg.GetDBQueries().GetClient(ctx, database.MustToDBUUID(id))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Client{
|
|
ID: database.MustToUUID(client.ID),
|
|
Name: client.Name,
|
|
CanSync: client.Cansync,
|
|
}, nil
|
|
}
|