From b78b454cff797c01952b89abca3bff678c32ae58 Mon Sep 17 00:00:00 2001 From: sharadpattanshetti <43475650+sharadpattanshetti@users.noreply.github.com> Date: Mon, 18 Apr 2022 11:36:07 +0530 Subject: [PATCH 1/2] Added docs for knex pool config Signed-off-by: sharadpattanshetti <43475650+sharadpattanshetti@users.noreply.github.com> --- docs/tutorials/switching-sqlite-postgres.md | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/tutorials/switching-sqlite-postgres.md b/docs/tutorials/switching-sqlite-postgres.md index 5d4268a4bc..aba136bd90 100644 --- a/docs/tutorials/switching-sqlite-postgres.md +++ b/docs/tutorials/switching-sqlite-postgres.md @@ -55,3 +55,35 @@ launching Backstage, or remove the `${...}` values and simply set actual values directly for development. The Backstage App is now ready to start up with a PostgreSQL backing database. + +### Override default PostgreSQL Database Pool Configuration + +If you want to override the default connection pool settings then use the below configuration: + +```diff +backend: + database: +- client: better-sqlite3 +- connection: ':memory:' ++ # config options: https://node-postgres.com/api/client ++ client: pg ++ connection: ++ host: ${POSTGRES_HOST} ++ port: ${POSTGRES_PORT} ++ user: ${POSTGRES_USER} ++ password: ${POSTGRES_PASSWORD} ++ # Refer to Tarn docs for default values on PostgreSQL pool configuration - https://github.com/Vincit/tarn.js ++ knexConfig: ++ pool: ++ min: 3 ++ max: 12 ++ acquireTimeoutMillis: 60000 ++ idleTimeoutMillis: 60000 ++ # https://node-postgres.com/features/ssl ++ # you can set the sslmode configuration option via the `PGSSLMODE` environment variable ++ # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require) ++ # ssl: ++ # ca: # if you have a CA file and want to verify it you can uncomment this section ++ # $file: /ca/server.crt +``` + From df04cbbb5c3464f1f4f974b3e720112ad69b9f5f Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 19 Apr 2022 00:47:07 +0200 Subject: [PATCH 2/2] chore: fixing prettier recommendations Signed-off-by: blam --- docs/tutorials/switching-sqlite-postgres.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/tutorials/switching-sqlite-postgres.md b/docs/tutorials/switching-sqlite-postgres.md index aba136bd90..c4e4bd83b6 100644 --- a/docs/tutorials/switching-sqlite-postgres.md +++ b/docs/tutorials/switching-sqlite-postgres.md @@ -84,6 +84,5 @@ backend: + # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require) + # ssl: + # ca: # if you have a CA file and want to verify it you can uncomment this section -+ # $file: /ca/server.crt ++ # $file: /ca/server.crt ``` -