Skip to main content

Function: historyEntryToRow()

historyEntryToRow(monitorId: string, entry: StatusHistory, details?: string): HistoryRow

Defined in: electron/services/database/utils/historyMapper.ts:113

Converts a StatusHistory object to a database row format.

Parameters

monitorId

string

The unique identifier of the monitor.

entry

StatusHistory

The StatusHistory object to convert.

details?

string

Optional details string to include in the row.

Returns

HistoryRow

An object representing the database row for the history entry.

Remarks

Used when inserting or updating history entries in the database.

Example

const row = historyEntryToRow("monitor-123", {
status: "up",
responseTime: 120,
timestamp: 1680000000000,
});