MCPcopy Index your code
hub / github.com/syncthing/syncthing / CountLocal

Method CountLocal

internal/db/sqlite/folderdb_counts.go:22–32  ·  view source on GitHub ↗
(device protocol.DeviceID)

Source from the content-addressed store, hash-verified

20}
21
22func (s *folderDB) CountLocal(device protocol.DeviceID) (db.Counts, error) {
23 var res []countsRow
24 if err := s.stmt(`
25 SELECT s.type, s.count, s.size, s.local_flags, s.deleted FROM counts s
26 INNER JOIN devices d ON d.idx = s.device_idx
27 WHERE d.device_id = ? AND s.local_flags & {{.FlagLocalIgnored}} = 0
28 `).Select(&res, device.String()); err != nil {
29 return db.Counts{}, wrap(err)
30 }
31 return summarizeCounts(res), nil
32}
33
34func (s *folderDB) CountNeed(device protocol.DeviceID) (db.Counts, error) {
35 if device == protocol.LocalDeviceID {

Callers

nothing calls this directly

Calls 5

summarizeCountsFunction · 0.85
stmtMethod · 0.80
wrapFunction · 0.70
SelectMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected