Skip to content

Commit 8ca9559

Browse files
Add missing acquireConnectionTimeout config option to database (#929)
* Add missing acquireConnectionTimeout config option to database * change ms to milliseconds
1 parent 39ea19d commit 8ca9559

File tree

1 file changed

+21
-20
lines changed
  • docs/developer-docs/latest/setup-deployment-guides/configurations/required

1 file changed

+21
-20
lines changed

docs/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,25 @@ The `./config/database.js` accepts 2 main configuration objects:
2121

2222
### `connection` configuration object
2323

24-
| Parameter | Description | Type |
25-
| ------------------------------------------------------------------ | ---------------------------------------------------------------------------- | --------- |
26-
| `client` | Database client to create the connection. `sqlite` or `postgres` or `mysql`. | `String` |
27-
| `connection` | Database [connection information](#connection-parameters) | `Object` |
28-
| `debug` | Show database exchanges and errors. | `Boolean` |
29-
| `useNullAsDefault`<br/><br />_Optional, only for SQLite_ | Use `NULL` as a default value | `Boolean` |
30-
| `pool`<br /><br />_Optional_ | [Database pooling options](#database-pooling-options) | `Object` |
24+
| Parameter | Description | Type | Default |
25+
|----------------------------------------------------------|---------------------------------------------------------------------------------------------|-----------|---------|
26+
| `client` | Database client to create the connection. `sqlite` or `postgres` or `mysql`. | `String` | - |
27+
| `connection` | Database [connection information](#connection-parameters) | `Object` | - |
28+
| `debug` | Show database exchanges and errors. | `Boolean` | `false` |
29+
| `useNullAsDefault`<br/><br />_Optional, only for SQLite_ | Use `NULL` as a default value | `Boolean` | `true` |
30+
| `pool`<br /><br />_Optional_ | [Database pooling options](#database-pooling-options) | `Object` | - |
31+
| `acquireConnectionTimeout`<br /><br />_Optional_ | How long knex will wait before throwing a timeout error when acquiring a connection (in milliseconds) | `Integer` | `60000` |
3132

3233
#### Connection parameters
3334

3435
The `connection.connection` object found in `./config/database.js` is used to pass database connection information and accepts the following parameters:
3536

3637
| Parameter | Description | Type |
37-
| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------- |
38+
|------------|-------------------------------------------------------------------------------------------------------------------------------|-----------------------|
3839
| `host` | Database host name. Default value: `localhost`. | `String` |
3940
| `port` | Database port | `Integer` |
4041
| `database` | Database name. | `String` |
41-
| `user` | Username used to establish the connection | `String` |
42+
| `user` | Username used to establish the connection | `String` |
4243
| `password` | Password used to establish the connection | `String` |
4344
| `timezone` | Set the default behavior for local time. Default value: `utc` [Timezone options](https://www.php.net/manual/en/timezones.php) | `String` |
4445
| `schema` | Set the default database schema. **Used only for Postgres DB.** | `String` |
@@ -48,24 +49,24 @@ The `connection.connection` object found in `./config/database.js` is used to pa
4849

4950
The `connection.pool` object optionally found in `./config/database.js` is used to pass [Tarn.js](https://github.com/vincit/tarn.js) database pooling options and accepts the following parameters:
5051

51-
| Parameter | Description | Type | Default |
52-
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------- |
53-
| `min` | Minimum number of database connections to keepalive | `Integer` | `0` |
54-
| `max` | Maximum number of database connections to keepalive | `Integer` | `10` |
55-
| `acquireTimeoutMillis` | Time in ms before timing out a database connection attempt | `Integer` | - |
56-
| `createTimeoutMillis` | Time in ms before timing out a create query attempt | `Integer` | - |
57-
| `destroyTimeoutMillis` | Time in ms before timing out a destroy query attempt | `Integer` | - |
58-
| `idleTimeoutMillis` | Time in ms before free database connections are destroyed | `Integer` | - |
59-
| `reapIntervalMillis` | Time in ms to check for idle database connections to destroy | `Integer` | - |
60-
| `createRetryIntervalMillis` | Time in ms to idle before retrying failed create actions | `Integer` | - |
52+
| Parameter | Description | Type | Default |
53+
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|---------|
54+
| `min` | Minimum number of database connections to keepalive | `Integer` | `0` |
55+
| `max` | Maximum number of database connections to keepalive | `Integer` | `10` |
56+
| `acquireTimeoutMillis` | Time in milliseconds before timing out a database connection attempt | `Integer` | - |
57+
| `createTimeoutMillis` | Time in milliseconds before timing out a create query attempt | `Integer` | - |
58+
| `destroyTimeoutMillis` | Time in milliseconds before timing out a destroy query attempt | `Integer` | - |
59+
| `idleTimeoutMillis` | Time in milliseconds before free database connections are destroyed | `Integer` | - |
60+
| `reapIntervalMillis` | Time in milliseconds to check for idle database connections to destroy | `Integer` | - |
61+
| `createRetryIntervalMillis` | Time in milliseconds to idle before retrying failed create actions | `Integer` | - |
6162
| `afterCreate` | Callback function to execute custom logic when the pool acquires a new connection.<br/><br/>See the [Knex.js documentation](https://knexjs.org/#Installation-pooling) for more information | `Function` | - |
6263

6364
### `settings` configuration object
6465

6566
The `settings` object found in `./config/database.js` is used to configure Strapi-specific database settings and accepts the following parameter:
6667

6768
| Parameter | Description | Type | Default |
68-
| ---------------- | ------------------------------------------------ | --------- | ------- |
69+
|------------------|--------------------------------------------------|-----------|---------|
6970
| `forceMigration` | Enable or disable the forced database migration. | `Boolean` | `true` |
7071

7172
<!-- TODO: Open and track a feature request for autoMigration as it doesn't exist in v4 -->

0 commit comments

Comments
 (0)