MCPcopy
hub / github.com/wavetermdev/waveterm / DBSelectMap

Function DBSelectMap

pkg/wstore/wstore_dbops.go:262–272  ·  view source on GitHub ↗
(ctx context.Context, ids []string)

Source from the content-addressed store, hash-verified

260}
261
262func DBSelectMap[T waveobj.WaveObj](ctx context.Context, ids []string) (map[string]T, error) {
263 rtnArr, err := dbSelectOIDs(ctx, getOTypeGen[T](), ids)
264 if err != nil {
265 return nil, err
266 }
267 rtnMap := make(map[string]T)
268 for _, obj := range rtnArr {
269 rtnMap[waveobj.GetOID(obj)] = obj.(T)
270 }
271 return rtnMap, nil
272}
273
274func DBDelete(ctx context.Context, otype string, id string) error {
275 err := WithTx(ctx, func(tx *TxWrap) error {

Callers

nothing calls this directly

Calls 2

GetOIDFunction · 0.92
dbSelectOIDsFunction · 0.85

Tested by

no test coverage detected