Function: bulkInsertHistory()
bulkInsertHistory(
db:Database,monitorId:string,historyEntries:StatusHistory[]):void
Defined in: electron/services/database/utils/historyManipulation.ts:120
Internal
Bulk insert history entries (for import functionality).
Parameters
db
Database connection instance
monitorId
string
Unique identifier of the monitor
historyEntries
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 can be "up", "down", or "degraded" per domain contract.
Throws
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error When database bulk insertion fails