Skip to content

Commit

Permalink
Add description about placeholders of database.properties (scalar-lab…
Browse files Browse the repository at this point in the history
…s#1498)

Co-authored-by: Josh Wong <joshua.wong@scalar-labs.com>
Co-authored-by: Toshihiro Suzuki <brfrn169@gmail.com>
  • Loading branch information
3 people authored Feb 16, 2024
1 parent 2802263 commit 0c23ecb
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 @@ -186,6 +186,19 @@ The following are additional configurations available for ScalarDB:
| `scalar.db.default_namespace_name` | The given namespace name will be used by operations that do not already specify a namespace. | |
| `scalar.db.system_namespace_name` | The given namespace name will be used by ScalarDB internally. | `scalardb` |

## 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 0c23ecb

Please sign in to comment.