From 2482195a5fc5e2fcfb9463544ac2080e428907bd Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 09:25:36 +0100 Subject: [PATCH 01/11] update fastify to v3 --- .dependabot/config.yml | 5 +++++ .github/workflows/ci.yaml | 2 +- package.json | 9 ++------- test/initialization.test.js | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 .dependabot/config.yml diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 0000000..cae63e3 --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,5 @@ +version: 1 +update_configs: + - package_manager: "javascript" + directory: "/" + update_schedule: "daily" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9cb6c00..8dce044 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [6, 8, 10, 12, 13] + node: [10, 12, 14] name: Node.js ${{ matrix.node }} diff --git a/package.json b/package.json index 1081cf3..c0ae780 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ }, "homepage": "https://github.com/fastify/fastify-postgres#readme", "dependencies": { - "fastify-plugin": "^1.5.0" + "fastify-plugin": "^2.0.0" }, "devDependencies": { - "fastify": "^2.7.1", + "fastify": "^3.0.0-rc.1", "pg": "*", "pg-native": "^3.0.0", "standard": "^13.0.1", @@ -40,10 +40,5 @@ }, "peerDependencies": { "pg": ">=6.0.0" - }, - "greenkeeper": { - "ignore": [ - "tap" - ] } } diff --git a/test/initialization.test.js b/test/initialization.test.js index 169dc4d..3c18575 100644 --- a/test/initialization.test.js +++ b/test/initialization.test.js @@ -122,10 +122,10 @@ test('Should throw when trying to register duplicate connection names', (t) => { connectionString: 'postgres://postgres@localhost/postgres', name }) - .register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', - name - }) + fastify.register(fastifyPostgres, { + connectionString: 'postgres://postgres@localhost/postgres', + name + }) fastify.ready((err) => { t.ok(err) From 2a3ba7e87d24be10e60cdd4988c766d7554aa0d1 Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 09:34:55 +0100 Subject: [PATCH 02/11] remove node 6 and 8 --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50e55da..c0f0e08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,9 @@ language: node_js dist: xenial node_js: + - "14" - "12" - "10" - - "8" - - "6" services: - postgresql From eb743d38b33074ef573aa6fd3c5340d90570b951 Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 09:42:13 +0100 Subject: [PATCH 03/11] remove greenkeeper badge --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index a748f09..0c113f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # fastify-postgres -[![Greenkeeper badge](https://badges.greenkeeper.io/fastify/fastify-postgres.svg)](https://greenkeeper.io/) - [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://travis-ci.org/fastify/fastify-postgres.svg?branch=master)](https://travis-ci.org/fastify/fastify-postgres) Fastify PostgreSQL connection plugin, with this you can share the same PostgreSQL connection pool in every part of your server. From 1ba3972bd29df7496fc4a08d0df8b4d52260700d Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 09:42:27 +0100 Subject: [PATCH 04/11] update github actions config --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8dce044..dbc5139 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,7 @@ jobs: env: POSTGRES_USER: postgres POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres ports: # will assign a random free host port - 5432:5432 From 77647cb1b41a7667910822b86c6c7fe9ce7a04e1 Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 10:27:44 +0100 Subject: [PATCH 05/11] add pgpass file --- .github/workflows/ci.yaml | 2 +- .pgpass | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .pgpass diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dbc5139..92fbcb6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: run: | npm i node-gyp sudo apt-get install -yqq libpq-dev postgresql-client - psql -h localhost -p ${{ job.services.postgres.ports[5432] }} -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres + PGPASSFILE=.pgpass psql -h localhost -p ${{ job.services.postgres.ports[5432] }} -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres - name: Install run: npm install diff --git a/.pgpass b/.pgpass new file mode 100644 index 0000000..e7aebce --- /dev/null +++ b/.pgpass @@ -0,0 +1 @@ +localhost:*:*:postgres:postgres \ No newline at end of file From 364bbebc949aec7a847fd5a3ac2c68743ee99d7a Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 10:32:01 +0100 Subject: [PATCH 06/11] update github actions config --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 92fbcb6..78133bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,6 +33,7 @@ jobs: run: | npm i node-gyp sudo apt-get install -yqq libpq-dev postgresql-client + chmod 600 .pgpass PGPASSFILE=.pgpass psql -h localhost -p ${{ job.services.postgres.ports[5432] }} -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres - name: Install From a51eb1ff29fbc2eadd9e8a57439d514352a07287 Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 10:36:27 +0100 Subject: [PATCH 07/11] update connection string --- test/initialization.test.js | 22 +++++++++++----------- test/query.test.js | 14 +++++++------- test/transaction.test.js | 20 ++++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/test/initialization.test.js b/test/initialization.test.js index 3c18575..011bef1 100644 --- a/test/initialization.test.js +++ b/test/initialization.test.js @@ -12,7 +12,7 @@ test('Should be able to use native module', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', native: true }) @@ -38,7 +38,7 @@ test('Should be able to use an alternative pg module', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', pg: altPg }) @@ -64,7 +64,7 @@ test('Should not throw if registered within different scopes (with and without n fastify.register(function scopeOne (instance, opts, next) { instance.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) next() @@ -72,12 +72,12 @@ test('Should not throw if registered within different scopes (with and without n fastify.register(function scopeTwo (instance, opts, next) { instance.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'one' }) instance.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'two' }) @@ -97,11 +97,11 @@ test('Should throw when trying to register multiple instances without giving a n t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -119,11 +119,11 @@ test('Should throw when trying to register duplicate connection names', (t) => { fastify .register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name }) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name }) @@ -140,7 +140,7 @@ test('fastify.pg namespace should exist', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -160,7 +160,7 @@ test('fastify.pg.test namespace should exist', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) diff --git a/test/query.test.js b/test/query.test.js index 5af59b4..e5a8c50 100644 --- a/test/query.test.js +++ b/test/query.test.js @@ -13,7 +13,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -40,7 +40,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -60,7 +60,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -141,7 +141,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -167,7 +167,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -187,7 +187,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -212,7 +212,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test', native: true }) diff --git a/test/transaction.test.js b/test/transaction.test.js index 2646f52..5953a0c 100644 --- a/test/transaction.test.js +++ b/test/transaction.test.js @@ -13,7 +13,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -50,7 +50,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -87,7 +87,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -128,7 +128,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -182,7 +182,7 @@ test('When fastify.pg root namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres' + connectionString: 'postgres://postgres:postgres@localhost/postgres' }) fastify.ready((err) => { @@ -259,7 +259,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -297,7 +297,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -337,7 +337,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -380,7 +380,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) @@ -435,7 +435,7 @@ test('When fastify.pg.test namespace is used:', (t) => { t.teardown(() => fastify.close()) fastify.register(fastifyPostgres, { - connectionString: 'postgres://postgres@localhost/postgres', + connectionString: 'postgres://postgres:postgres@localhost/postgres', name: 'test' }) From 88a9c9add7b0ab1ee76a8e142e313fa83eb6f86a Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 11:22:27 +0100 Subject: [PATCH 08/11] remove travis config --- .travis.yml | 26 -------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c0f0e08..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: node_js - -dist: xenial - -node_js: - - "14" - - "12" - - "10" - -services: - - postgresql - -sudo: true - -before_install: - - psql -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres - - if [ $TRAVIS_OS_NAME == "linux" ]; then - if [[ $(node -v) =~ v[1-9][0-9] ]]; then - source ./ci_scripts/build.sh; - fi - fi - -notifications: - email: - on_success: never - on_failure: always diff --git a/package.json b/package.json index c0ae780..d151499 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test:report": "standard && tap -J --coverage-report=html test/*.test.js", "test:verbose": "standard && tap -J test/*.test.js -Rspec", "load-data": "docker run --rm -d --link fastify-postgres:postgres postgres:11-alpine psql -h postgres -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres", - "postgres": "docker run --rm -d -p 5432:5432 --name fastify-postgres postgres:11-alpine" + "postgres": "docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres --name fastify-postgres postgres:11-alpine" }, "repository": { "type": "git", From a013de14026663f579f38e8d8c97c63a10c70a9e Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Wed, 29 Apr 2020 11:50:39 +0100 Subject: [PATCH 09/11] update docker commands --- package.json | 4 ++-- test/query.test.js | 6 +++--- test/transaction.test.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d151499..a37bdb7 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "test": "standard && tap -J test/*.test.js", "test:report": "standard && tap -J --coverage-report=html test/*.test.js", "test:verbose": "standard && tap -J test/*.test.js -Rspec", - "load-data": "docker run --rm -d --link fastify-postgres:postgres postgres:11-alpine psql -h postgres -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres", - "postgres": "docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres --name fastify-postgres postgres:11-alpine" + "postgres": "docker run -p 5432:5432 --name fastify-postgres -e POSTGRES_PASSWORD=postgres -d postgres", + "load-data": "docker exec -it fastify-postgres psql -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres -d postgres" }, "repository": { "type": "git", diff --git a/test/query.test.js b/test/query.test.js index e5a8c50..2209cdb 100644 --- a/test/query.test.js +++ b/test/query.test.js @@ -88,7 +88,7 @@ test('When fastify.pg root namespace is used:', (t) => { const DB_NAME = 'database_that_do_not_exist' fastify.register(fastifyPostgres, { - connectionString: `postgres://postgres@localhost/${DB_NAME}` + connectionString: `postgres://postgres:postgres@localhost/${DB_NAME}` }) fastify.ready((err) => { @@ -112,7 +112,7 @@ test('When fastify.pg root namespace is used:', (t) => { const DB_NAME = 'database_that_do_not_exist' fastify.register(fastifyPostgres, { - connectionString: `postgres://postgres@localhost/${DB_NAME}` + connectionString: `postgres://postgres:postgres@localhost/${DB_NAME}` }) fastify.ready((err) => { @@ -240,7 +240,7 @@ test('When fastify.pg.test namespace is used:', (t) => { const DB_NAME = 'database_that_do_not_exist' fastify.register(fastifyPostgres, { - connectionString: `postgres://postgres@localhost/${DB_NAME}`, + connectionString: `postgres://postgres:postgres@localhost/${DB_NAME}`, name: 'test' }) diff --git a/test/transaction.test.js b/test/transaction.test.js index 5953a0c..fcc1b97 100644 --- a/test/transaction.test.js +++ b/test/transaction.test.js @@ -234,7 +234,7 @@ test('When fastify.pg root namespace is used:', (t) => { const BAD_DB_NAME = 'db_that_does_not_exist' fastify.register(fastifyPostgres, { - connectionString: `postgres://postgres@localhost/${BAD_DB_NAME}` + connectionString: `postgres://postgres:postgres@localhost/${BAD_DB_NAME}` }) fastify.ready((err) => { @@ -488,7 +488,7 @@ test('When fastify.pg.test namespace is used:', (t) => { const BAD_DB_NAME = 'db_that_does_not_exist' fastify.register(fastifyPostgres, { - connectionString: `postgres://postgres@localhost/${BAD_DB_NAME}`, + connectionString: `postgres://postgres:postgres@localhost/${BAD_DB_NAME}`, name: 'test' }) From 90dea4d3ad47b5389e337002a83995ab5d1d16ec Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Fri, 1 May 2020 10:47:17 +0100 Subject: [PATCH 10/11] add build status badge --- .github/workflows/ci.yaml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 78133bb..e6a3196 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: GitHub CI +name: CI workflow on: [push, pull_request] diff --git a/README.md b/README.md index 0c113f2..a838c4b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # fastify-postgres -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://travis-ci.org/fastify/fastify-postgres.svg?branch=master)](https://travis-ci.org/fastify/fastify-postgres) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) ![CI workflow](https://github.com/fastify/fastify-postgres/workflows/CI%20workflow/badge.svg) Fastify PostgreSQL connection plugin, with this you can share the same PostgreSQL connection pool in every part of your server. Under the hood the [node-postgres](https://github.com/brianc/node-postgres) is used, the options that you pass to `register` will be passed to the PostgreSQL pool builder. From 718eb062eaaba352a326c05d70d9c0d7c8ee43ae Mon Sep 17 00:00:00 2001 From: Peter Balazs Date: Sun, 3 May 2020 13:56:47 +0100 Subject: [PATCH 11/11] Update package.json Co-authored-by: Manuel Spigolon --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a37bdb7..477f03b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "standard && tap -J test/*.test.js", "test:report": "standard && tap -J --coverage-report=html test/*.test.js", "test:verbose": "standard && tap -J test/*.test.js -Rspec", - "postgres": "docker run -p 5432:5432 --name fastify-postgres -e POSTGRES_PASSWORD=postgres -d postgres", + "postgres": "docker run -p 5432:5432 --name fastify-postgres -e POSTGRES_PASSWORD=postgres -d postgres:11-alpine", "load-data": "docker exec -it fastify-postgres psql -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres -d postgres" }, "repository": {