typeorm
Version:
Data-Mapper ORM for TypeScript and ES2023+. Supports MySQL/MariaDB, PostgreSQL, MS SQL Server, Oracle, SAP HANA, SQLite, MongoDB databases.
36 lines (35 loc) • 950 B
TypeScript
import type { ObjectLiteral } from "../../common/ObjectLiteral";
import type { BaseEvent } from "./BaseEvent";
/**
* BeforeQueryEvent is an object that broadcaster sends to the entity subscriber before query is ran against the database.
*/
export interface QueryEvent extends BaseEvent {
/**
* Query that is being executed.
*/
query: string;
/**
* Parameters used in the query.
*/
parameters?: any[] | ObjectLiteral;
}
export interface BeforeQueryEvent extends QueryEvent {
}
export interface AfterQueryEvent extends QueryEvent {
/**
* Whether the query was successful.
*/
success: boolean;
/**
* The duration of the query execution, in milliseconds.
*/
executionTime?: number;
/**
* The raw results from the database if the query was successful.
*/
rawResults?: any;
/**
* The error thrown if the query was unsuccessful.
*/
error?: any;
}