From 9fdf49fa6c14e4ceb7891931abb606d441939191 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Mon, 6 Apr 2020 13:30:52 +0100 Subject: [PATCH] fix: remove pg dependency `pg-promise` has its own version constraint on `pg`, separate to the app. To avoid a mismatch, this removes `pg` in favour of using the typings of `pg-promise`. --- package-lock.json | 16 ---------------- package.json | 2 -- src/db.ts | 4 ++-- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 664f3d65..3b918ec2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2391,22 +2391,6 @@ "integrity": "sha512-fCA3btjE7QFeRLfcD0Sjg+6/CnmC66HpMBoRfRzd2raTaWMJV21CCZ0LO8MOqf8onl5n0EPfjq4zDhbyX8SVwA==", "dev": true }, - "@types/pg": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.14.3.tgz", - "integrity": "sha512-go5zddQ1FrUQHeBvqPzQ1svKo4KKucSwvqLsvwc/EIuQ9sxDA21b68xc/RwhzAK5pPCnez8NrkYatFIGdJBVvA==", - "dev": true, - "requires": { - "@types/node": "*", - "@types/pg-types": "*" - } - }, - "@types/pg-types": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.5.tgz", - "integrity": "sha512-L8ogeT6vDzT1vxlW3KITTCt+BVXXVkLXfZ/XNm6UqbcJgxf+KPO7yjWx7dQQE8RW07KopL10x2gNMs41+IkMGQ==", - "dev": true - }, "@types/prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-1.19.1.tgz", diff --git a/package.json b/package.json index 098c67f9..6cf826be 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "koa-compose": "^4.1.0", "koa-logger": "^3.2.1", "p-event": "^4.1.0", - "pg": "^7.18.2", "pg-promise": "^10.4.4", "rdf-dataset-ext": "^1.0.0", "rdf-dataset-indexed": "^0.4.0", @@ -41,7 +40,6 @@ "@types/koa__router": "^8.0.2", "@types/node": "^12.12.34", "@types/parse-link-header": "^1.0.0", - "@types/pg": "^7.14.3", "@types/rdf-dataset-ext": "^1.0.0", "@types/rdf-dataset-indexed": "^0.4.3", "@types/rdf-js": "^2.0.11", diff --git a/src/db.ts b/src/db.ts index 6b22edaa..68b7d5ec 100644 --- a/src/db.ts +++ b/src/db.ts @@ -1,6 +1,6 @@ -import { ConnectionConfig } from 'pg'; +import { IConnectionParameters } from 'pg-promise/typescript/pg-subset'; -const config: Readonly = { +const config: Readonly = { user: process.env.DATABASE_USER, password: process.env.DATABASE_PASSWORD, database: process.env.DATABASE_NAME,