diff --git a/api/src/database/index.ts b/api/src/database/index.ts index 48670d91e9..5f464eeeef 100644 --- a/api/src/database/index.ts +++ b/api/src/database/index.ts @@ -14,8 +14,11 @@ const connectionConfig: Record = getConfigFromEnv('DB_', [ 'DB_CLIENT', 'DB_SEARCH_PATH', 'DB_CONNECTION_STRING', + 'DB_POOL', ]); +const poolConfig = getConfigFromEnv('DB_POOL'); + const knexConfig: Config = { client: env.DB_CLIENT, searchPath: env.DB_SEARCH_PATH, @@ -26,6 +29,7 @@ const knexConfig: Config = { deprecate: (msg) => logger.info(msg), debug: (msg) => logger.debug(msg), }, + pool: poolConfig, }; if (env.DB_CLIENT === 'sqlite3') { diff --git a/docs/reference/environment-variables.md b/docs/reference/environment-variables.md index 7e4583ac30..72113b6930 100644 --- a/docs/reference/environment-variables.md +++ b/docs/reference/environment-variables.md @@ -28,6 +28,7 @@ | `DB_PASSWORD` | Database user's password. **Required** when using `pg`, `mysql`, `oracledb`, or `mssql`. | -- | | `DB_FILENAME` | Where to read/write the SQLite database. **Required** when using `sqlite3`. | -- | | `DB_CONNECTION_STRING` | When using `pg`, you can submit a connection string instead of individual properties. Using this will ignore any of the other connection settings. | -- | +| `DB_POOL_*` | Pooling settings. Passed on to [the `tarn.js`](https://github.com/vincit/tarn.js#usage) library. | -- | ::: tip Additional Database Variables @@ -37,6 +38,13 @@ database instance. ::: +::: tip Pooling + +All the `DB_POOL_` prefixed options are passed [to `tarn.js`](https://github.com/vincit/tarn.js#usage) through +[Knex](http://knexjs.org/#Installation-pooling) + +::: + ## Security | Variable | Description | Default Value |