You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .schema/users.schema.json
+55-25Lines changed: 55 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,21 @@
98
98
}
99
99
]
100
100
},
101
+
"TimeValue": {
102
+
"description": "Time value: a number, in the unit documented on the field, or a duration\nstring built from `ms`, `s`, `m`, `h` and `d` components, e.g. `\"1h5m15s\"`.",
103
+
"anyOf": [
104
+
{
105
+
"description": "Number of milliseconds, or seconds for fields documented in seconds.",
106
+
"type": "integer",
107
+
"format": "uint64",
108
+
"minimum": 0
109
+
},
110
+
{
111
+
"description": "Duration string, e.g. `\"250ms\"`, `\"5s\"`, `\"1h5m15s\"`.",
112
+
"type": "string"
113
+
}
114
+
]
115
+
},
101
116
"User": {
102
117
"description": "User allowed to connect to pgDog.\nA user entry in `users.toml`, controlling which users are allowed to connect to PgDog.\n\n<https://docs.pgdog.dev/configuration/users.toml/users/>",
103
118
"type": "object",
@@ -136,21 +151,27 @@
136
151
},
137
152
"idle_timeout": {
138
153
"description": "Overrides [`idle_timeout`](https://docs.pgdog.dev/configuration/pgdog.toml/general/#idle_timeout) for this user. Server connections that have been idle for this long, without affecting [`min_pool_size`](https://docs.pgdog.dev/configuration/pgdog.toml/general/#min_pool_size), will be closed.\n\n<https://docs.pgdog.dev/configuration/users.toml/users/#idle_timeout>",
139
-
"type": [
140
-
"integer",
141
-
"null"
154
+
"anyOf": [
155
+
{
156
+
"$ref": "#/$defs/TimeValue"
157
+
},
158
+
{
159
+
"type": "null"
160
+
}
142
161
],
143
-
"format": "uint64",
144
-
"minimum": 0
162
+
"default": null
145
163
},
146
164
"lock_timeout": {
147
165
"description": "Lock timeout.\n\nSets the `lock_timeout` on all server connections at connection creation.\nAborts any statement that waits longer than the specified duration to acquire a lock.\nUnlike `statement_timeout`, this only counts time spent waiting for locks, not execution time.\nRecommended for replication destination connections to prevent cross-shard deadlocks\nfrom hanging indefinitely.\n\n**Note:** Nothing is preventing the user from manually changing this setting at runtime,\ne.g., by running `SET lock_timeout TO 0`;\n\n<https://docs.pgdog.dev/configuration/users.toml/users/#lock_timeout>",
148
-
"type": [
149
-
"integer",
150
-
"null"
166
+
"anyOf": [
167
+
{
168
+
"$ref": "#/$defs/TimeValue"
169
+
},
170
+
{
171
+
"type": "null"
172
+
}
151
173
],
152
-
"format": "uint64",
153
-
"minimum": 0
174
+
"default": null
154
175
},
155
176
"min_pool_size": {
156
177
"description": "Overrides [`min_pool_size`](https://docs.pgdog.dev/configuration/pgdog.toml/general/#min_pool_size) for this user. Opens at least this many connections on pooler startup and keeps them open despite [`idle_timeout`](https://docs.pgdog.dev/configuration/pgdog.toml/general/#idle_timeout).\n\n<https://docs.pgdog.dev/configuration/users.toml/users/#min_pool_size>",
@@ -245,21 +266,27 @@
245
266
},
246
267
"server_lifetime": {
247
268
"description": "Server connections older than this (in milliseconds) will be closed when returned to the pool.",
248
-
"type": [
249
-
"integer",
250
-
"null"
269
+
"anyOf": [
270
+
{
271
+
"$ref": "#/$defs/TimeValue"
272
+
},
273
+
{
274
+
"type": "null"
275
+
}
251
276
],
252
-
"format": "uint64",
253
-
"minimum": 0
277
+
"default": null
254
278
},
255
279
"server_lifetime_jitter": {
256
280
"description": "Maximum random adjustment applied to `server_lifetime` per backend connection (milliseconds).\nOverrides the database-level and general-level `server_lifetime_jitter` setting for this user.",
257
-
"type": [
258
-
"integer",
259
-
"null"
281
+
"anyOf": [
282
+
{
283
+
"$ref": "#/$defs/TimeValue"
284
+
},
285
+
{
286
+
"type": "null"
287
+
}
260
288
],
261
-
"format": "uint64",
262
-
"minimum": 0
289
+
"default": null
263
290
},
264
291
"server_password": {
265
292
"description": "Which password to connect with when creating backend connections from PgDog to PostgreSQL. By default, the password configured in `password` is used. This setting allows you to override this configuration and use a different password, decoupling server passwords from user passwords given to clients.\n\n**Note:** Values specified in `pgdog.toml` take priority over this configuration.\n\n<https://docs.pgdog.dev/configuration/users.toml/users/#server_password>",
@@ -284,12 +311,15 @@
284
311
},
285
312
"statement_timeout": {
286
313
"description": "Statement timeout.\n\nSets the `statement_timeout` on all server connections at connection creation. This allows you to set a reasonable default for each user without modifying `postgresql.conf` or using `ALTER USER`.\n\n**Note:** Nothing is preventing the user from manually changing this setting at runtime, e.g., by running `SET statement_timeout TO 0`;\n\n<https://docs.pgdog.dev/configuration/users.toml/users/#statement_timeout>",
287
-
"type": [
288
-
"integer",
289
-
"null"
314
+
"anyOf": [
315
+
{
316
+
"$ref": "#/$defs/TimeValue"
317
+
},
318
+
{
319
+
"type": "null"
320
+
}
290
321
],
291
-
"format": "uint64",
292
-
"minimum": 0
322
+
"default": null
293
323
},
294
324
"tls_client_certificate_required": {
295
325
"description": "Require this user to present a client TLS certificate. Defaults to `true`.\n\nOnly enforced when `tls_client_ca_certificate` is configured and the client\nconnected over TLS. Set to `false` to let password and mTLS users share a listener.",
/// Sets the `default_transaction_read_only` connection parameter to `on` on all server connections to this database. Clients can still override it with `SET`.
193
199
///
@@ -196,10 +202,14 @@ pub struct Database {
196
202
/// Overrides the `server_lifetime` setting. Server connections older than this will be closed when returned to the pool.
0 commit comments