(ctx context.Context, uuids ...string)
| 33 | } |
| 34 | |
| 35 | func (h *Store[H]) List(ctx context.Context, uuids ...string) ([]*Commit[H], error) { |
| 36 | if len(uuids) == 0 { |
| 37 | return nil, errors.New("uuids is empty") |
| 38 | } |
| 39 | db := h.db.DB(ctx).Table(h.commitTableName) |
| 40 | if len(uuids) == 1 { |
| 41 | db = db.Where("`uuid` = ?", uuids[0]) |
| 42 | } else { |
| 43 | db = db.Where("`uuid` in ?", uuids) |
| 44 | } |
| 45 | |
| 46 | var commit = make([]*Commit[H], 0, len(uuids)) |
| 47 | err := db.Find(&commit).Error |
| 48 | if err != nil { |
| 49 | return nil, err |
| 50 | } |
| 51 | return commit, nil |
| 52 | } |
| 53 | |
| 54 | func NewCommitStore[H any](name string) *Store[H] { |
| 55 | return &Store[H]{ |
nothing calls this directly
no outgoing calls
no test coverage detected