Skip to main content

Function: getHistoryCount()

getHistoryCount(db: Database, monitorId: string): number

Defined in: electron/services/database/utils/historyQuery.ts:105

Internal

Get the count of history entries for a monitor.

Parameters

db

Database

Database connection instance

monitorId

string

Unique identifier of the monitor

Returns

number

Number of history entries for the monitor (returns 0 if none found)

Remarks

Repository Context: Called from HistoryRepository.getHistoryCount() and HistoryRepository.getHistoryCountInternal() for transaction contexts.

Fallback Behavior: Returns 0 if no results found or result is null/undefined.

Throws

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error When database query fails