@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
22 lines • 777 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.PgError = void 0;
const ClientError_1 = require("../abstract/ClientError");
class PgError extends ClientError_1.ClientError {
constructor(cause, where, sql) {
super(cause, where, "fail", "data-on-server-is-unchanged", "pg_error");
this.sql = sql;
Object.defineProperty(this, "sql", {
value: sql,
writable: false,
enumerable: false,
});
this.stack += ": " + sql.replace(/\s*\n\s*/g, " ");
}
isFKError(fkName) {
return (this.message.includes("foreign key constraint") &&
(!fkName || this.message.includes(fkName)));
}
}
exports.PgError = PgError;
//# sourceMappingURL=PgError.js.map
;