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

Function GetMappable

pkg/util/dbutil/dbmappable.go:63–71  ·  view source on GitHub ↗
(tx *txwrap.TxWrap, query string, args ...interface{})

Source from the content-addressed store, hash-verified

61}
62
63func GetMappable[PT DBMappablePtr[T], T any](tx *txwrap.TxWrap, query string, args ...interface{}) PT {
64 m := tx.GetMap(query, args...)
65 if len(m) == 0 {
66 return nil
67 }
68 rtn := PT(new(T))
69 FromDBMap(rtn, m)
70 return rtn
71}
72
73func SelectMappable[PT DBMappablePtr[T], T any](tx *txwrap.TxWrap, query string, args ...interface{}) []PT {
74 var rtn []PT

Callers

nothing calls this directly

Calls 2

FromDBMapFunction · 0.85
GetMapMethod · 0.80

Tested by

no test coverage detected