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

Function DBGetSingleton

pkg/wstore/wstore_dbops.go:102–105  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

100}
101
102func DBGetSingleton[T waveobj.WaveObj](ctx context.Context) (T, error) {
103 rtn, err := DBGetSingletonByType(ctx, getOTypeGen[T]())
104 return genericCastWithErr[T](rtn, err)
105}
106
107func DBGetSingletonByType(ctx context.Context, otype string) (waveobj.WaveObj, error) {
108 return WithTxRtn(ctx, func(tx *TxWrap) (waveobj.WaveObj, error) {

Callers

nothing calls this directly

Calls 1

DBGetSingletonByTypeFunction · 0.85

Tested by

no test coverage detected