Skip to content

Commit 6f69e1c

Browse files
authored
Document users.toml databases and all_databases settings (#78)
1 parent 4e9036a commit 6f69e1c

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

docs/configuration/users.toml/users.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,38 @@ Name of the database cluster this user belongs to. This refers to `name` setting
3030

3131
Default: **none** (required)
3232

33+
### `databases`
34+
35+
List of database clusters this user belongs to. Each entry refers to a `name` setting in [`pgdog.toml`](../pgdog.toml/databases.md), databases section. Use this instead of `database` to grant a single user access to more than one database without repeating the `[[users]]` entry.
36+
37+
```toml
38+
[[users]]
39+
name = "alice"
40+
databases = ["prod", "analytics"]
41+
password = "hunter2"
42+
```
43+
44+
Default: **none** (an empty list)
45+
46+
!!! note
47+
Specify either `database` or `databases`, not both. If both are set, `database` takes priority and `databases` is ignored.
48+
49+
### `all_databases`
50+
51+
Grant this user access to every database defined in [`pgdog.toml`](../pgdog.toml/databases.md). PgDog expands the entry into one user per configured database, creating a separate connection pool for each. This is a convenient way to give a user access to all databases without listing each one in `databases`.
52+
53+
```toml
54+
[[users]]
55+
name = "alice"
56+
all_databases = true
57+
password = "hunter2"
58+
```
59+
60+
Default: **`false`** (disabled)
61+
62+
!!! note
63+
`all_databases` takes priority over `database` and `databases`. If `all_databases` is set together with either of them, PgDog defaults to all databases and ignores the specific values.
64+
3365
### `password`
3466

3567
The password for the user. Clients will need to provide this when connecting to PgDog.

0 commit comments

Comments
 (0)