efe87321b2
Testing Tweaks * parallel * slowestquery * split * cleanup * health * dynamiccores * go * profile * timeout * commitmychanges * taskfile * sqlcheckstart * client * cost * ctxtimeout
25 lines
462 B
Go
25 lines
462 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"queryorchestration/internal/database/repository"
|
|
)
|
|
|
|
func (s *Service) Get(ctx context.Context, id string) (*Client, error) {
|
|
client, err := s.cfg.GetDBQueries().GetClient(ctx, id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return parseFullClient(client), nil
|
|
}
|
|
|
|
func parseFullClient(client *repository.Fullclient) *Client {
|
|
return &Client{
|
|
ID: client.Clientid,
|
|
Name: client.Name,
|
|
CanSync: client.Cansync,
|
|
}
|
|
}
|