Skip to content

Commit

Permalink
Add description about placeholders of database.properties (#1498)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Wong <joshua.wong@scalar-labs.com>
Co-authored-by: Toshihiro Suzuki <brfrn169@gmail.com>
  • Loading branch information
3 people committed Feb 16, 2024
1 parent 21dc7e5 commit 7410a4b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ The following are additional configurations available for ScalarDB:
| `scalar.db.metadata.cache_expiration_time_secs` | ScalarDB has a metadata cache to reduce the number of requests to the database. This setting specifies the expiration time of the cache in seconds. | `-1` (no expiration) |
| `scalar.db.active_transaction_management.expiration_time_millis` | ScalarDB maintains ongoing transactions, which can be resumed by using a transaction ID. This setting specifies the expiration time of this transaction management feature in milliseconds. | `-1` (no expiration) |

## Placeholder usage

You can use placeholders in the values, and they are replaced with environment variables (`${env:<ENVIRONMENT_VARIABLE_NAME>}`) or system properties (`${sys:<SYSTEM_PROPERTY_NAME>}`). You can also specify default values in placeholders like `${sys:<SYSTEM_PROPERTY_NAME>:-<DEFAULT_VALUE>}`.

The following is an example of a configuration that uses placeholders:

```properties
scalar.db.username=${env:<SCALAR_DB_USERNAME>:-admin}
scalar.db.password=${env:<SCALAR_DB_PASSWORD>}
```

In this example configuration, ScalarDB reads the username and password from environment variables. If the environment variable `SCALAR_DB_USERNAME` does not exist, ScalarDB uses the default value `admin`.

## Configuration examples

This section provides some configuration examples.
Expand Down

0 comments on commit 7410a4b

Please sign in to comment.