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

Function DBGetCount

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

Source from the content-addressed store, hash-verified

38}
39
40func DBGetCount[T waveobj.WaveObj](ctx context.Context) (int, error) {
41 return WithTxRtn(ctx, func(tx *TxWrap) (int, error) {
42 table := tableNameGen[T]()
43 query := fmt.Sprintf("SELECT count(*) FROM %s", table)
44 return tx.GetInt(query), nil
45 })
46}
47
48// returns (num named workespaces, num total workspaces, error)
49func DBGetWSCounts(ctx context.Context) (int, int, error) {

Callers

nothing calls this directly

Calls 2

GetIntMethod · 0.80
WithTxRtnFunction · 0.70

Tested by

no test coverage detected