Function: bulkInsertHistory()
bulkInsertHistory(
db
:Database
,monitorId
:string
,historyEntries
:StatusHistory
& {details?
:string
; }[]):void
Defined in: electron/services/database/utils/historyManipulation.ts:119
Internal
Bulk insert history entries (for import functionality).
Parameters
db
Database connection instance
monitorId
string
Unique identifier of the monitor
historyEntries
StatusHistory
& { details?
: string
; }[]
Array of StatusHistory objects with optional details
Returns
void
Remarks
Transaction Context: Assumes it's called within an existing transaction context. Uses a prepared statement for better performance during bulk operations.
Performance: Optimized for large datasets with prepared statement reuse. The statement is properly finalized in the finally block to prevent resource leaks.
Status Validation: StatusHistory.status is always "up" or "down" per domain contract.
Throws
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error When database bulk insertion fails