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
23 lines
399 B
Go
23 lines
399 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
"queryorchestration/internal/database"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
func (s *Service) Create(ctx context.Context, name string) (uuid.UUID, error) {
|
|
err := normalizeName(&name)
|
|
if err != nil {
|
|
return uuid.Nil, err
|
|
}
|
|
|
|
id, err := s.cfg.GetDBQueries().CreateClient(ctx, name)
|
|
if err != nil {
|
|
return uuid.Nil, err
|
|
}
|
|
|
|
return database.MustToUUID(id), nil
|
|
}
|