sequelize
Version:
Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift and Snowflake’s Data Cloud. It features solid transaction support, relations, eager and lazy loading, read replication and more.
25 lines (24 loc) • 848 B
TypeScript
import BaseError, { CommonErrorProperties, ErrorOptions } from './base-error';
export interface DatabaseErrorParent extends Error, Pick<CommonErrorProperties, 'sql'> {
/** The parameters for the sql that triggered the error */
readonly parameters?: object;
}
export interface DatabaseErrorSubclassOptions extends ErrorOptions {
parent?: DatabaseErrorParent;
message?: string;
}
/**
* A base class for all database related errors.
*/
declare class DatabaseError extends BaseError implements DatabaseErrorParent, CommonErrorProperties {
parent: Error;
original: Error;
sql: string;
parameters: object;
/**
* @param parent The database specific error which triggered this one
* @param options
*/
constructor(parent: DatabaseErrorParent, options?: ErrorOptions);
}
export default DatabaseError;