@contember/database
Advanced tools
Comparing version 0.6.3 to 0.6.6
@@ -15,2 +15,4 @@ export declare class ConnectionError extends Error { | ||
} | ||
export declare class SerializationFailureError extends ConnectionError { | ||
} | ||
//# sourceMappingURL=errors.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
constructor(sql, parameters, previous) { | ||
super(`Execution of SQL query has failed: | ||
super(`Execution of SQL query has failed: | ||
SQL: ${sql} | ||
@@ -29,2 +29,5 @@ parameters: ${parameters} | ||
exports.UniqueViolationError = UniqueViolationError; | ||
class SerializationFailureError extends ConnectionError { | ||
} | ||
exports.SerializationFailureError = SerializationFailureError; | ||
//# sourceMappingURL=errors.js.map |
@@ -45,2 +45,4 @@ "use strict"; | ||
throw new errors_1.UniqueViolationError(sql, parameters, error); | ||
case '40001': | ||
throw new errors_1.SerializationFailureError(sql, parameters, error); | ||
default: | ||
@@ -47,0 +49,0 @@ throw new errors_1.ConnectionError(sql, parameters, error); |
{ | ||
"name": "@contember/database", | ||
"version": "0.6.3", | ||
"version": "0.6.6", | ||
"license": "Apache-2.0", | ||
@@ -11,7 +11,7 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@contember/queryable": "^0.6.3", | ||
"@contember/queryable": "^0.6.6", | ||
"pg": "^7.17.1" | ||
}, | ||
"devDependencies": { | ||
"@contember/database-tester": "^0.6.3", | ||
"@contember/database-tester": "^0.6.6", | ||
"@types/jasmine": "^3.4.5", | ||
@@ -23,3 +23,3 @@ "@types/node": "^12.11.7", | ||
}, | ||
"gitHead": "ce4b6bfeea630fa2dd2d2d06f10cf813e7cd742c" | ||
"gitHead": "6cd07fb5b509c443a1478a60b3d088abd73c8f3c" | ||
} |
@@ -6,3 +6,3 @@ export class ConnectionError extends Error { | ||
constructor(public readonly sql: string, public readonly parameters: any, public readonly previous: Error | any) { | ||
super(`Execution of SQL query has failed: | ||
super(`Execution of SQL query has failed: | ||
SQL: ${sql} | ||
@@ -23,1 +23,3 @@ parameters: ${parameters} | ||
export class UniqueViolationError extends ConnectionError {} | ||
export class SerializationFailureError extends ConnectionError {} |
import { PoolClient } from 'pg' | ||
import { EventManager } from './EventManager' | ||
import { Connection } from './Connection' | ||
import { ConnectionError, ForeignKeyViolationError, NotNullViolationError, UniqueViolationError } from './errors' | ||
import { | ||
ConnectionError, | ||
ForeignKeyViolationError, | ||
NotNullViolationError, | ||
SerializationFailureError, | ||
UniqueViolationError, | ||
} from './errors' | ||
@@ -58,2 +64,4 @@ function prepareSql(sql: string) { | ||
throw new UniqueViolationError(sql, parameters, error) | ||
case '40001': | ||
throw new SerializationFailureError(sql, parameters, error) | ||
default: | ||
@@ -60,0 +68,0 @@ throw new ConnectionError(sql, parameters, error) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
552613
4500
Updated@contember/queryable@^0.6.6